billing: split billing.ts by job #120

Stängd
öppnade 2026-10-08 21:12:29 +00:00 av supernaut · 0 kommentarer
Ägare

What

src/billing.ts is 1924 lines with five jobs.

Why

Chargeback handling (applyChargeback, reverseChargeback, about 330 lines) and sweep and reconcile (about 250 lines) are separate jobs. STOCKHOLM_DATE exists in both billing.ts and withdrawal.ts. amsterdamMidnight and stockholmMidnight are near copies.

Fix

Move chargeback code to src/chargebacks.ts and sweep and reconcile to src/reconcile.ts. One shared zonedMidnight(zone, day). Move code only. Split the test file the same way.

Done when

  • Tests pass unchanged apart from imports.
  • One midnight helper.
## What `src/billing.ts` is 1924 lines with five jobs. ## Why Chargeback handling (`applyChargeback`, `reverseChargeback`, about 330 lines) and sweep and reconcile (about 250 lines) are separate jobs. `STOCKHOLM_DATE` exists in both `billing.ts` and `withdrawal.ts`. `amsterdamMidnight` and `stockholmMidnight` are near copies. ## Fix Move chargeback code to `src/chargebacks.ts` and sweep and reconcile to `src/reconcile.ts`. One shared `zonedMidnight(zone, day)`. Move code only. Split the test file the same way. ## Done when - [ ] Tests pass unchanged apart from imports. - [ ] One midnight helper.
supernaut lade till detta till projektet Bitborg Payment 2026-10-08 21:14:13 +00:00
supernaut refererade till detta ärende från en incheckning 2026-10-18 19:02:01 +00:00
Logga in för att delta i denna konversation.
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#120
Ingen beskrivning angiven.