Quotas Rules — Per Account & Supplier
Quotas Rules let you override the default minimum with more specific thresholds for targeted scopes such as Account, Supplier, and optionally Store. The engine selects one effective rule per order using a deterministic precedence.
Key points
- Rules are admin-managed overrides to the default minimum.
- Resolution is deterministic: the most specific matching rule wins.
- If no rule matches, the default minimum applies.
- Co-validation groups are covered on the next page.
🧭 What a rule is
A Quotas Rule defines:
- Scope keys: Account, Supplier, optionally Store
- Minimum threshold: the quota value to meet or exceed
- Lifecycle: create, update, delete by admins
🎛️ Rule resolution at evaluation time
graph LR
%% ---------- Flow ----------
IN[Order enters quota check] --> MATCH[Find matching rules<br>by scope]
MATCH --> SPEC{Any account plus supplier rule}
SPEC -->|Yes| PICK1[Pick most specific match<br>account plus supplier]
SPEC -->|No| ACC{Any account only rule}
ACC -->|Yes| PICK2[Pick most specific match<br>account only]
ACC -->|No| SUP{Any supplier only rule}
SUP -->|Yes| PICK3[Pick most specific match<br>supplier only]
SUP -->|No| DEF[Use default minimum]
PICK1 --> EFF[Effective minimum resolved]
PICK2 --> EFF
PICK3 --> EFF
DEF --> EFF
EFF --> CMP[Compare order metrics<br>to effective minimum]
CMP -->|Below min| BLK[Block<br>reason: quota_min_not_met]
CMP -->|Meets min| OK[Allow]
%% ---------- Styles ----------
classDef total fill:#e8f1ff,stroke:#2f6feb,stroke-width:2px,color:#0b3d91;
classDef diff fill:#fff4e5,stroke:#f59e0b,stroke-width:2px,color:#7a3e00;
classDef inter fill:#fee2e2,stroke:#ef4444,stroke-width:2px,color:#7f1d1d;
classDef visible fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#064e3b;
class IN,MATCH,SPEC,ACC,SUP,PICK1,PICK2,PICK3,DEF,EFF,CMP diff;
class BLK inter;
class OK visible;
style IN rx:8,ry:8
style MATCH rx:8,ry:8
style SPEC rx:8,ry:8
style ACC rx:8,ry:8
style SUP rx:8,ry:8
style PICK1 rx:8,ry:8
style PICK2 rx:8,ry:8
style PICK3 rx:8,ry:8
style DEF rx:8,ry:8
style EFF rx:8,ry:8
style CMP rx:8,ry:8
style BLK rx:8,ry:8
style OK rx:8,ry:8
Precedence, in plain words
- Account + Supplier rules take priority over all others.
- If none, prefer Account-only rules.
- If none, prefer Supplier-only rules.
- If none match, use the Default minimum.
If multiple rules exist at the same specificity, the engine uses a deterministic selection (for example, most restrictive threshold). Your admin UI should avoid creating ambiguous overlaps.
🧩 CRUD and scoping
graph LR %% ---------- Nodes ---------- ADM[Admin UI or API] RULE[Quotas Rule<br>scope and minimum] ACCT[Account] SUP[Supplier] STORE[Store optional] EVAL[Quota evaluation<br>uses effective rule] %% ---------- Relations ---------- ADM --> RULE RULE --> ACCT RULE --> SUP RULE --> STORE RULE --> EVAL %% ---------- Styles ---------- classDef op fill:#e0f7fa,stroke:#06b6d4,stroke-width:2px,color:#065f46; classDef total fill:#e8f1ff,stroke:#2f6feb,stroke-width:2px,color:#0b3d91; classDef visible fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#064e3b; class ADM op; class RULE total; class ACCT,SUP,STORE,EVAL visible; style ADM rx:8,ry:8 style RULE rx:8,ry:8 style ACCT rx:8,ry:8 style SUP rx:8,ry:8 style STORE rx:8,ry:8 style EVAL rx:8,ry:8
Good practices
- Keep scopes minimal and non-overlapping.
- Prefer Account + Supplier for precision when needed.
- Use Supplier-only for broad governance across many accounts.
- Reserve Store for multi-store tenants.
📝 Mono-supplier platforms
Mono-supplier platforms still benefit from rules:
- Use Account-only rules to target specific buyers.
- The Supplier dimension is constant but rules continue to resolve deterministically.
🧾 Admin endpoints
- Create: POST /v1/buying-policies/quotas/rules — ADM-BUYING-POLICY-152
- List: GET /v1/buying-policies/quotas/rules — ADM-BUYING-POLICY-553
- Update: PUT /v1/buying-policies/quotas/rules/ruleId — ADM-BUYING-POLICY-206
- Delete: DELETE /v1/buying-policies/quotas/rules/ruleId — ADM-BUYING-POLICY-302
🔗 API quicklinks
- Create: POST /v1/buying-policies/quotas/rules — ADM-BUYING-POLICY-152
- List: GET /v1/buying-policies/quotas/rules — ADM-BUYING-POLICY-553
- Update: PUT /v1/buying-policies/quotas/rules/ruleId — ADM-BUYING-POLICY-206
- Delete: DELETE /v1/buying-policies/quotas/rules/ruleId — ADM-BUYING-POLICY-302
Updated 21 days ago
