146 lines
3.2 KiB
Markdown
146 lines
3.2 KiB
Markdown
# US-MMD006-001: Crear Cotizacion desde Diagnostico
|
|
|
|
## Metadata
|
|
|
|
| Campo | Valor |
|
|
|-------|-------|
|
|
| **ID** | US-MMD006-001 |
|
|
| **Epica** | EPIC-MMD-006 - Cotizaciones |
|
|
| **Modulo** | cotizaciones |
|
|
| **Prioridad** | P0 |
|
|
| **Story Points** | 5 |
|
|
| **Sprint** | Sprint 5 |
|
|
| **Estado** | Backlog |
|
|
|
|
---
|
|
|
|
## Historia de Usuario
|
|
|
|
**Como** recepcionista,
|
|
**quiero** crear una cotizacion basada en el diagnostico realizado,
|
|
**para** presentar al cliente un presupuesto claro de la reparacion.
|
|
|
|
## Descripcion Detallada
|
|
|
|
Despues del diagnostico, se genera una cotizacion con las recomendaciones de reparacion. La cotizacion incluye servicios, refacciones, mano de obra, y un total estimado.
|
|
|
|
---
|
|
|
|
## Criterios de Aceptacion
|
|
|
|
**Escenario 1: Crear cotizacion desde diagnostico**
|
|
```gherkin
|
|
DADO que un diagnostico tiene recomendaciones
|
|
CUANDO hago clic en "Generar Cotizacion"
|
|
ENTONCES se crea borrador con:
|
|
- Datos del vehiculo y cliente
|
|
- Recomendaciones del diagnostico como lineas sugeridas
|
|
- Folio automatico: COT-2025-0001
|
|
```
|
|
|
|
**Escenario 2: Agregar servicio a cotizacion**
|
|
```gherkin
|
|
DADO que tengo una cotizacion en borrador
|
|
CUANDO agrego un servicio del catalogo:
|
|
| Servicio | Cantidad | Precio |
|
|
| Reparacion bomba | 1 | $2,500 |
|
|
ENTONCES se agrega la linea
|
|
Y el subtotal se actualiza
|
|
```
|
|
|
|
**Escenario 3: Agregar refaccion con margen**
|
|
```gherkin
|
|
DADO que agrego una refaccion
|
|
CUANDO selecciono:
|
|
| Refaccion | Cantidad | Costo | Margen |
|
|
| Kit reparacion | 1 | $2,000 | 30% |
|
|
ENTONCES el precio calculado es $2,600
|
|
Y se muestra tanto costo como precio
|
|
```
|
|
|
|
**Escenario 4: Ver totales**
|
|
```gherkin
|
|
DADO que tengo servicios y refacciones
|
|
CUANDO veo los totales
|
|
ENTONCES veo:
|
|
| Concepto | Monto |
|
|
| Mano de obra | $3,500 |
|
|
| Refacciones | $4,200 |
|
|
| Subtotal | $7,700 |
|
|
| IVA 16% | $1,232 |
|
|
| Total | $8,932 |
|
|
```
|
|
|
|
**Escenario 5: Guardar como borrador**
|
|
```gherkin
|
|
DADO que no he terminado la cotizacion
|
|
CUANDO guardo como borrador
|
|
ENTONCES se guarda sin enviar al cliente
|
|
Y puedo continuar editandola despues
|
|
```
|
|
|
|
---
|
|
|
|
## Estructura de Cotizacion
|
|
|
|
```typescript
|
|
interface Quote {
|
|
id: string;
|
|
folio: string; // COT-2025-0001
|
|
vehicle_id: string;
|
|
client_id: string;
|
|
diagnostic_id?: string;
|
|
|
|
services: QuoteService[];
|
|
parts: QuotePart[];
|
|
|
|
subtotal_services: number;
|
|
subtotal_parts: number;
|
|
discount: number;
|
|
subtotal: number;
|
|
iva: number;
|
|
total: number;
|
|
|
|
validity_days: number;
|
|
expires_at: Date;
|
|
status: QuoteStatus;
|
|
notes: string;
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## Tareas Tecnicas
|
|
|
|
**Database:**
|
|
- [ ] DB-055: Crear tabla `quotes`
|
|
- [ ] DB-056: Crear tabla `quote_items`
|
|
- [ ] DB-057: Secuencia de folios
|
|
|
|
**Backend:**
|
|
- [ ] BE-100: Crear QuoteEntity
|
|
- [ ] BE-101: Crear QuoteService
|
|
- [ ] BE-102: Endpoint POST /api/quotes
|
|
- [ ] BE-103: Calculos de totales automaticos
|
|
|
|
**Frontend:**
|
|
- [ ] FE-100: Crear QuoteFormPage
|
|
- [ ] FE-101: Crear QuoteItemList
|
|
- [ ] FE-102: Crear TotalsCard
|
|
- [ ] FE-103: Crear ServicePicker
|
|
|
|
---
|
|
|
|
## Definition of Done (DoD)
|
|
|
|
- [ ] Crear cotizacion desde diagnostico
|
|
- [ ] Agregar servicios y refacciones
|
|
- [ ] Calcular totales automaticos
|
|
- [ ] Guardar como borrador
|
|
- [ ] Tests pasando
|
|
|
|
---
|
|
|
|
**Creada por:** Requirements-Analyst
|
|
**Fecha:** 2025-12-06
|