Design a Flight Booking Orchestrator
Model seat validation, payment authorization, airline confirmation, durable booking state, and compensation.
For this exercise, assume a flight booking orchestration service used by travellers. The core journey is to validate a requested seat and payment, authorize the charge, request airline confirmation, and store the final booking outcome.
The following practice constraints complete the reported seed: each request has an idempotency key; payment authorization and airline confirmation are replaceable dependencies; a failed airline confirmation releases or voids the payment; fare search and ticket servicing are outside scope.
Design the object model, responsibilities, focused contracts, state transitions, and important errors. Protect this invariant: one idempotency key produces at most one charged confirmed booking. Explain how the design reports invalid request, seat unavailable, payment decline, airline timeout, and persistence failure.
Do not implement code; produce a coherent design that can be tested and extended.