# QUALITY_CHECKLIST.md

Copy this checklist into every PR description. Tick an item only with evidence: a command output, a test name, or a screenshot. Write "N/A" with a reason rather than leaving an item blank.

## Before coding
- [ ] Read the existing code, schema, and tests that the change touches
- [ ] Checked current official docs and the installed versions
- [ ] Listed edge cases and failure modes
- [ ] Checked ENGINEERING_LESSONS.md for related entries
- [ ] Any new dependency is justified, maintained, licence-checked, and pinned

## Code
- [ ] No duplicated business logic (pricing, availability, and status stay server-side)
- [ ] No hard-coded UI strings; EN and AR both present
- [ ] No `dangerouslySetInnerHTML` / `innerHTML` with user data
- [ ] Every async call handles loading, success, and failure; success is shown only after confirmation
- [ ] No console errors or warnings in the browser
- [ ] Dates are stored as `timestamptz`; display respects Asia/Beirut

## Security
- [ ] RLS enabled and policies added or updated for any new or changed table
- [ ] RLS tested as anon, customer A, customer B, and staff/admin
- [ ] No secrets in code, logs, or the client bundle (`grep` the build output)
- [ ] Inputs validated server-side
- [ ] Supabase advisors run with no new warnings
- [ ] `npm audit` reviewed

## Database
- [ ] The migration is reversible, or has a documented rollback
- [ ] Constraints, foreign keys, and indexes considered
- [ ] Applied to dev first; production needs owner approval

## UI / UX
- [ ] Screenshots at 375, 768, and 1280 px
- [ ] Screenshots in EN (LTR) and AR (RTL); directional icons and arrows flip correctly
- [ ] Loading, empty, and error states shown
- [ ] Keyboard navigation works; focus is visible; dialogs trap focus and close with Esc
- [ ] axe scan has no serious or critical issues; contrast meets WCAG 2.2 AA

## Tests and build
- [ ] Type check passes
- [ ] Lint passes
- [ ] Unit and integration tests pass (paste the summary)
- [ ] Playwright E2E passes on desktop and mobile projects
- [ ] Production build succeeds
- [ ] Preview deployment checked by hand

## Release
- [ ] Owner approved the production deploy
- [ ] Rollback path known (previous Vercel deployment and DB rollback)
- [ ] ENGINEERING_LESSONS.md updated if anything was learned
