You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
support loadingType as a top level field on the commonIdentifiers (#25)
# Summary
**This PR addresses Issue #14: `Provide a way to show/provide Additional
Appointment Details`**
The specification includes a framework for [adding custom
properties](https://freightapis.github.io/ssc/#section/Adding-Custom-Properties):
> For the best integration experience for all parties, the SSC
encourages the use of the API specification as-is. However, implementers
may have specific requirements which may necessitate the addition of
custom properties to the specification.
However, multiple organizations have signaled the `loadingType` will be
necessary. Since it is required for multiple organizations we can
consider adding it to the specification rather than following the above
guidelines for adding custom properties. This allows for the
`loadingType` to be well defined while eliminating the need for a future
proof vehicle for changes.
# Proposed Changes
1. `loadingType` is optional when fetching available appointments
2. `loadingType` is returned as part of the fetch available appointment
response
3. `loadingType` is required when booking an appointment
# Discussion
PR #17 is another possible solution to Issue #14. Below is some
commentary comparing this PR to #17 as well as stating how this PR meets
some requirements mentioned in the comments of Issue #14.
### Simplicity
Adding well defined fields may be simpler than using
`appointmentOptions`.
Adding the `loadingType` to the `commonIdentifiers` object makes
`loadingType` an integral part of fetching and scheduling appointments.
It is clear which `loadingType` the client needs, reducing the number of
responses when fetching appointments - only appointments that fit the
specified `loadingType` will be returned.
This also eliminates the need for client side filtering. If
`appointmentOptions` is expanded to accommodate other use cases,
excessive client side filtering may be required to find appointments
that are a good fit.
### Maintainability
Adding well defined fields may be more maintainable than
`appointmentOptions`.
```yaml
appointmentOptions:
description: Options available for a specific appointment
type: array
items:
anyOf:
- $ref: '#/components/schemas/appointmentOptionLoadingType'
- $ref: '#/components/schemas/appointmentOption'
```
The `appointmentOptions` provides specific guidelines regarding
`appointmentOptionLoadingType` while leaving the `appointmentOption`
open for future expansion. Will a future `appointmentOption` be added to
the specification? If not, `appointmentOption` could see overlap and
overuse if not formally defined as `appointmentOptionLoadingType` has
been. An open ended property bag may be harder for clients to maintain.
### Meeting Requirements
1. The solution should be as future proof as possible
2. The solution should handle clients who do not know which loading
types are available
3. The solution should handle appointments that are available for both
LIVE and DROP
#### The solution should be as future proof as possible
This PR offers no framework for future proofing the specification.
Adding a new field to the specification is an object change, requiring
clients to update, rebuild, or regenerate their object to capture the
new field. Yet this is no more effort than recognizing a new
`appointmentOption`. Adding new data to one's implementation via the
`appointmentOption` is still a breaking change because failure to read
and evaluate the new `option` may cause the client to book unsuitable
appointments.
#### The solution should handle clients who do not know which loading
types are available
`loadingType` will be optional in `commonIdentifiers`. This allows
clients to receive all available supported loading types if left blank
in the request to fetch appointments.
#### The solution should handle appointments that are available for both
LIVE and DROP
Some appointments may be available for multiple `loadingTypes`, such as
a 2PM appointment available for both `LIVE` and `DROP`. Instead of
making `loadingType` an `array`, the appointment can be duplicated like
so
```json
{
"status": "SUCCESS",
"appointments": [
{
"id": "1",
"appointmentType": "AUTOMATIC",
"arrivalWindow": {
"startDateTime": "2023-04-15T14:00:00.000-05:00",
"duration": "PT1H"
},
"loadingType": "LIVE"
},
{
"id": "2",
"appointmentType": "AUTOMATIC",
"arrivalWindow": {
"startDateTime": "2023-04-15T14:00:00.000-05:00",
"duration": "PT1H"
},
"loadingType": "DROP"
}
]
}
```
`Note`: Denormalization can cause the number or responses to balloon as
the size of the result set grows with both the number of fields and the
number of options for each field. Clients should consider specifying as
much as possible in the request body to make sure each available
appointment returned is relevant.
description: The appointment details requested by the client
@@ -1209,6 +1224,8 @@ components:
1209
1224
$ref: '#/components/schemas/dockGroup'
1210
1225
dockDoor:
1211
1226
$ref: '#/components/schemas/dockDoor'
1227
+
loadingType:
1228
+
$ref: '#/components/schemas/loadingType'
1212
1229
availableAppointment:
1213
1230
type: object
1214
1231
title: Available Appointment
@@ -1224,6 +1241,8 @@ components:
1224
1241
$ref: '#/components/schemas/dockGroup'
1225
1242
dockDoor:
1226
1243
$ref: '#/components/schemas/dockDoor'
1244
+
loadingType:
1245
+
$ref: '#/components/schemas/loadingType'
1227
1246
appointment:
1228
1247
type: object
1229
1248
title: Appointment
@@ -1237,6 +1256,8 @@ components:
1237
1256
$ref: '#/components/schemas/dockGroup'
1238
1257
dockDoor:
1239
1258
$ref: '#/components/schemas/dockDoor'
1259
+
loadingType:
1260
+
$ref: '#/components/schemas/loadingType'
1240
1261
appointmentArrivalWindow:
1241
1262
type: object
1242
1263
description: The window of time that a carrier is allowed to arrive for the appointment. Specified by a start time and the duration of the arrival window.
0 commit comments