Reserve a slot atomically when two customers choose it
Two clients load the same available slot and submit together. Add an internal reservation transaction and a final provider availability check before creating an event.
- Focused work estimate
- 4h + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Database concurrency · Outbox · Distributed consistency · Risk communication
Estimated field mix
- Database engineering40%
- Integrations30%
- Distributed systems30%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A fictional consultancy books appointments across time zones. The first connector duplicates events after timeouts and offers slots during stale calendar sync. Use a local calendar-provider double and synthetic calendars.
Setup prerequisites
- Create a local provider double for free/busy, event creation, updates, cancellation, and expiring tokens.
- Use synthetic calendars and an injected clock; no calendar account or outgoing invitation is required.
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
Acceptance criteria
- Overlapping active reservations for one resource are prevented by a database-backed invariant.
- Only the winning reservation can enqueue event creation through a transactional outbox.
- The product distinguishes internal reservation guarantees from provider-side races when the provider lacks atomic hold support.
Implementation constraints
- Use a barrier-controlled race with two synthetic customers.
- If the provider cannot guarantee exclusive booking, record the residual conflict state and provide reconciliation.
Verification to include
- Submit two overlapping reservations concurrently and assert one winner and one outbox event.
- Introduce an external busy event after the first check and verify the booking is rejected or explicitly reconciled under the declared provider contract.
Deliverables
- Reservation constraint, outbox flow, and provider-race analysis
Rollout and recovery
Activate one resource at a time with explicit provider guarantees; pause creation if unresolved conflicts accumulate.
Value of the work
For the engineer: Practice time modeling, conflict-safe booking, external state reconciliation, and credential lifecycle boundaries.
For the team: Review whether integration work protects appointment correctness and offers clear recovery when a provider is uncertain.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.