first commit

This commit is contained in:
mdares
2026-04-07 08:54:41 -06:00
commit 3d1a8ba07e
92 changed files with 15392 additions and 0 deletions

34
docs/DEPLOYMENT.md Normal file
View File

@@ -0,0 +1,34 @@
# Deployment Guide (Raspberry Pi / Mini PC)
## 1. Requisitos
- Node.js 20+ (LTS recomendado).
- `npm` disponible.
- Puerto USB del relay identificado.
- Sistema operativo con zona horaria `America/Monterrey`.
## 2. Instalacion
```powershell
npm install
Copy-Item .env.example .env
npm run prisma:migrate
npm run prisma:generate
npm run prisma:seed
```
## 3. Arranque en produccion
```powershell
npm run build
npm run start
```
## 4. Verificaciones de salida
- Abrir `http://localhost:3000`.
- Validar banner de relay conectado (mock o serial).
- Activar una maquina en mock mode y revisar countdown.
- Esperar expiracion y confirmar que transaccion pasa a `completed`.
## 5. Reconexion serial
- Ir a `Configuracion`.
- Capturar puerto (`COMx` o `/dev/ttyUSB0`) y baud rate.
- Desactivar modo simulador.
- Ejecutar `Reconectar relay`.

33
docs/RUNBOOK.md Normal file
View File

@@ -0,0 +1,33 @@
# Offline Operations Runbook
## Inicio diario
1. Encender equipo local.
2. Ejecutar `npm run start` (o servicio equivalente).
3. Entrar al POS con PIN.
4. Abrir turno con efectivo inicial.
## Operacion normal
1. Seleccionar maquina disponible.
2. Confirmar importe, tiempo y metodo de pago.
3. Verificar que el estado cambie a `running`.
## Incidencias
### Relay desconectado
1. Revisar cable USB y alimentacion.
2. Ir a `Configuracion > Serial / Relay`.
3. Ejecutar `Reconectar relay`.
4. Si falla, activar `Modo simulador` temporalmente para seguir cobrando y registrar manualmente encendidos.
### Reinicio inesperado
1. Reiniciar aplicacion.
2. Validar que timers activos fueron recuperados.
3. Confirmar que transacciones vencidas quedaron en `completed`.
## Corte de caja
1. En `Corte`, registrar depositos/retiros con motivo.
2. Capturar efectivo contado al cierre.
3. Ejecutar `Cerrar Turno`.
4. Descargar CSV de reportes si se requiere respaldo manual.
## Respaldo
- Respaldar archivo SQLite (`prisma/dev.db`) al cierre del dia en USB o carpeta segura.

137
docs/pricing.md Normal file
View File

