The AutoLavado resource represents the single business configuration record for the car wash. It stores company identity, current financial balances, the cached BCV exchange rates, commission settings for the payroll system, and the payroll period.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Luisangelebp/SCO_Autolavados/llms.txt
Use this file to discover all available pages before exploring further.
Singleton record: There is exactly one AutoLavado row in the database.
It is auto-created during server startup by the
initializeApp() bootstrap
function — you never need to POST to create it. All writes go through the
PUT /api/autolavado update endpoint.Endpoints
GET /api/autolavado
Retrieve the current business configuration and financial balances. Authentication: Public — no token required.| Status | Condition |
|---|---|
404 | AutoLavado record not found (misconfigured server) |
500 | Internal server error |
PUT /api/autolavado
Update the business configuration. Only the fields you include are updated — all others remain unchanged. Financial balance fields (balanceUsd, balanceBs) and tasa fields are managed automatically by the payments and exchange-rate systems and should not be overwritten here.
Authentication: Requires a valid JWT token with the ADMIN role.
Request Body (all fields optional)
Business display name, e.g.
"Multiservicios La Miami".Physical address of the car wash.
Contact phone number.
Contact email address. Must be unique in the database.
Venezuelan tax ID (RIF). Must be unique. Format:
J-00000000-0.URL to the business logo or photo.
Percentage of each finished service order’s price that goes to the laundrer
commission pool. Default is
40. Accepts values between 0 and 100.Determines the price basis for commission calculation. Accepted values:
"FULL_PRICE"— uses the actual service price"BASE_SERVICE"— uses the base service price for the vehicle’s type
Payroll reporting period. Accepted values:
"DAILY" or "WEEKLY".| Status | Condition |
|---|---|
500 | AutoLavado record not found |
401 | Missing or invalid JWT token |
403 | Caller does not have the ADMIN role |
GET /api/autolavado/exchange-rate
Fetch the current USD → Bolívares and EUR → Bolívares exchange rates from the BCV (Banco Central de Venezuela) via dolarapi.com. The rate is cached in the AutoLavado record and refreshed automatically whenever the cached date is different from today, or if either cached value is0.
Authentication: Public — no token required.
The exchange rate is fetched from
https://ve.dolarapi.com/v1/dolares/oficial
(USD) and https://ve.dolarapi.com/v1/euros/oficial (EUR). The promedio
field is preferred; venta and price are used as fallbacks. If the external
API is unreachable, the cached value from the previous successful fetch is
returned.| Field | Type | Description |
|---|---|---|
tasaBs | number | Current USD → Bolívares official rate |
tasaEurBs | number | Current EUR → Bolívares official rate |
lastUpdate | string | ISO 8601 timestamp of the most recent successful rate fetch |
| Status | Condition |
|---|---|
404 | AutoLavado not configured in the database |
500 | Internal server error |
GET /api/autolavado/waiting-time
Calculate the estimated customer wait time based on orders currently in theEN_ESPERA (waiting) queue and the number of laundrers currently on shift.
The formula is: estimatedWaitTimeMin = round(totalStimatedTime / max(1, activeLaundrers)), where totalStimatedTime is the sum of stimatedTimeMin across all queued orders. Division by zero is avoided by flooring active laundrers to 1.
Authentication: Public — no token required.
| Field | Type | Description |
|---|---|---|
estimatedWaitTimeMin | number | Estimated minutes a new customer would wait before their wash begins |
totalStimatedTime | number | Sum of stimatedTimeMin across all queued (EN_ESPERA) orders created today |
activeLaundrers | number | Laundrers currently marked isWorkingToday = true with the Laundrer role |
waitingOrdersCount | number | Number of service orders currently in EN_ESPERA state today |
| Status | Condition |
|---|---|
500 | Internal server error |
AutoLavado Object Reference
| Field | Type | Description |
|---|---|---|
id | string | UUID of the singleton AutoLavado record |
name | string | Business name |
address | string | Physical address |
phone | string | Contact phone |
email | string | null | Contact email (unique) |
photo | string | null | URL to business logo |
rif | string | Venezuelan tax ID (unique) |
balanceUsd | number | Current cash balance in USD |
balanceBs | number | Current cash balance in Bolívares |
currentTasaBs | number | Cached USD → Bs exchange rate |
currentTasaEurBs | number | Cached EUR → Bs exchange rate |
lastTasaUpdate | string | ISO 8601 timestamp of last rate update |
commissionPercent | number | Commission percentage for laundrer pool (default: 40) |
commissionType | string | "FULL_PRICE" or "BASE_SERVICE" |
payrollPeriod | string | "DAILY" or "WEEKLY" |