46 lines
1.6 KiB
Markdown
46 lines
1.6 KiB
Markdown
# Booking Integrity
|
|
|
|
This ExecPlan follows `docs/PLANS.md`.
|
|
|
|
## Purpose / Big Picture
|
|
Reject invalid booking windows and staff double-booking; accept only schedule-valid requests.
|
|
|
|
## Progress
|
|
- [x] (2026-02-28 13:05Z) Plan created.
|
|
- [x] (2026-02-28 13:30Z) Validation service implemented (duration/availability/overlap).
|
|
- [x] (2026-02-28 13:45Z) Tests added.
|
|
- [x] (2026-02-28 13:50Z) Risks updated.
|
|
|
|
## Surprises & Discoveries
|
|
- Observation: `makemigrations` unavailable in one environment due missing Django.
|
|
Evidence: import error during initial migration step.
|
|
|
|
## Decision Log
|
|
- Decision: require `staff` on booking creation.
|
|
Rationale: no deterministic schedule validation without staff.
|
|
Date/Author: 2026-02-28/Codex
|
|
- Decision: no-availability-records => open schedule.
|
|
Rationale: backward compatibility while enabling stricter config when data exists.
|
|
Date/Author: 2026-02-28/Codex
|
|
|
|
## Outcomes & Retrospective
|
|
Completed. Booking integrity checks are active with tests for core failure modes.
|
|
|
|
## Context and Orientation
|
|
- Validation entrypoint: `backend/apps/bookings/services.py`
|
|
- Create serializer: `backend/apps/bookings/serializers.py`
|
|
- Staff availability model: `backend/apps/salons/models.py`
|
|
|
|
## Plan of Work
|
|
Completed; remaining future policy work is timezone/business-hours specifics.
|
|
|
|
## Validation and Acceptance
|
|
From `backend/`:
|
|
- `python3 -m pytest backend/apps/bookings/tests`
|
|
Acceptance:
|
|
- Invalid duration/availability/overlap cases return 400.
|
|
- Valid windows return 201.
|
|
|
|
## Idempotence and Recovery
|
|
Validation is stateless; schema change is additive and reversible by standard migrations.
|