@@ -0,0 +1,137 @@
# La Burbuja — Pricing System Prompt
## Business context
La Burbuja is a laundromat in Santa Catarina, Nuevo León (Monterrey metro). It operates three service lines: self-service, drop-off (encargo), and dry cleaning (tintorería). The POS system must handle all three with distinct pricing logic.
---
## Machine inventory
| Machine ID | Type | Service line | Notes |
|---|---|---|---|
| Lavadora 112 | LG WM22VV2S6R combo (washer + dryer stacked) | Self-service | Client-facing, coin/app activated |
| Lavadora 1315 | LG WM22VV2S6R combo | Drop-off (encargo) | Staff-operated, back room |
| Lavadora 16 | XL combo (larger capacity) | Edredones / bulky items | Staff-operated, back room |
---
## Service line 1: Self-service (autoservicio)
**Pricing model:** Fixed price per cycle. Customer activates machine directly.
| Service | Price (MXN) | Duration | Machine |
|---|---|---|---|
| Wash | $45 | 50 min | Lavadora 112 |
| Dry | $45 | 50 min | Lavadora 112 |
- **Total per load:** $90 (wash + dry)
- **Payment methods:** Cash (coin changer), card, app (future)
- **Detergent/softener:** Included in price OR vending machine add-on (TBD)
---
## Service line 2: Drop-off / encargo
**Pricing model:** Per-kilogram, with minimum charge. Staff weighs intake, calculates price, activates machine at that price.
| Parameter | Value |
|---|---|
| Price per kg | $33 MXN |
| Minimum charge | $120 MXN (~3.6 kg) |
| Service includes | Wash + dry + fold |
| Turnaround | 24 hours standard |
### Activation logic
1. Staff receives customer's bag
2. Weigh on scale → get weight in kg
3. Calculate: `price = max(weight × $33, $120)`
4. Enter calculated price in POS activation field
5. Activate encargo machine (Lavadora 1315) at that price
6. Price recorded in POS = actual revenue for that order
### Simulated weight (pre-scale)
Until a physical scale is purchased/connected, the system can generate a simulated weight for testing purposes:
- Random weight between 110 kg (uniform distribution)
- Display simulated weight to staff for confirmation
- Staff can override manually
- Flag all simulated-weight transactions for later reconciliation
### Edredones / bulky items (Lavadora 16 — XL)
**Pricing model:** Fixed price per item (premium, not per-kg).
| Item | Price (MXN) | Notes |
|---|---|---|
| Edredón individual | $150 | Single/twin comforter |
| Edredón matrimonial | $180 | Queen size |
| Edredón king | $200 | King size |
| Cobija gruesa | $120 | Heavy blanket |
| Almohada (par) | $80 | Pillow pair |
- These are drop-off only (staff-operated)
- Machine activated at the fixed item price
- If customer brings multiple items, sum the individual prices
---
## Service line 3: Dry cleaning / tintorería
**Pricing model:** Per-piece, fixed price by garment type. This is a future service line — prices are estimates based on Monterrey market research and will be confirmed before launch. Dry cleaning will likely be outsourced to a partner tintorería initially, with La Burbuja acting as a drop-off/pick-up point and adding a margin.
### Estimated price list (MXN)
| Category | Item | Estimated price |
|---|---|---|
| **Básico** | Camisa / blusa | $65 |
| | Pantalón | $65 |
| | Falda | $65 |
| | Suéter / sudadera | $75 |
| **Formal** | Saco | $80 |
| | Traje 2 piezas | $150 |
| | Traje 3 piezas | $200 |
| | Corbata | $55 |
| | Chaleco | $65 |
| **Vestidos** | Vestido sencillo | $100 |
| | Vestido de noche | $150 |
| | Vestido con aplicaciones | $200 |
| **Abrigos** | Chamarra ligera | $100 |
| | Chamarra gruesa / pluma | $180 |
| | Abrigo / gabardina | $130 |
| **Hogar** | Mantel (pieza) | $60 |
| | Juego de sábanas | $80 |
| | Cortinas (por metro) | $50 |
| **Especial** | Tenis / zapatos | $120 |
| | Vestido de novia (consultar) | $500+ |
### Operational notes
- Turnaround: 4872 hours (dependent on outsource partner schedule)
- Minimum order: 3 pieces or $150 MXN
- Urgent service (24 hrs): +50% surcharge
- Items received with visible stains: customer notified, desmanchado quoted separately
- Items received on hangers with plastic cover (cubre polvo)
---
## Pricing summary by service line
| Service | Pricing logic | Who operates | Where |
|---|---|---|---|
| Self-service | Fixed per cycle ($45 wash / $45 dry) | Customer | Main floor, Lavadoras 112 |
| Drop-off (ropa) | Per-kg ($33/kg, min $120) | Staff | Back room, Lavadoras 1315 |
| Drop-off (edredones) | Fixed per item ($120$200) | Staff | Back room, Lavadora 16 XL |
| Dry cleaning | Fixed per piece ($55$200+) | Staff (outsourced) | Reception at cashier |
---
## Future considerations
- **Loyalty / frequency discounts:** e.g., 10th wash free, or bulk kg discount for encargo regulars
- **Express encargo:** 4-hour turnaround at +30% premium
- **Detergent upsell:** premium detergent/softener options at $1525 per dose via vending
- **Scale integration:** digital scale connected to POS for automatic weight → price calculation
- **Seasonal pricing:** edredón wash promotions in spring/fall (seasonal demand spikes)