# End-to-End QA Checklist

Run after a clean install. Assumes MySQL + Redis are up.

## 0. Install
- [ ] `cp .env.example .env` → set DB_* and REDIS_*
- [ ] `php artisan key:generate`
- [ ] `php artisan migrate:fresh --seed` completes with no errors
- [ ] `php artisan storage:link`
- [ ] `php artisan serve` and (for broadcasts) `php artisan queue:work`

## 1. Auth & RBAC
- [ ] `/login` — role selector; wrong role for valid creds is rejected; inactive account rejected
- [ ] Admin (`admin@drduttaclinic.in` / `password`) → admin dashboard
- [ ] Staff (`frontdesk@…`) → no **Reports**/**Audit** nav; `/admin/reports` → 403
- [ ] Doctor (`ananya@…`) → doctor area; `/admin/dashboard` → 403
- [ ] 6 bad logins → lockout message

## 2. Booking → Allocation → Appointment
- [ ] `/book` → date + details → confirmation with `APT-####`
- [ ] Appears in `/admin/allocation` (source **Public**, Pending Allocation)
- [ ] Allocate department + doctor → status **Allocated**, shows on doctor's dashboard
- [ ] `/admin/appointments` → Confirm / Cancel work

## 3. Patients
- [ ] Add patient with doctor + date → 360 profile; appointment created (Allocated)
- [ ] Directory search + filters; balance-due column correct
- [ ] Physiotherapy seed patient shows **₹2,500** due

## 4. Catalogs
- [ ] Add a Clinical Disease / Diagnosis (dept + cost/sitting) → selectable in Add-Patient & Allocation
- [ ] Add a medicine with 2 compositions → both persist through edit

## 5. Consultation → Prescription
- [ ] Doctor: start consultation → pick diagnosis + sittings (live cost) + vitals + medicines
- [ ] Complete → charge posts to ledger; follow-up appointment created; prescription prints in F9 format (logo, vitals, composition subtext, signature)

## 6. Billing
- [ ] Record ₹2,500 on the seed patient → balance ₹0; receipt in History
- [ ] Treatment Procedures → add "Laser Treatment × 2" → ₹3,000 charge in ledger
- [ ] Documents → upload JPG (stored `.webp`) + PDF (as-is); both download

## 7. Broadcasting (worker running)
- [ ] Create template with `{patient_name}` → picker fills message
- [ ] Send SMS to "All patients" → History + one SMS log per patient (failed "not configured" until Tubelight creds set)
- [ ] "Pending payments" segment targets only patients with dues

## 8. Reports & Dashboard (admin)
- [ ] Dashboard counts + 2 charts render; today's schedule matches appointments
- [ ] Reports totals + service/doctor/department revenue + part-payment feed

## 9. Security
- [ ] Cancel appointment / record payment / change module access → each in `/admin/audit-log`
- [ ] Clinic Profile: change currency symbol + logo → reflected app-wide and on prescription
