# QC — Job trigger routes

Open these URLs in the browser to run each job.

| Job | What it does | URL |
|-----|--------------|-----|
| Mark expired | Updates subscription status after the end date (expired / grace / last chance). Run this **before** auto-renew or last-chance checks. | `/qc/jobs/mark-expired` |
| Last Chance warnings | Sends reminder email + WhatsApp to unpaid accounts at day 90, 105, and 118 after their subscription ended. Link points them to reinstate / pay. Does **not** delete the account. | `/qc/jobs/send-last-chance-warnings` |
| Auto-renewals | Tries to renew subscriptions that ended in the last 3 days and have auto-renew on. Charges the saved card (or applies a queued upcoming plan). | `/qc/jobs/process-auto-renewals` |
| Cold archive | After 120 unpaid days, archives the account: saves a registry record and removes the account data. This is the final step. | `/qc/jobs/process-cold-archive` |

---

## Mark expired — cases

| Case | Who | When (days after end date) | Result |
|------|-----|----------------------------|--------|
| Monthly / non-annual expired | Monthly (or any plan that is not annual), status active or trial | End date already passed (day 1+) | Status → **expired** |
| Annual grace | Annual, status active or trial | Day **1–7** after end date | Status → **grace_period** (still in grace) |
| Annual expired | Annual, status active, trial, or grace_period | Day **8+** after end date | Status → **expired** |
| Last chance | Monthly or annual | Day **90+** after end date | Status → **expired** + last-chance flag on (account enters last-chance phase) |

Notes for QC:

- Day counts are from the subscription **end date**.
- Last chance does **not** archive data; it only flags the account (warnings and cold archive come later).
- Safe to open the mark-expired URL more than once.
