feat(billing): renewal reminders for one-time yearly payments #302
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-web!302
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/297-renewal-reminders"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Customers on a one-time yearly payment get reminded before their plan ends, so they never lose access by surprise.
scripts/server.mjssets a random per-processINTERNAL_JOB_TOKEN, andscripts/renewal-reminders.mjsPOSTs to127.0.0.1:$PORT/api/internal/renewal-reminders60 s after start and then hourly. The route answers 404 without the token. No new env and no infra timer; with billing or Kanidm unconfigured it does nothing.subincheckout_consents. Name and email come from Kanidm, the plan fromsubscriptionStatus. Onlyrenewal === "none"with a futurepaidUntilqualifies, so auto-renew customers never get a reminder.paidUntil, plus one on the last day, counted in Stockholm calendar days. A run that missed a threshold sends only the latest one due.renewal_reminders(primary key sub, paid_until, threshold) is inserted withON CONFLICT DO NOTHINGbefore each send, and deleted if the send fails so the next run retries. A newpaidUntilstarts a fresh series.checkout_consents.lang, recorded at checkout; old rows read as Swedish.paidUntil, using the same rule as the emails.0010is additive.Tests: 599 passed, including the DB tests and two parallel claims against Postgres. Build passes. Version 1.22.0.
Closes #297.