Skip to main content

Deduction V2

Introduces real-time balance hold (deduction V2.0) for Qontak One billing, replacing the current post-hoc deduction model with an upfront hold-and-settle flow that prevents over-consumption before quota is confirmed.

Scope Changes

  • Backend — real-time balance-hold deduction logic; quota reservation and settlement flow (hub_core, T1–T7, shipped). The core client-visible change is the get usage balance endpoint returning Available (Pooled − Reserved). Plus Part 2 (M0–M3, M5 BE): a settled_charged_amount column on the settlement rollup (M0), the wa_hold_settlement flag exposed on billing_info + replicated into moderator-be (M1a/M1b), new hub_core GET + download APIs reading the wa_reconciliation_batches rollup (M2/M3), and the moderator-be modpanel wiring that proxies V2 downloads to hub_core (M5). See ADR-0002.
  • Frontend — 3 md total: the client hub app usage page (DED-S07/M4, ~2 md, Syafrizal M.) rendering daily-aggregate rows from the new hub_core GET API; and the moderator-be modpanel (Hafriz, ~1 md) — the download dialog offering V2 companies daily-aggregate only (DED-S08/M5) plus the manual settle-trigger button on account detail (DED-S03/M6). FE scoped + staffed 2026-07-21/22; the M4 hub-app paths are PRD-sourced and unverified (repo not checked out).

Progress

Latest: delivery/status/2026-07-24.md51% (16.5 / 32.5 md). Re-baselined 16 → 29 when Part 2 came into scope; → 30 (T8 NULL-held_at hardening, BIF-9015); → 32.5 (M6 manual settle-trigger, BIF-9016, DED-S03) — both 2026-07-22. Total BE 23 · FE 3 · QA 6.5. Part 1 engine (13 BE md) done; M2 GET usage API shipped 2026-07-23 (BIF-8884, +2 md) and M3 download API shipped 2026-07-24 (BIF-8885, +1.5 md); T8 + rest of Part 2 (M0/M1/M4–M6) + all QA not started.

Initiatives

  • prds/deduction-v2.md — PRD: Deduction V2.0 Phase 1 Real-time Balance Hold
  • rfcs/deduction-v2.md — RFC: agent-execution-ready engineering design (hub_core hold/settlement engine)
  • rfcs/deduction-v2.task-breakdown.md — task breakdown: hub_core engine (Part 1, T1–T7 merged; T8 NULL-held_at hardening not started) + modpanel/client surfaces + ops (Part 2, M0–M6, DED-S07/S08/S03, hub_core + hub + moderator-be; M2 + M3 shipped 2026-07-23/24, rest not started)

QA Lane

Lane B — keeps a human QA gate. Money-critical: real-time balance hold, deduction and settlement of billing quota — a silent error directly mischarges customers. No E2E test specs exist for this initiative yet, so the Lane-A entry bar (100% E2E, spec-mapped coverage) is unmet regardless. Classified by Yoddi, Izzul (QA), 2026-06-26.