- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains - Omit embedded publish git dirs and empty placeholders from index Made-with: Cursor
1.3 KiB
1.3 KiB
IT operations — billing and Stripe webhook (Phase 4 outline)
Schema: config/it-operations/entitlements-schema.sql
Spec: SANKOFA_IT_OPERATIONS_CONTROLLER_SPEC.md sections 3.4 and roadmap Phase 4.
Model
entitlementrows represent seats/SKUs bound to anorg_id, optionally linked todbis_coreviaexternal_sku_id(mirrorIruOfferingor catalog id).usage_snapshotrows are appended by a nightly Proxmox metering job (VMID → vCPU/RAM/disk).stripe_webhook_eventstores raw events for idempotency (id= Stripeevent.id).
Webhook handler (future BFF)
- Verify signature with
STRIPE_WEBHOOK_SECRET. - On
customer.subscription.updated/deleted, upsertentitlement(valid_to,seat_count,stripe_subscription_id). - Mark event
processed; on failure storeerrorfor replay.
Keycloak
- Map paid SKUs to optional group claims (e.g.
sankofa-it-adminonly via HR-approved assignment; billing does not auto-grant super-admin).
Finance export
- Nightly job: aggregate
usage_snapshot+ openentitlement→ CSV or QuickBooks/NetSuite API — out of scope for v1 code in this repo; schema supports it.