freightapis / ssc

Holds artifacts created by the SSC
https://www.freightapis.org/
Other
16 stars 4 forks source link

Functional flows/acceptance criteria for fetch available appointments #21

Open kkuo opened 1 year ago

kkuo commented 1 year ago
  1. When I provide a primaryReferenceNumber and a locationIdentifier, I should receive a successful response with the response defined in the spec.
dutabado commented 1 year ago

criteria i think we should add:

Core Scenarios

Error Scenarios

kkuo commented 1 year ago

Webhook Scenarios

  • When I have a fetch-available-appointments webhook event registered with the TMS, and TMS fails to call the callbackURL that I have registered at the TMS, then I should receive a synchronous FAILURE code so that I am aware of the problem with the webhook and take appropriate actions

@dutabado @miller79 what are your thoughts if the callback URL has an error and the TMS can't make a call to it. How is that error surfaced to the client? Should I just take out the above bullet point since it is undefined?

Callback Header Scenarios

  • When I have a fetch-available-appointments webhook event registered with the TMS, and TMS fails to call the callbackURL that I have registered at the TMS, then I should receive a synchronous FAILURE code so that I am aware of the problem with the webhook and take appropriate actions

@dutabado @miller79 ^^ Same for callback URLs

dutabado commented 1 year ago

How is that error surfaced to the client? Should I just take out the above bullet point since it is undefined?

yeah, i don't know that the TMS can do anything here. this is why i was thinking it might make sense to have some sort of status field on the webhooks so the client can regularly check for broken webhooks

dutabado commented 1 year ago

then I should receive a synchronous FAILURE code so that I am aware of the problem with the webhook and take appropriate actions

or were you suggesting the if the TMS knows the webhook is invalid or doesn't exist, that it should fail any synchronous calls that rely on webhooks?

kkuo commented 1 year ago

then I should receive a synchronous FAILURE code so that I am aware of the problem with the webhook and take appropriate actions

or were you suggesting the if the TMS knows the webhook is invalid or doesn't exist, that it should fail any synchronous calls that rely on webhooks?

I'm not sure this flow is correct or logic but this is what I was thinking

  1. callers call fetchAvailableAppointments
  2. TMS has a status for the registered callback. see the status is invalid, fails the synchronous request so the caller knows about it.
  3. Otherwise if the callback fails when the response is ready but there is no way for the TMS to indicate that to the client