Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/luisumit/LaPreviaRestobar/llms.txt

Use this file to discover all available pages before exploring further.

The products resource represents every item on the La Previa Restobar menu. Each product carries pricing data (both a sale price for customers and an optional cost price for margin tracking), a category label, and optional inventory-tracking fields. When trackInventory is true the stock and minStock fields are meaningful and the inventory subsystem will decrement stock as orders are confirmed.

Product Object

The fields below describe ProductDto — the shape returned by the API. The local Product model (used by Room and the Android ViewModel) adds a version field for optimistic concurrency that is not part of the DTO and is therefore not present in API responses.
id
string
required
Unique product identifier (Firebase push key or UUID string).
name
string
required
Display name of the menu item, e.g. "Choripán".
description
string
Optional longer description shown on the menu. Defaults to an empty string.
category
string
Product category string, e.g. "Entradas", "Bebidas", "Postres". Defaults to "General".
salePrice
number | null
Price charged to the customer (in local currency). May be null while the product is being configured.
costPrice
number | null
Internal cost price used for margin reporting. Not surfaced to end-customers. May be null.
trackInventory
boolean
When true, stock levels are decremented when this product appears in a confirmed order. Defaults to false.
stock
number
Current available stock quantity. Only meaningful when trackInventory is true. Defaults to 0.0.
minStock
number
Minimum stock threshold. When stock falls below this value the inventory dashboard shows a low-stock warning. Defaults to 0.0.
imageUrl
string | null
URL of the product image. May be null if no image has been uploaded.
isActive
boolean
Whether the product is visible and orderable. Defaults to true.
createdAt
number
Unix epoch timestamp (milliseconds) when the product was created.
updatedAt
number
Unix epoch timestamp (milliseconds) of the last update.

GET /products

Returns the full list of products stored in Firebase.
curl -X GET http://localhost:3000/products \
  -H "Accept: application/json"
Response 200 OK
[
  {
    "id": "prod_abc123",
    "name": "Choripán",
    "description": "Pan con chorizo y chimichurri casero",
    "category": "Entradas",
    "salePrice": 1500.0,
    "costPrice": 600.0,
    "trackInventory": true,
    "stock": 40.0,
    "minStock": 5.0,
    "imageUrl": "https://storage.example.com/choripan.jpg",
    "isActive": true,
    "createdAt": 1717100000000,
    "updatedAt": 1717100000000
  }
]

GET /products/{id}

Returns a single product by its ID. Path parameters
id
string
required
The product’s unique identifier (Firebase push key).
curl -X GET http://localhost:3000/products/prod_abc123 \
  -H "Accept: application/json"
Response 200 OK
{
  "id": "prod_abc123",
  "name": "Choripán",
  "description": "Pan con chorizo y chimichurri casero",
  "category": "Entradas",
  "salePrice": 1500.0,
  "costPrice": 600.0,
  "trackInventory": true,
  "stock": 40.0,
  "minStock": 5.0,
  "imageUrl": "https://storage.example.com/choripan.jpg",
  "isActive": true,
  "createdAt": 1717100000000,
  "updatedAt": 1717100000000
}

GET /products/categories

Returns a deduplicated list of every category string that exists among the stored products.
curl -X GET http://localhost:3000/products/categories \
  -H "Accept: application/json"
Response 200 OK
["Entradas", "Platos Principales", "Bebidas", "Postres", "General"]

POST /products

Creates a new product and persists it to the products node in Firebase. Request body (CreateProductDto)
name
string
required
Display name for the product.
description
string
Optional description. May be null.
price
number
required
Sale price in local currency.
category
string
required
Category label. Use /products/categories to retrieve existing values.
stock
integer
required
Initial stock quantity. Set to 0 for non-tracked products.
curl -X POST http://localhost:3000/products \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Empanada de Carne",
    "description": "Empanada frita con relleno de carne cortada a cuchillo",
    "price": 800.0,
    "category": "Entradas",
    "stock": 50
  }'
Response 200 OK — returns the created ProductDto.
{
  "id": "prod_xyz789",
  "name": "Empanada de Carne",
  "description": "Empanada frita con relleno de carne cortada a cuchillo",
  "category": "Entradas",
  "salePrice": 800.0,
  "costPrice": null,
  "trackInventory": false,
  "stock": 50.0,
  "minStock": 0.0,
  "imageUrl": null,
  "isActive": true,
  "createdAt": 1717200000000,
  "updatedAt": 1717200000000
}

PUT /products/{id}

Updates an existing product. Supply only the fields that should change — the backend replaces the stored record with the provided body. Path parameters
id
string
required
The product’s unique identifier.
Request body (UpdateProductDto)
name
string
required
Updated display name.
description
string
Updated description. May be null.
price
number
required
Updated sale price.
category
string
required
Updated category label.
stock
integer
required
Updated stock quantity.
curl -X PUT http://localhost:3000/products/prod_xyz789 \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Empanada de Carne",
    "description": "Empanada frita con relleno de carne cortada a cuchillo",
    "price": 900.0,
    "category": "Entradas",
    "stock": 45
  }'
Response 200 OK — returns the updated ProductDto.

DELETE /products/{id}

Removes a product from Firebase permanently. Path parameters
id
string
required
The product’s unique identifier.
curl -X DELETE http://localhost:3000/products/prod_xyz789
Response 204 No Content — empty body on success.

Build docs developers (and LLMs) love