feat: mejorar ux y validaciones del toldo

This commit is contained in:
mono
2026-10-25 18:09:01 -05:00
parent 4ffce3e3cd
commit 8e286d6fec
24 changed files with 387 additions and 121 deletions

View File

@@ -0,0 +1,87 @@
# Spec Delta
## MODIFIED Requirements
### Requirement: Realizar cuadre de caja
The system SHALL allow completing an end-of-day reconciliation with cash counted and QR bank total, while clearly showing the expected values and calculated differences.
#### Scenario: Cuadre completo
- **GIVEN** base inicial, ventas (cash/QR), gastos (cash/QR) recorded
- **WHEN** user performs cuadre
- **THEN** saldoEsperadoEfectivo is calculated (base + ventas efectivo - gastos efectivo)
- **AND** user can enter saldoRealEfectivo
- **AND** user can enter total QR reported by the bank
- **AND** descuadreEfectivo and descuadreQR are calculated
- **AND** totalVentas = ventas efectivo + ventas QR
### Requirement: Reporte por productor
The system SHALL generate reports by producer including initial real inventory, expected inventory, differences, sales movements, and sales value.
#### Scenario: Reporte por productor completo
- **GIVEN** sales and inventory data for the day
- **WHEN** generating report by producer
- **THEN** shows inventory differences vs previous day
- **AND** shows initial inventory (real)
- **AND** shows inventory movements from sales (salidas)
- **AND** shows sales value for producer's products
- **AND** shows total per producer
### Requirement: Reporte consolidado
The system SHALL generate consolidated totals for a user-selected date range and identify the selected period in the result.
#### Scenario: Consolidado por rango
- **GIVEN** multiple days of data
- **WHEN** generating consolidated report for date range
- **THEN** aggregates sales, expenses, adjustments
- **AND** shows totals by producer
- **AND** rejects an end date before the start date with a clear validation message
### Requirement: Exportar datos
The system SHALL export all operational data, including market days, in versioned JSON format.
#### Scenario: Exportar jornada completa
- **GIVEN** data exists in the app
- **WHEN** user exports
- **THEN** JSON file is generated with schemaVersion, appVersion, exportedAt, data
- **AND** data includes jornadas so an imported device preserves day status and traceability
## ADDED Requirements
### Requirement: Navegación adaptada al dispositivo
The system SHALL provide consistent navigation and visible context on desktop, tablet, and mobile widths.
#### Scenario: Navegación móvil
- **WHEN** the app is opened on a narrow viewport
- **THEN** the navigation can be opened and closed without covering the active content
- **AND** the current section and active day status remain visible
### Requirement: POS seguro y comprensible
The system SHALL guide the user through product selection, quantity editing, payment selection, and sale confirmation without allowing invalid quantities or sales outside an open day.
#### Scenario: Venta válida desde POS
- **GIVEN** an open day and products with available stock
- **WHEN** user adds products, adjusts quantities, selects cash or QR, and confirms
- **THEN** a confirmation feedback identifies amount and payment method
- **AND** the cart is cleared only after successful persistence
#### Scenario: Venta inválida
- **GIVEN** no open day or a non-positive quantity
- **WHEN** user attempts to confirm the sale
- **THEN** the sale is not persisted
- **AND** an inline, actionable validation message is shown
### Requirement: Flujo de configuración inicial
The system SHALL guide a first-time user to create at least one producer and product before attempting an operational sale.
#### Scenario: Configuración vacía
- **WHEN** no producers or products exist
- **THEN** the dashboard explains the next setup step and links directly to inventory setup
- **AND** the POS explains why a sale cannot yet be created
### Requirement: Pruebas de flujo crítico
The project SHALL include automated browser coverage for the main operational flow and responsive navigation.
#### Scenario: Jornada completa en navegador
- **WHEN** the test opens a day, creates catalog data, records a multi-line sale and expense, and closes the day
- **THEN** the expected totals and closed status are visible
- **AND** the test can run with network access disabled after the app has loaded