141 lines
3.3 KiB
Markdown
141 lines
3.3 KiB
Markdown
# US-MMD004-001: Registrar Refacciones
|
|
|
|
## Metadata
|
|
|
|
| Campo | Valor |
|
|
|-------|-------|
|
|
| **ID** | US-MMD004-001 |
|
|
| **Epica** | EPIC-MMD-004 - Inventario |
|
|
| **Modulo** | inventario |
|
|
| **Prioridad** | P0 |
|
|
| **Story Points** | 5 |
|
|
| **Sprint** | Sprint 2 |
|
|
| **Estado** | Backlog |
|
|
|
|
---
|
|
|
|
## Historia de Usuario
|
|
|
|
**Como** almacenista,
|
|
**quiero** registrar refacciones con codigo, descripcion y ubicacion,
|
|
**para** tener control del inventario y encontrar las piezas rapidamente.
|
|
|
|
## Descripcion Detallada
|
|
|
|
Cada refaccion debe tener un codigo unico, descripcion clara, categoria, ubicacion en almacen, precios (costo y venta), y stock minimo para alertas.
|
|
|
|
---
|
|
|
|
## Criterios de Aceptacion
|
|
|
|
**Escenario 1: Crear refaccion nueva**
|
|
```gherkin
|
|
DADO que quiero agregar una refaccion
|
|
CUANDO completo el formulario:
|
|
| Campo | Valor |
|
|
| Codigo | INY-0001 |
|
|
| Descripcion | Inyector Cummins ISX15 |
|
|
| Categoria | INY |
|
|
| Marca | Cummins |
|
|
| Numero OEM | 4954434 |
|
|
| Unidad | PZA |
|
|
| Costo | $2,500 |
|
|
| Precio venta | $3,500 |
|
|
| Stock minimo | 2 |
|
|
| Ubicacion | A-01-03 |
|
|
ENTONCES la refaccion se crea en el sistema
|
|
Y stock inicial es 0
|
|
```
|
|
|
|
**Escenario 2: Codigo unico**
|
|
```gherkin
|
|
DADO que intento crear refaccion con codigo existente
|
|
CUANDO guardo
|
|
ENTONCES el sistema muestra error "Codigo ya existe"
|
|
Y no permite duplicados
|
|
```
|
|
|
|
**Escenario 3: Asignar ubicacion**
|
|
```gherkin
|
|
DADO que asigno ubicacion "A-01-03"
|
|
CUANDO guardo
|
|
ENTONCES se interpreta como:
|
|
| Rack | A |
|
|
| Estante | 01 |
|
|
| Nivel | 03 |
|
|
Y es buscable por cualquier parte de la ubicacion
|
|
```
|
|
|
|
**Escenario 4: Agregar equivalencias**
|
|
```gherkin
|
|
DADO que la refaccion tiene equivalentes
|
|
CUANDO agrego equivalencias: "4954434RX", "4062569"
|
|
ENTONCES al buscar cualquier codigo equivalente
|
|
Se encuentra esta refaccion
|
|
```
|
|
|
|
---
|
|
|
|
## Estructura de Refaccion
|
|
|
|
```typescript
|
|
interface Part {
|
|
id: string;
|
|
code: string; // INY-0001
|
|
barcode?: string; // Codigo de barras
|
|
description: string; // Inyector Cummins ISX15
|
|
short_name: string; // Inyector ISX
|
|
category_id: string; // INY
|
|
brand?: string; // Cummins
|
|
oem_number?: string; // 4954434
|
|
unit: string; // PZA
|
|
cost: number; // 2500.00
|
|
price: number; // 3500.00
|
|
min_stock: number; // 2
|
|
max_stock?: number; // 10
|
|
location_id: string; // A-01-03
|
|
equivalences: string[]; // ["4954434RX", "4062569"]
|
|
status: 'active' | 'discontinued';
|
|
notes?: string;
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## Tareas Tecnicas
|
|
|
|
**Database:**
|
|
- [ ] DB-040: Crear schema `parts_management`
|
|
- [ ] DB-041: Crear tabla `parts`
|
|
- [ ] DB-042: Crear tabla `part_categories`
|
|
- [ ] DB-043: Crear tabla `part_locations`
|
|
- [ ] DB-044: Crear tabla `part_equivalences`
|
|
|
|
**Backend:**
|
|
- [ ] BE-080: Crear PartEntity
|
|
- [ ] BE-081: Crear PartService con CRUD
|
|
- [ ] BE-082: Crear PartController
|
|
- [ ] BE-083: Validacion de codigo unico
|
|
- [ ] BE-084: Gestion de equivalencias
|
|
|
|
**Frontend:**
|
|
- [ ] FE-080: Crear PartsListPage
|
|
- [ ] FE-081: Crear PartForm component
|
|
- [ ] FE-082: Crear LocationInput component
|
|
- [ ] FE-083: Crear EquivalenceManager
|
|
|
|
---
|
|
|
|
## Definition of Done (DoD)
|
|
|
|
- [ ] CRUD de refacciones
|
|
- [ ] Codigo unico validado
|
|
- [ ] Ubicacion estructurada
|
|
- [ ] Equivalencias funcionando
|
|
- [ ] Tests pasando
|
|
|
|
---
|
|
|
|
**Creada por:** Requirements-Analyst
|
|
**Fecha:** 2025-12-06
|