2.2 KiB
BILL-03 · Lago-Gateway fuer Customers, Plans, Subscriptions und Invoices
| Typ | Dev (Code) |
| Owner | Raffael |
| Phase | Billing-Recut nach AD-27 |
| Cycle/Fenster | nach BILL-01/BILL-02 |
| Status | Umgesetzt / bereit fuer Review |
Abhaengigkeiten & Parallelitaet
- Blocked by:
BILL-01,BILL-02 - Blocks:
BILL-05,BILL-06,BILL-07
Was wir bauen
Ein serverseitiges Lago-Gateway in HiveGrid. HiveGrid erstellt/liest Customers, Plans, Subscriptions und Invoice-Status ueber Lago, aber UI-Komponenten sprechen nie direkt mit Lago.
Definition of Done
- Lago-API-Client mit klarer Env-Konfiguration fuer Staging.
- Customer-Erstellung fuer Tenant.
- Plan-/Seat-Subscription erstellen und lesen.
- Invoice-/Subscription-Status abrufen.
- Lago-Webhook-Endpunkt oder Pull-Sync-Job definiert und idempotent.
- Outbox/Retry fuer ausgehende Billing-Sync-Aktionen.
- Fehlertexte klar und ohne Stacktrace.
- Tests gegen Mock/Fixture der Lago-API.
Fortschritt: BILL-03: 8/8 DoD = 100 % done.
Nicht im Scope
- Mollie-Zahlung.
- Usage Events.
- Customer-facing Billing UI.
Technische Bausteine
BillingGateway-Interface, konkrete ImplementierungLagoBillingGateway.- Zod-Schemas fuer Lago-Antworten.
- Redaction fuer API-Keys und Payment-/Invoice-IDs in Logs.
Umsetzungsnotiz
2026-07-04: Server-Gateway fuer Lago umgesetzt. Neues Package @hivegrid/billing enthaelt das
BillingGateway-Interface, LagoBillingGateway, Zod-Response-Schemas, Redaction-Helfer,
Webhook-Event-Parsing und idempotente Outbox-Args fuer billing.lago.sync. Die API-Konfiguration kennt jetzt
LAGO_API_URL, LAGO_API_KEY, LAGO_WEBHOOK_SECRET und LAGO_TIMEOUT_MS; .env.example ist aktualisiert.
Bewusst noch nicht gebaut: Customer-facing UI, Mollie-Zahlung und echte Worker-Ausfuehrung des Syncs. Der
idempotente Pull/Webhook-Sync ist als Outbox-Event-Kontrakt definiert und wird in BILL-05 konsumiert.
Proof:
pnpm --filter @hivegrid/billing typecheckpnpm --filter @hivegrid/billing testpnpm --filter @hivegrid/config test
Quellen
- AD-27
- Lago API Docs
BILL-01,BILL-02