renewal-unlock: orders.renews_at lazy expiry + owner unlock notices (ntfy/sms channels, exempt from metering) — verified

This commit is contained in:
2026-08-10 10:10:50 +10:00
parent 8b5db410a3
commit 9d43403f6f
8 changed files with 141 additions and 33 deletions

View File

@@ -1,18 +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)
- [x] 1.1 `db/schema.sql`: idempotent `orders.renews_at TIMESTAMPTZ`; `make db-up`
- [x] 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)
- [x] 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
- [x] 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
- [x] 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
- [x] 4.2 Regressions (72) green; deploy (frontend binary; admin restart)
- [x] 4.3 `openspec validate renewal-unlock`; commit