The Point of Sale screen lets any authenticated user — both admins and receptionists — ring up products without leaving the gym dashboard. It presents the full product catalog in a browsable grid, collects items into a live cart, accepts cash or card payment, and automatically prints a receipt as soon as the sale is confirmed. Stock levels are validated in real time so the register never oversells an item.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/azahel79/Spartans-gym/llms.txt
Use this file to discover all available pages before exploring further.
Product Catalog
All active products are loaded when the screen opens and displayed as cards in a responsive grid. Each card shows the product image, name, category, price, and the remaining available units.Category Filters
A horizontal filter bar lets you narrow the catalog to a single category. Available filters:Todos
Shows every product regardless of category.
Suplementos
Protein powders, vitamins, and pre-workouts.
Bebidas
Bottled water, sports drinks, and shakes.
Merchandising
Branded apparel and gym wear.
Accesorios
Straps, gloves, and training accessories.
Snacks
Energy bars, nuts, and protein snacks.
Out-of-Stock Products
Products with zero available units are shown with grayscale styling and acursor-not-allowed pointer. Clicking them has no effect; a toast warning is shown instead. They remain visible in the catalog so staff can see the full product range.
Cart
The cart panel sits on the right side of the screen (or below the catalog on mobile). It tracks everything that has been added in the current sale session.Cart Actions
| Action | How to trigger |
|---|---|
| Add item | Click any in-stock product card |
| Increase quantity | Click the + button inside the cart row |
| Decrease quantity | Click the − button; removing the last unit deletes the row |
| Remove item entirely | Click the trash icon on the cart row |
| Clear all items | Click the delete button next to the Finalizar Venta button |
Stock Validation
The cart enforces stock limits client-side before the sale is submitted:- If a product is already out of stock when you click it, a warning toast appears and nothing is added.
- If the quantity in the cart already equals the available stock, clicking + again shows a “Stock insuficiente” warning and the quantity is not incremented.
Payment Methods
The cart footer contains a two-button toggle for selecting how the customer is paying:- Efectivo — cash payment (default)
- Tarjeta — card payment
Transferencia (bank transfer) is not available as a payment method in the Point of Sale. It is only accepted for membership plan payments. If you need to record a transfer for a product sale, use the Transactions module directly.
Completing a Sale
Select products
Browse or filter the catalog and click each product card to add it to the cart. Adjust quantities using the + and − controls in the cart.
Finalize the sale
Click Finalizar Venta. The button is disabled if the cart is empty or a sale is already being processed.
Sale is processed
The frontend calls The backend iterates over the
processSale, which sends a POST /api/transactions request with the following body:productos array, decrements each product’s stock atomically via Prisma, and assembles the concepto string from the product names (e.g., "Whey Protein (x2), Agua 600ml").Receipt prints automatically
On a successful response,
printSaleReceipt() opens a new browser window pre-loaded with an HTML ticket and immediately triggers the browser’s print dialog. The ticket lists each item with its quantity and subtotal, the payment method, and the total amount.