Closed treverthomasET closed 11 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
opencab | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Dec 12, 2023 3:30pm |
@treverthomasET @pnc I just want to be clear about the expected object shape, should this PR be merged.
Can you please confirm that the expected object should look like this, with just a single array for all drivers' HosData
?
If so, is the expectation that the driver currently operating the vehicle is first in the array?
{
"teamHosData": [
{
// HosStatus for driver
"clocks": ClockData[],
"logoutAction": "",
"manageAction": "",
"username":""
},
{
// HosStatus for coDriver1
...
},
{
// HosStatus for coDriver2
...
},
...
]
}
From my understanding, this is an example of what is not expected:
{
"hosData": {
// HosStatus for driver
"clocks": ClockData[],
"logoutAction": "",
"manageAction": "",
"username":""
},
"teamHosData": [
{
// HosStatus for coDriver1
...
},
{
// HosStatus for coDriver2
...
},
...
]
}
@BoKlassen Ah I can see how that could be confusing. I've updated the Data Objects section above to hopefully clear it up slightly for any other future readers:
When the HOS Consumer calls HOSContract.METHOD_GET_HOS
we will be expecting your second definition where
KEY_HOS
contains HOSData
for the driver
{
"hosData": {
// HosStatus for driver
"clocks": ClockData[],
"logoutAction": "",
"manageAction": "",
"username":""
},
}
and KEY_TEAM_HOS
will contain HOSTeamData
corresponding to any team drivers/co drivers
{
"teamHosData": [
{
// HosStatus for coDriver1
...
},
{
// HosStatus for coDriver2
...
},
...
]
}
Summary
This PR updates the
HOSContract
to version0.4
to support multi-user logins to allow for driver switching to be reflected in the HOS Consumer application when queryingHOSContract.METHOD_GET_HOS
.For the HOS Consumer to support the user switching the
KEY_HOS
(sometimes referred to as active driver) will need to know theusername
provided byIdentityContract.DriverSession.username
during the IdentityConsumers(ELD app) query METHOD_GET_LOGIN_CREDENTIALS.There is an RFC currently open for discussion that this work is intended for. The most notable callout from the RFC is the need to remove
Parcel
as our means of data transfer withinBundle
. Parcel does not like having missing data if the applications communicating do not have matching Class versions.We've decided to show the work required for Option 2 on the RFC above as that is the preferred direction we would like to go. This allows us to have less Class name changes in the future to support backwards compatibility.
One change to note below is
HOSTeamData
. To cleanly pass a list ofHOSData
we've now placed that within it's own object calledHOSTeamData
that contains theArrayList<HOSData
. This allows the JSON conversion to be called without needing a list conversion orTypeToken
.Data Objects
Version = 0.4 HOSStatusV2(0.3) -> HOSData(0.4) HOSClockV2(0.3) -> ClockData(0.4) ArrayList(0.3) -> HOSTeamData(0.4)
HOSData -> Returned from
HOSContract.METHOD_GET_HOS
withinKEY_HOS
username
additionHOSTeamData -> Returned from
HOSContract.METHOD_GET_HOS
withinKEY_TEAM_HOS
Sample Provider Bundle Call
From the provided Java object
or straight from JSON itself
Sample Consumer Bundle Call