docs(runbook): billing time-shift breaks the renewal period key #675

Stängd
öppnade 2026-10-11 17:57:06 +00:00 av supernaut · 0 kommentarer
Ägare

The time-shift procedure in docs/runbook.md (billing test checklist, step 6) breaks a renewal on staging.

  1. It shifts the subscription and charge dates back 31 days but leaves charge.period alone. The renewal then gets the same period key as the first charge and the webhook fails with duplicate key value violates unique constraint "charge_subscription_id_period_unique". It applied only after the first charge's period was moved one month back by hand.
  2. It sets the Mollie subscription startDate to today, while the shift makes the period end today. Billing then reports the next charge one day after Mollie's nextPaymentDate.

Fix: shift charge.period together with the dates, and set startDate to match the shifted period end. Seen in the #579 run.

The time-shift procedure in `docs/runbook.md` (billing test checklist, step 6) breaks a renewal on staging. 1. It shifts the subscription and charge dates back 31 days but leaves `charge.period` alone. The renewal then gets the same period key as the first charge and the webhook fails with `duplicate key value violates unique constraint "charge_subscription_id_period_unique"`. It applied only after the first charge's `period` was moved one month back by hand. 2. It sets the Mollie subscription `startDate` to today, while the shift makes the period end today. Billing then reports the next charge one day after Mollie's `nextPaymentDate`. Fix: shift `charge.period` together with the dates, and set `startDate` to match the shifted period end. Seen in the #579 run.
Logga in för att delta i denna konversation.
Ingen milstolpe
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-infra#675
Ingen beskrivning angiven.