Quota API Management: is_usage_reset_per_contract
Jira: BIF-8806 · Epic: BIF-8695
Overview
Add an is_usage_reset_per_contract flag (per quota component) to Quota API Management.
When TRUE, a quota's usage is reset whenever the customer's contract_id changes in Mekari
Billing; when FALSE (the default), usage is preserved across a contract change.
Initial backfill values for existing components:
| Component | is_usage_reset_per_contract |
|---|---|
| Email Broadcast | TRUE |
| Custom Field | FALSE |
| Loyalty | FALSE |
| Recording | FALSE |
Scope Changes
- Backend — quota config flag and reset-on-contract-change logic.
8. User Stories + Acceptance Criteria
| User Story | Importance | Mockup / Technical Notes | Acceptance Criteria |
|---|---|---|---|
| [QURST-S01] — Reset quota usage on contract change As a billing admin managing quotas, I want an is_usage_reset_per_contract flag, so that a quota's usage can be reset when the customer's contract changes in Mekari Billing — or preserved across contracts when it should not reset. | Should Have | is_usage_reset_per_contract boolean, default false. Trigger: contract_id change from Mekari Billing. | — Happy Path — • AC-1: Given the Quota API management, when an admin configures a quota, then is_usage_reset_per_contract can be set (boolean), defaulting to false.• AC-2: Given a quota with is_usage_reset_per_contract = TRUE, when a contract_id change is received from Mekari Billing, then the quota usage is reset.• AC-3: Given a quota with is_usage_reset_per_contract = FALSE (default), when a contract_id change is received from Mekari Billing, then the quota usage is not reset.— Data migration / Backfill — • AC-4: Given the existing quota components, when the flag is introduced, then backfill is_usage_reset_per_contract per component: Email Broadcast = TRUE; Custom Field = FALSE; Loyalty = FALSE; Recording = FALSE. |
Open questions
- The flag is per quota component (confirmed via backfill). Is it set via a UI in Quota API Management or API-only? (If a UI toggle exists, add Frontend to scope.)
- Which usage counters reset — all quota balances for the CID, or only the specific quota?
- How is a
contract_idchange detected — via the subscription-update webhook, and which field carriescontract_id? - Does reset zero the usage, or reset to the new contract's allowance?