Overview
Create restriction rules to control betting limits across the system. Rules can be scoped to Banca, Ventana, or User (vendedor) level with optional filters for numbers, lotteries, dates, and times.Endpoint
Request Body
Scope Fields (At least one required for non-lottery rules)
UUID of banca (for banca-level rules)
UUID of ventana (for ventana-level rules)
UUID of user/vendedor (for user-level rules)
Rule Type Fields
Optional label for categorizing rules (e.g., “LIMIT”, “CUTOFF”)
Number Fields
Specific number(s) to restrict:
- Single number:
"25"(legacy format) - Multiple numbers:
["00", "25", "50", "75", "99"](max 1000)
If true, automatically updates
number to match the current day of month (1-31).Use case: Restrict betting on today’s date number.Restrictions:- Only works with amount-based rules (
maxAmountormaxTotal) - Cannot be used with lottery/multiplier rules
numberfield must be omitted when true
Amount Limit Fields
Maximum bet amount per jugada for this number (must be positive)
Maximum total amount per ticket (all jugadas combined, must be positive)
Base amount for dynamic limit calculation (≥ 0)Used with
salesPercentage to calculate dynamic limits based on current sales.Percentage of current sales to add to
baseAmount (0-100)Formula: effectiveLimit = baseAmount + (currentSales * salesPercentage / 100)If true, apply the dynamic percentage calculation per-vendedor.
If false, apply globally.Only valid when
salesPercentage is present.Sales Cutoff Fields
Minutes before sorteo draw when sales must stop (0-30)Cannot be combined with:
- Amount limits (
maxAmount,maxTotal) - Lottery/multiplier restrictions
numberfield
Date/Time Filters
ISO 8601 date when rule applies (null = all dates)
Hour (0-23) when rule applies (null = all hours)
Lottery/Multiplier Filters
UUID of specific lotteryRequired if
multiplierId is providedUUID of specific multiplierRequired if
loteriaId is providedOptional custom message (1-255 characters) to display when rule is triggered
Rule Types
1. Per-Number Amount Limit
Restrict maximum bet per jugada for specific numbers.2. Batch Number Restrictions
Create multiple rules for different numbers in one request.3. Global Ticket Limit
Restrict maximum total per ticket (all jugadas combined).4. Sales Cutoff Rule
Define when sales must stop before draw.5. Dynamic Limit (Sales-Based)
Limit increases with current sales volume.- Base limit: 2000
- If current sales for “13” = 50000, add 10% = 5000
- Effective limit: 2000 + 5000 = 7000 (capped at maxAmount 10000)
6. Auto-Date Restriction
Automatically restrict betting on today’s date.7. Lottery/Multiplier Specific Rule
Block or limit specific lottery + multiplier combinations.bancaId/ventanaId/userId).
8. Event-Specific Restriction
Apply restrictions only on specific dates/times.Response
Indicates if the request was successful
Created restriction rule(s)For single number: returns one object
For batch creation: returns array of objects
Examples
Validation Rules
Cutoff rules cannot mix with other types
Cutoff rules cannot mix with other types
Sales cutoff rules (
salesCutoffMinutes) cannot be combined with:- Amount limits (
maxAmount,maxTotal) - Lottery/multiplier restrictions
- Number filters
Lottery + Multiplier must be paired
Lottery + Multiplier must be paired
If you specify
loteriaId, you must also specify multiplierId, and vice versa.Auto-date restrictions
Auto-date restrictions
isAutoDate rules:- Require
maxAmountormaxTotal - Cannot have
numberfield - Cannot be used with lottery/multiplier rules
Dynamic limits validation
Dynamic limits validation
baseAmount and salesPercentage:- Can only be used with amount-based rules (
maxAmountormaxTotal) salesPercentagemust be 0-100baseAmountmust be ≥ 0appliesToVendedoronly valid whensalesPercentageis present
Number format
Number format
Numbers must be:
- 1-3 digits (0-999)
- Valid range: 0 to 999 (supports TICA 0-99 and MONAZOS 100-999)
- No duplicates in batch arrays
- Max 1000 numbers per batch request
Priority Levels
Restrictions follow hierarchical priority:- USER (vendedor): Priority 100
- VENTANA: Priority 10
- BANCA: Priority 1
Error Responses
Related Endpoints
List Restrictions
View all restriction rules
Update Restriction
Modify existing rule
Delete Restriction
Soft delete a rule
Implementation Details
Fromsrc/api/v1/controllers/restrictionRule.controller.ts:10-13:
src/api/v1/validators/restrictionRule.validator.ts:47-194.