openspec: renewal-unlock change

This commit is contained in:
2026-08-10 10:08:06 +10:00
parent 17150c405d
commit 8b5db410a3
6 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
## 1. Schema & Notify
- [ ] 1.1 `db/schema.sql`: idempotent `orders.renews_at TIMESTAMPTZ`; `make db-up`
- [ ] 1.2 `internal/notify`: Notifier (ntfy POST + sms via sms.Sender; `NOTIFY_CHANNEL` env: ntfy|sms|both; `NTFY_URL`/`NTFY_TOPIC` env)
## 2. Gating Integration
- [ ] 2.1 `scan.go`: `shouldAlert` returns (bool, reason); lapsed branch uses renews_at lazy expiry; handler calls `notifyUnlock` when blocked by lapsed or credits (message: plan lapsed / out of credits + tag link)
## 3. Admin
- [ ] 3.1 OrderResource: `renews_at` date-time picker + table column; lapsed badge when past due
## 4. Verification
- [ ] 4.1 New suite: order paid + renews_at past → blocked + unlock notice logged; credits exhausted → blocked + notice; NOTIFY_CHANNEL=sms → notice via log sender; unpaid (non-paid status) → notice
- [ ] 4.2 Regressions (72) green; deploy (frontend binary; admin restart)
- [ ] 4.3 `openspec validate renewal-unlock`; commit