The Products module is the foundation of Yakult App’s inventory system. It lets distributors maintain a live catalog of every Yakult SKU they carry — tracking prices, stock levels, and categories so that sales orders always reflect what is actually available on the shelf. Every change made here is immediately visible to all mobile app users, keeping the field sales team and the warehouse in sync without any manual reconciliation.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/160906/Yakultt-App/llms.txt
Use this file to discover all available pages before exploring further.
Product Fields
Each product record contains the following fields:| Field | Type | Description |
|---|---|---|
id | integer | Auto-incremented primary key |
nombre | string | Display name of the product |
sku | string | Unique stock-keeping unit code |
precio | decimal | Unit sale price |
stock | integer | Current units available |
categoria | string | Product group (defaults to 'General') |
creado_en | timestamp | Record creation timestamp |
If
categoria is submitted as an empty string or omitted entirely, the backend automatically coerces it to 'General' using COALESCE(NULLIF(categoria,''), 'General') on reads and categoria || 'General' on writes. You never need to guard against a blank category on the client side.Sample Product Object
API Endpoints
The products resource is mounted at/api/productos.
- List Products
- Create Product
- Update Product
- Delete Product
Retrieve every product ordered alphabetically by name.Response — array of product objects:
Automatic Stock Deduction
When a new order is created, the backend deducts stock for every line item inside a single database transaction. This guarantees that stock counts are always consistent — even if two orders are submitted at the same moment — because the deduction and the order insertion either both succeed or both roll back together. The deduction is executed for each item in the order with:Order submitted
The mobile app POSTs to
/api/ordenes with an items array containing productoId, cantidad, and precio for each line.Order and items inserted
The order header and each
orden_items row are inserted within the transaction.Stock decremented
For each item,
stock = stock - cantidad is applied to the matching product row — all inside the same transaction.Low-Stock Warning
The mobile app monitors stock levels and surfaces a visual alert when inventory runs low. Any product with fewer than 50 units in stock displays a ⚠️ warning indicator next to its name in the product list, prompting the distributor to reorder before a stockout occurs.Mobile UI Overview
Product List
Displays all catalog items alphabetically. Products with stock below 50 show a ⚠️ badge. Tap any row to open the edit form.
Add / Edit Form
A modal form collects name, SKU, price, stock, and category. Submits to POST or PUT depending on whether a product is being created or updated.
Delete Confirmation
Tapping delete opens a confirmation dialog before sending the DELETE request, preventing accidental removal of catalog items.
Real-Time Stock
Stock counts reflect all committed orders. The list refreshes whenever the screen is focused, ensuring field reps always see current availability.