Skip to main content
PATCH
/
api
/
v1
/
bancas
/
:id
Update Banca
curl --request PATCH \
  --url https://api.example.com/api/v1/bancas/:id \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "code": "<string>",
  "email": "<string>",
  "address": "<string>",
  "phone": "<string>",
  "isActive": true,
  "defaultMinBet": 123,
  "globalMaxPerNumber": 123,
  "salesCutoffMinutes": 123
}
'
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Banca Central Updated",
    "code": "BC001",
    "email": "[email protected]",
    "address": "456 New Address",
    "phone": "+1-234-567-8901",
    "isActive": true,
    "defaultMinBet": 150,
    "globalMaxPerNumber": 7500,
    "salesCutoffMinutes": 2,
    "createdAt": "2024-03-15T10:30:00Z",
    "updatedAt": "2024-03-15T14:20:00Z"
  }
}

Overview

Updates an existing banca. All fields are optional - only provided fields will be updated.

Authorization

Required role: ADMIN
This endpoint requires:
  • Valid JWT token in Authorization header
  • User must have ADMIN role

Path Parameters

id
string
required
UUID of the banca to update

Request Body

name
string
Banca name (2-100 characters, must be unique)
code
string
Unique banca code (2-20 characters, must be unique)
email
string
Contact email address (must be valid email format)
address
string
Physical address (max 200 characters)
phone
string
Contact phone number (max 20 characters)
isActive
boolean
Whether the banca is active
defaultMinBet
number
Minimum bet amount (must be positive, min 1)
globalMaxPerNumber
number
Global maximum amount per number (must be positive, min 1)
salesCutoffMinutes
number
Minutes before sorteo to cut off sales (must be positive integer)

Response

success
boolean
Indicates if the request was successful
data
object
The updated banca object
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Banca Central Updated",
    "code": "BC001",
    "email": "[email protected]",
    "address": "456 New Address",
    "phone": "+1-234-567-8901",
    "isActive": true,
    "defaultMinBet": 150,
    "globalMaxPerNumber": 7500,
    "salesCutoffMinutes": 2,
    "createdAt": "2024-03-15T10:30:00Z",
    "updatedAt": "2024-03-15T14:20:00Z"
  }
}

Notes

  • Both PATCH and PUT methods are supported (same behavior)
  • Only provided fields are updated (partial update)
  • Name and code uniqueness is validated
  • Activity is logged for audit purposes (see src/api/v1/controllers/banca.controller.ts:13)
  • Routes defined in src/api/v1/routes/banca.routes.ts:29-35

Build docs developers (and LLMs) love