Skip to main content

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:

Componentis_usage_reset_per_contract
Email BroadcastTRUE
Custom FieldFALSE
LoyaltyFALSE
RecordingFALSE

Scope Changes

  • Backend — quota config flag and reset-on-contract-change logic.

8. User Stories + Acceptance Criteria

User StoryImportanceMockup / Technical NotesAcceptance 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 Haveis_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

  1. 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.)
  2. Which usage counters reset — all quota balances for the CID, or only the specific quota?
  3. How is a contract_id change detected — via the subscription-update webhook, and which field carries contract_id?
  4. Does reset zero the usage, or reset to the new contract's allowance?