feat(billing): remind before each automatic renewal charge #310

Sammanfogat
supernaut sammanfogade 4 incheckningar från feat/auto-renew-reminders in i main 2026-10-07 16:39:23 +00:00
Ägare

feat(billing): remind before each automatic renewal charge

The hourly reminder run now also mails auto-renew subscriptions (card, Apple Pay, Google Pay). It reads nextCharge from the billing service (bitborg-payment 0.7.0). With an older service, nothing changes.

Schedule

Plan Reminders before the charge day
Annual, auto-renew 30, 7 and 1 days
Monthly, auto-renew 7 days
One-time Swish year unchanged: 30, 7, 1 and 0 days

Annual keeps the existing 30/7/1 series: 30 days leaves time to cancel by email. Monthly gets one mail so a customer is not mailed every week.

Mail

States the charge date, amount, card (last four digits) or Apple Pay, how to cancel (email info@bitborg.se before that day, as the terms say) and links the account page.

Once per period

  • The claim row is written before the send and released only if the send fails, as before.
  • New: a claim is refused when the same threshold was already recorded for a period end less than 14 days away. A shifted period end therefore does not repeat a reminder. The next monthly period (28+ days) still gets its own.
  • Cancelled, withdrawn and past_due subscriptions report no nextCharge, so they get no mail.

No migration.

Checks

  • Tests written first, seen failing (7), then passing.
  • Full suite with the Postgres tests: 606 passed.
  • check, eslint, stylelint, format:check, mdlint, lang-check, drizzle-kit check, build: clean.
  • Version 1.23.2 → 1.24.0.

Closes bitborg/bitborg-payment#108

Merge after bitborg/bitborg-web#308 (terms say cancel by email) and bitborg/bitborg-payment#109.

## feat(billing): remind before each automatic renewal charge The hourly reminder run now also mails auto-renew subscriptions (card, Apple Pay, Google Pay). It reads `nextCharge` from the billing service (bitborg-payment 0.7.0). With an older service, nothing changes. ### Schedule | Plan | Reminders before the charge day | | ------------------- | ------------------------------- | | Annual, auto-renew | 30, 7 and 1 days | | Monthly, auto-renew | 7 days | | One-time Swish year | unchanged: 30, 7, 1 and 0 days | Annual keeps the existing 30/7/1 series: 30 days leaves time to cancel by email. Monthly gets one mail so a customer is not mailed every week. ### Mail States the charge date, amount, card (last four digits) or Apple Pay, how to cancel (email info@bitborg.se before that day, as the terms say) and links the account page. ### Once per period - The claim row is written before the send and released only if the send fails, as before. - New: a claim is refused when the same threshold was already recorded for a period end less than 14 days away. A shifted period end therefore does not repeat a reminder. The next monthly period (28+ days) still gets its own. - Cancelled, withdrawn and `past_due` subscriptions report no `nextCharge`, so they get no mail. No migration. ### Checks - Tests written first, seen failing (7), then passing. - Full suite with the Postgres tests: 606 passed. - `check`, `eslint`, `stylelint`, `format:check`, `mdlint`, `lang-check`, `drizzle-kit check`, `build`: clean. - Version 1.23.2 → 1.24.0. Closes bitborg/bitborg-payment#108 Merge after bitborg/bitborg-web#308 (terms say cancel by email) and bitborg/bitborg-payment#109.
supernaut lade till 2 incheckningar 2026-10-07 09:09:08 +00:00
The hourly reminder run now also mails auto-renew subscriptions, from the
billing service's nextCharge: 30, 7 and 1 days before an annual charge,
7 days before a monthly one. The mail states the date, the amount, card or
Apple Pay, how to cancel by email, and links the account page.

A claim is refused when the same threshold was already sent for a period
end less than 14 days away, so a shifted period end does not repeat it.
Without nextCharge (an older billing service) nothing changes.

Closes bitborg/bitborg-payment#108
refactor(emails): move the set-up link comment back above its function
Alla kontroller lyckades
ci / ci (pull_request) Successful in 2m1s
a3bde6c015
supernaut lade till 2 incheckningar 2026-10-07 16:32:14 +00:00
supernaut sammanfogade incheckning 4e26ef87ec till main 2026-10-07 16:39:23 +00:00
supernaut tog bort grenen feat/auto-renew-reminders 2026-10-07 16:39:23 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-web!310
Ingen beskrivning angiven.