feat(status): report the next scheduled renewal charge #109

Sammanfogat
supernaut sammanfogade 2 incheckningar från feat/auto-renew-reminders in i main 2026-10-07 17:10:05 +00:00
Ägare

feat(status): report the next scheduled renewal charge

subscriptionStatus gains nextCharge, so the portal can remind a customer before each automatic renewal charge.

nextCharge: {
  on: "2027-10-07",      // provider charge day, Amsterdam calendar
  amountMinor: 150000,   // gross, as each renewal charge copies it
  currency: "SEK",
  method: "card" | "applepay",  // Google Pay is charged as a card
  last4: "4242" | null,
} | null

It is null unless the subscription renews automatically, is active, is not cancelled, is not withdrawn and has a provider subscription. One-time Swish years, past_due and incomplete report null.

The reminder emails are sent by the portal (bitborg-web), which already runs the Swish reminders. Its PR reads this field.

Versions

  • Service 0.6.0 → 0.7.0, contract 0.7.0 → 0.8.0.
  • #107 makes the same bumps. Whichever merges second takes the next minor (service 0.8.0, contract 0.9.0). No migration here, so nothing else conflicts.

Checks

  • Tests written first, seen failing (10), then passing.
  • Full suite against Postgres 17: 376 passed.
  • typecheck, eslint, format:check, drizzle-kit check, build (both packages): clean.

Part of #108.

## feat(status): report the next scheduled renewal charge `subscriptionStatus` gains `nextCharge`, so the portal can remind a customer before each automatic renewal charge. ```ts nextCharge: { on: "2027-10-07", // provider charge day, Amsterdam calendar amountMinor: 150000, // gross, as each renewal charge copies it currency: "SEK", method: "card" | "applepay", // Google Pay is charged as a card last4: "4242" | null, } | null ``` It is null unless the subscription renews automatically, is `active`, is not cancelled, is not withdrawn and has a provider subscription. One-time Swish years, `past_due` and `incomplete` report null. The reminder emails are sent by the portal (bitborg-web), which already runs the Swish reminders. Its PR reads this field. ### Versions - Service 0.6.0 → 0.7.0, contract 0.7.0 → 0.8.0. - #107 makes the same bumps. Whichever merges second takes the next minor (service 0.8.0, contract 0.9.0). No migration here, so nothing else conflicts. ### Checks - Tests written first, seen failing (10), then passing. - Full suite against Postgres 17: 376 passed. - `typecheck`, `eslint`, `format:check`, `drizzle-kit check`, `build` (both packages): clean. Part of #108.
supernaut lade till 1 incheckning 2026-10-07 09:07:22 +00:00
feat(status): report the next scheduled renewal charge
Alla kontroller lyckades
ci / ci (pull_request) Successful in 2m12s
b6a15af148
subscriptionStatus gains nextCharge: the provider's charge day, the
amount, card or Apple Pay, and the last four digits. It is set only while
an auto-renew subscription is active and not cancelled, so the portal can
send a renewal reminder before each charge.

Contract 0.8.0, service 0.7.0.

Part of #108
supernaut lade till 1 incheckning 2026-10-07 17:03:50 +00:00
Merge branch 'main' into feat/auto-renew-reminders
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m57s
80f2a16db9
supernaut sammanfogade incheckning 7bd1ba58c3 till main 2026-10-07 17:10:05 +00:00
supernaut tog bort grenen feat/auto-renew-reminders 2026-10-07 17:10:06 +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-payment!109
Ingen beskrivning angiven.