This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
Refactor: Rewrite and simplify the data model for booking #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The carrier SMEs have decided that there should be one and only one
endpoint for bookings. This means the distinguish between a
BookingRequest
andConfirmedBooking
should no longer be entity butonly status level changes.
To prepare for that, I have rewritten the data model with this focus
in mind. In this rewrite,
BookingRequest
andConfirmedBooking
arereplaced by
Booking
andBookingData
.The
BookingData
contains the combined set of attributes fromBookingRequest
andConfirmedBooking
with a very few "meta data"attributes (such as
carrierBookingRequestReference
,carrierBookingReference
, and thebookingStatus
). Everything elseis in the
BookingData
entity.Because this is a massive internal rewrite, I made it a goal to keep
the postman test passing running without any changes to the postman
collection. This should give us confidence that this is purely an
internal "implementation-detail"-level rewrite. No externally visible
contracts have chanced.
Other notes:
Henrik is still working on the updated Swagger specs for the new
design. It is currently a private draft at DRAFT-SWAGGER
I made no changes to TOss. Again to avoid changing the postman
tests. I expect we will able to regnerate those once Henrik is
done with the swagger rewrite.
for the same reason. The only change is a rename of a method in a
service used by a controller).
Most of the SQL changes is removing now redundant SQL test data.
Most of it became redundant with the removal of the summaries
endpoint, but was not removed at the time. I removed it in this
commit because the data was not used anyway and in some cases
violated "1-1" constraints (we had multiple ConfirmedBookings
linking to the BookingRequest, which is no longer possible in
the new data model design).
I had to keep some "dead" attributes around (such as the "create"
and "update" timestamps) because they are required by a JSON schema
in the postman collection. The reference implementation does not
maintain these field as strictly as before as they are scheduled
for removal (DT-389). Just enough to satisify the JSON schema
requirement to avoid having to touch the postman collection. I
have spinkled TODO around with a refrence to DT-389 where I thought
it was relevant.
Signed-off-by: Niels Thykier [email protected]