Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of "lastChecked" Field #145

19 changes: 19 additions & 0 deletions code/API_definitions/device-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ info:
- `CONNECTED_DATA`, if device is connected to the network via data usage
- `NOT_CONNECTED`, if device is not connected to the network

* **lastChecked** : Indicate when the information provided was last confirmed to be correct.
# API Functionality

The API exposes following capabilities:
Expand Down Expand Up @@ -151,12 +152,15 @@ paths:
examples:
Connected-With-SMS:
value:
lastChecked: "2024-02-20T10:41:38.657Z"
connectivityStatus: CONNECTED_SMS
Connected-With-DATA:
value:
lastChecked: "2024-02-20T10:41:38.657Z"
connectivityStatus: CONNECTED_DATA
Not-Connected:
value:
lastChecked: "2024-02-20T10:41:38.657Z"
connectivityStatus: NOT_CONNECTED
"400":
$ref: "#/components/responses/Generic400"
Expand Down Expand Up @@ -201,16 +205,19 @@ paths:
examples:
No-Country-Name:
value:
lastChecked: "2024-02-20T10:41:38.657Z"
roaming: true
countryCode: 901
countryName: []
Single-Country-Code:
value:
lastChecked: "2024-02-20T10:41:38.657Z"
roaming: true
countryCode: 262
countryName: ["DE"]
Multiple-Country-Codes:
value:
lastChecked: "2024-02-20T10:41:38.657Z"
roaming: true
countryCode: 340
countryName: ["BL", "GF", "GP", "MF", "MQ"]
Expand Down Expand Up @@ -466,24 +473,36 @@ components:
RoamingStatusResponse:
type: object
required:
- lastChecked
- roaming
properties:
lastChecked:
$ref: "#/components/schemas/LastChecked"
roaming:
$ref: "#/components/schemas/ActiveRoaming"
countryCode:
$ref: "#/components/schemas/CountryCode"
countryName:
$ref: "#/components/schemas/CountryName"

LastChecked:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me the name is not clear enough, what was checked? Maybe the name should follow the device-status pattern: LastStatusTime

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the field represents the time when the status was last checked, using "checked" instead of "status" would indeed be more appropriate and clearer in conveying the purpose of the field . However, I'm open to updating the field name to either "LastCheckedTime" or "LastStatusTime". I'd like to hear feedback from others on which option the team prefers.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also like "lastStatusTime". It is similar to what has been done in DeviceLocation with "lastLocationTime". https://github.com/camaraproject/DeviceLocation/blob/main/code/API_definitions/location-retrieval.yaml#L239

description: Last time that the associated device roaming status/connectivity was checked and, if necessary, updated
type: string
format: date-time
example: "2024-02-20T10:41:38.657Z"

ActiveRoaming:
description: Roaming status. True, if it is roaming
type: boolean

ConnectivityStatusResponse:
type: object
required:
- lastChecked
- connectivityStatus
properties:
lastChecked:
$ref: "#/components/schemas/LastChecked"
connectivityStatus:
$ref: "#/components/schemas/ConnectivityStatus"

Expand Down