Overview
Update the hierarchical commission policy JSON for a specific entity. Policies define commission percentages based on lottery, bet type, and multiplier ranges.Endpoints
Set Banca Policy
Set Ventana Policy
Set User Policy
Path Parameters
UUID of the banca, ventana, or user
Request Body
Commission policy configuration (or null to remove policy)
Response
Indicates if the request was successful
Updated entity with commission policy
Examples
Validation Rules
Version must be 1
Version must be 1
The policy schema version must be exactly
1. Future versions may support additional features.Date range validation
Date range validation
If both
effectiveFrom and effectiveTo are provided, effectiveFrom must be before or equal to effectiveTo.Percentage precision
Percentage precision
All percentage values (
defaultPercent and rule percent) must be between 0-100 with maximum 2 decimal places.Multiplier range constraint
Multiplier range constraint
Currently, only specific multipliers are supported. The
multiplierRange.min must equal multiplierRange.max.No duplicate rules
No duplicate rules
Cannot have multiple rules with the same combination of:
loteriaId(or both null)betType(or both null)multiplierIdormultiplierRangevalue
Rule IDs auto-generated
Rule IDs auto-generated
If a rule does not include an
id field, a UUID will be automatically generated for tracking purposes.Best Practices
Order rules from specific to generalRules are evaluated in array order with first-match-wins logic. Place more specific rules first:
- Specific loteria + specific bet type + specific multiplier
- Specific loteria + any bet type
- Any loteria + specific bet type
- Catch-all wildcard rule
Response Example
Error Responses
Related Endpoints
Get Commission Policy
Retrieve current commission policy
Commission Analytics
View commission metrics and reports
Implementation Details
Fromsrc/api/v1/controllers/commission.controller.ts:102-131 and src/api/v1/validators/commission.validator.ts:86-126:
- Validate policy structure and constraints
- Check for duplicate rules
- Auto-generate UUIDs for rules without IDs
- Remove the read-only
multiplierfield if present