fix(billing): drop the trial and participant tiers when payment grants tier_pro #132

Sammanfogat
supernaut sammanfogade 2 incheckningar från fix/drop-trial-group-on-payment in i main 2026-10-11 16:10:19 +00:00
Ägare

Closes #131

A trial user who paid kept tier_trial next to tier_pro. Paying now removes tier_trial and tier_participant right after the tier_pro grant. Removal is idempotent, so a missing membership is fine. Expiry and cancellation still fall back as before.

A failed removal does not block the payment. It logs [grant] could not remove <group>: <error> and continues. The reconciler picks paid while both groups are present, so quota stays correct. A failure to add tier_pro still rolls back, as before.

The removal works once bitborg-billing may manage tier_trial and tier_participant (bitborg/bitborg-infra#667). Until that is applied, payments succeed, the trial group stays and the warning is logged.

Tests: a paid checkout calls removeFromGroup for tier_trial and tier_participant, never for tier_pro. When removing tier_trial fails with a 403, the grant still succeeds and the charge is applied. Existing revocation tests count tier_pro removals only. 420 tests pass. Version 0.10.1.

Closes #131 A trial user who paid kept `tier_trial` next to `tier_pro`. Paying now removes `tier_trial` and `tier_participant` right after the `tier_pro` grant. Removal is idempotent, so a missing membership is fine. Expiry and cancellation still fall back as before. A failed removal does not block the payment. It logs `[grant] could not remove <group>: <error>` and continues. The reconciler picks `paid` while both groups are present, so quota stays correct. A failure to add `tier_pro` still rolls back, as before. The removal works once `bitborg-billing` may manage `tier_trial` and `tier_participant` (bitborg/bitborg-infra#667). Until that is applied, payments succeed, the trial group stays and the warning is logged. Tests: a paid checkout calls `removeFromGroup` for `tier_trial` and `tier_participant`, never for `tier_pro`. When removing `tier_trial` fails with a 403, the grant still succeeds and the charge is applied. Existing revocation tests count `tier_pro` removals only. 420 tests pass. Version 0.10.1.
supernaut lade till 2 incheckningar 2026-10-11 16:07:43 +00:00
supernaut schemalade den här ändringsförfrågan för automatisk sammanfogning när alla kontroller lyckas 2026-10-11 16:09:15 +00:00
supernaut sammanfogade incheckning 5b97a9cb4f till main 2026-10-11 16:10:19 +00:00
supernaut tog bort grenen fix/drop-trial-group-on-payment 2026-10-11 16:10:19 +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!132
Ingen beskrivning angiven.