# Development checklist

| Phase | Status |
|---|---|
| 0 Architecture | Done |
| 1 Foundation (this release) | Done, see docs/TESTING.md |
| 2 Business profiles, verification, categories, services | Done, see docs/TESTING.md |
| 3 Search + location (Leaflet/OpenStreetMap, vendored) | Done, see docs/TESTING.md |
| 4 Bookings, QR scan/check-in, booking emails | Not started |
| 5 Booking-linked chat + phone-number filter | Not started |
| 6 Disputes, moderation, reports, exports | Not started |
| 7 Commission ledger (disabled at launch) | Not started |
| 8 PWA | Not started |
| 9 Hardening and launch | Not started |

## Phase 1 acceptance
- [x] Runs under a sub-path (`/bizmtaani/`) and at a root path, no hardcoded paths
- [x] Migrations apply on an empty DB and re-run safely
- [x] Registration, login, rate limit, verification, reset, logout
- [x] CSRF, role separation, employee permissions enforced server-side
- [x] Admin created by CLI with no default password
- [x] Welcome (customer/provider) and verification emails separate; SMTP path via PHPMailer verified against a fake SMTP server
- [x] Secrets/source/SQL/logs blocked by Apache rules (checked on Apache 2.4)
- [ ] Verified on real Windows XAMPP (not possible in my environment: you must confirm)
- [ ] Verified with your real SMTP provider (you must confirm)
- [ ] Visual check on real phones (not done)

## Phase 2 acceptance
- [x] Provider can build a profile, hours, photos, services and submit only when the required checklist is complete
- [x] Admin/staff review with permissions; reasons required for negative decisions; invalid transitions refused
- [x] Provider emails (approved / rejected / more info / suspended) and in-app notifications
- [x] Unapproved, hidden, suspended or deactivated businesses are never public
- [x] Providers cannot touch each other's services, photos or documents; documents only via authorised controller
- [x] Upload attacks rejected (PHP disguised as image, polyglots, oversize, tiny, text as PNG)
- [x] Category synonyms resolve Kenyan terms and spelling variants
- [ ] Real-phone visual check of the new pages (not done)
- [ ] Admin-created businesses/provider accounts (spec section 17C): not built yet, planned with Phase 6 admin tools

## Phase 3 acceptance
- [x] Guests can search without logging in; only legitimate businesses appear
- [x] Keyword + Kenyan alias search, category, county, place name, price, open-now, distance, sorting, pagination
- [x] Manual location works with geolocation denied and with the geocoder off or failing
- [x] Location never stored or exposed; hidden-exact-location rounds public coordinates
- [x] Leaflet served locally; OSM tiles only; CSP-safe; popups cannot inject HTML
- [x] Provider can pin the business on a map
- [ ] Real-browser check of map rendering, tiles, dragging and geolocation prompts (jsdom only; the approximate-area circle could not be drawn in jsdom)
- [ ] Live Nominatim lookups (tests use a local fake; set GEOCODE_EMAIL before launch)
- [ ] "Verification filters" from the spec: every listed business is already verified, so there is nothing to filter on yet


## Phase 4 acceptance
- [x] Customer can request a fixed-price service with a future date/time and quantity.
- [x] Server reads price from the database and snapshots price/name at booking time.
- [x] Duplicate form submissions are guarded by an idempotency key.
- [x] Provider sees only bookings for their own business and can confirm/reject eligible requests.
- [x] Status transitions are checked centrally and written to booking history.
- [x] QR tokens are random and only SHA-256 hashes are stored; check-in verifies provider ownership.
- [x] Check-in event has a unique booking/event key to prevent duplicate redemption.
- [x] Customer/provider booking notifications use the existing email outbox.
- [x] Admin/employee with bookings.view can view recent bookings.
- [ ] Verify full booking flow on Windows XAMPP with a disposable database and real browser.
- [ ] Verify real SMTP delivery and camera/browser QR behavior on the target phones.


## Phase 4 revised acceptance checks
- [ ] Provider can add/edit product listings and upload JPG/PNG/WebP product photos.
- [ ] Product listings support fixed price or seller-confirmed price, unit and optional stock quantity.
- [ ] Customer can add products from one seller to a cart and submit an order without online payment.
- [ ] Seller can confirm quoted prices while accepting an order; total updates and customer receives an update email.
- [ ] Fixed-price tracked stock is reserved at order submission and restored if seller rejects/cancels; quote-priced stock is reserved when seller confirms.
- [ ] Customer receives branded itemised order receipt with an inline QR PNG.
- [ ] Customer receives branded booking confirmation receipt with an inline QR PNG after provider confirmation.
- [ ] Collection QR is accepted only for the owning provider and only when ready for collection; delivery QR only when out for delivery. Repeated scans do not change the status again.
- [ ] Email failure does not roll back a committed order/booking.
- [ ] Confirm SMTP and QR image generation with the actual Windows XAMPP extensions and email provider.
