Skip to main content

Scheduling Service — Sync Contract

Status: populated Owner: TBD Last updated: 2026-04-17 Companion: Service Template · 16 offline-first

1. Per-Aggregate Conflict Policy

AggregateConflict policyRationale
AppointmentAggregateserver_authoritative + optimistic lockSlot reservation requires server-side atomic check; offline booking is not safe
ScheduleAggregateserver_authoritativeAvailability patterns require server-side expansion; offline edits could invalidate active bookings
SlotAggregateserver_authoritativeSlot free/busy state is safety-critical (double-booking prevention); client cannot merge
WaitlistEntryappend_only (additions); server_authoritative (state changes)New waitlist entries accumulate safely; fulfillment must be server-confirmed

2. Offline-first Considerations

ScenarioHandling
View appointment list offlineClients may serve from local cache (read-only)
Book appointment offlineProhibited — slot reservation requires atomic server check
Cancel appointment offlineProhibited — slot release must be server-synchronized
View schedule/availability offlineCached availability data permitted; staleness warning after 15 min
Check-in offlinearrived transition may be queued with timestamp; server validates on reconnect
Reminder preferences offlineRead-only cached; changes queued for sync

3. Optimistic Lock Requirements

All appointment mutations (status update, cancel, reschedule) require version field matching current record. On mismatch: 409 OPTIMISTIC_LOCK_CONFLICT; client must reload and retry.