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.
Overview
The Services API manages the wash service catalog offered by SCO Autolavados. Each service defines a name, description, price, estimated duration, and an optional link to a specific vehicle type (so that, for example, a “Motor Truck Wash” only appears forCamioneta-type vehicles).
Services are referenced throughout the system:
- Service Orders — an operator assigns a service to a vehicle visit.
- Customer Orders — customers select services when booking online.
- Reservations — customers pick a service when scheduling an appointment.
- Payroll / Nómina — service prices feed into the daily earnings pool.
Service Object
UUID primary key of the service.
Service name. Must be unique across the catalog.
Human-readable description shown to customers and operators.
Price in USD (floating-point). This value feeds into the daily payroll pool calculation.
Estimated completion time in minutes. Used by the dynamic waiting-time algorithm (
GET /api/autolavado/waiting-time).When
true, this service is considered a base service for its vehicle type. Only one base service is allowed per vehicle type. This flag drives the BASE_SERVICE payroll commission mode (see note below).UUID of the linked vehicle type, or
null if the service applies to all vehicle types.Embedded TypeCar object
{ id, name }, or null.Array of
ServiceResource items — inventory products that are auto-consumed when this service is performed. Each entry contains { id, serviceId, itemId, quantity, item: { id, name, priceUsd, ... } }.isBaseService and Payroll Modes
The
isBaseService flag interacts with the company-level commissionType setting stored in AutoLavado:FULL_PRICEmode — The entire price of every completed service contributes to the daily payroll pool.BASE_SERVICEmode — Only services withisBaseService: truecontribute to the payroll pool. Add-on services (wax, engine wash, etc.) are not counted. This prevents the system from double-counting when a full detail package is broken into individual line items.
isBaseService: true service per vehicle type. The API will reject attempts to create or update a second base service for the same typeCarId.ServiceResource — Inventory Auto-Consumption
Services can have linked inventory items via the
ServiceResource join table. When a service is performed and its ServiceOrder is finalized, the linked items are automatically deducted from stock.For example, a “Lavado Completo” might link to 1 unit of “Ambientador Pino” — when the wash is marked as finished, one unit is consumed from the inventory.ServiceResource records are managed through the resources array in POST /api/services and PUT /api/services/:id. There is no dedicated REST endpoint for ServiceResource — resources are always managed as part of the parent service. The underlying data is accessible directly through Prisma/the database.Endpoints
GET /api/services
Returns the full service catalog, ordered alphabetically by name. Each service includes its linked vehicle type and all associated ServiceResource inventory items. No authentication required.
200 OK:
POST /api/services ADMIN
Creates a new service entry in the catalog. Optionally accepts a resources array to pre-link inventory items that will be auto-consumed when this service is performed.
Service name. Must be unique across the catalog.
Descriptive text shown to customers and staff.
Price in USD (e.g.
5.0). Used in billing, sales, and payroll calculations.Estimated service duration in minutes (e.g.
45). Used by the dynamic waiting-time algorithm.UUID of the vehicle type this service targets. Obtain valid UUIDs from
GET /api/typecars. Even if the service applies to all vehicle types, a typeCarId must currently be provided (the field is required by the controller).Whether this is the base service for the given
typeCarId. Defaults to false. Only one base service is allowed per vehicle type — the API rejects a second one.Optional array of inventory items to auto-consume when this service is performed. Each element must be:
201 Created:
500 — Duplicate base service for the same vehicle type:
PUT /api/services/:id ADMIN
Updates an existing service. All body fields are optional — send only the fields you want to change.
When resources is included in the update payload, the existing resource links are fully replaced: all prior ServiceResource records for this service are deleted and the new ones are inserted inside a single database transaction.
UUID of the service to update.
New unique name for the service.
Updated description text.
New price in USD.
New estimated duration in minutes.
UUID of the new target vehicle type.
Mark or unmark as the base service for its vehicle type. The API validates that no other service for the same
typeCarId already has isBaseService: true.Full replacement list of inventory resources. Passing an empty array
[] removes all resource links. Each element:200 OK:
DELETE /api/services/:id ADMIN
Permanently deletes a service from the catalog. The deletion is blocked if the service is referenced by any existing Service Order, Customer Order, or Reservation.
UUID of the service to delete.
200 OK:
400 Bad Request — Service is still in use: