feat: importar csv y auditar ediciones
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# Spec Delta
|
||||
|
||||
## Purpose
|
||||
|
||||
Permite cargar rápidamente el inventario inicial desde archivos CSV locales, creando sólo las entidades que no existen y evitando duplicados por diferencias de formato en los nombres.
|
||||
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Importar inventario CSV
|
||||
The system SHALL import CSV rows with product name, producer name, unit price, and optional quantity columns.
|
||||
|
||||
#### Scenario: Importación válida
|
||||
- **GIVEN** a CSV with the required headers
|
||||
- **WHEN** user previews and confirms the import
|
||||
- **THEN** missing producers and products are created
|
||||
- **AND** a positive quantity creates an initial inventory movement
|
||||
- **AND** empty or zero quantity creates no movement
|
||||
|
||||
### Requirement: Comparación normalizada
|
||||
The system SHALL match producer and product names ignoring case, accents, BOM, and redundant surrounding whitespace.
|
||||
|
||||
#### Scenario: Evitar duplicado
|
||||
- **GIVEN** an existing producer `La Familia González`
|
||||
- **WHEN** CSV contains ` la familia gonzalez `
|
||||
- **THEN** the row uses the existing producer instead of creating a duplicate
|
||||
|
||||
### Requirement: Errores de importación
|
||||
The system SHALL report invalid rows without persisting invalid records and SHALL show a summary of created, reused, skipped, and failed rows.
|
||||
|
||||
#### Scenario: Precio inválido
|
||||
- **WHEN** a row has a non-numeric or negative price
|
||||
- **THEN** that row is rejected with its line number and reason
|
||||
- **AND** valid rows remain importable
|
||||
Reference in New Issue
Block a user