michangarrito/orchestration/_archive/analisis/PLAN-EJECUCION-CONSOLIDADO-2026-01-10.md
Adrian Flores Cortes 2fb9f3f6b5
Some checks are pending
CI/CD Pipeline / Backend CI (push) Waiting to run
CI/CD Pipeline / Frontend CI (push) Waiting to run
CI/CD Pipeline / WhatsApp Service CI (push) Waiting to run
CI/CD Pipeline / Mobile CI (push) Waiting to run
CI/CD Pipeline / Docker Build (./apps/backend, ./apps/backend/Dockerfile, backend) (push) Blocked by required conditions
CI/CD Pipeline / Docker Build (./apps/frontend, ./apps/frontend/Dockerfile, frontend) (push) Blocked by required conditions
CI/CD Pipeline / Docker Build (./apps/whatsapp-service, ./apps/whatsapp-service/Dockerfile, whatsapp-service) (push) Blocked by required conditions
CI/CD Pipeline / Deploy to Production (push) Blocked by required conditions
[ESTANDAR-ORCHESTRATION] refactor: Consolidate to standard structure
- Move 7 non-standard folders to _archive/
- Archive 3 extra root files
- Update _MAP.md with standardized structure

Standard: SIMCO-ESTANDAR-ORCHESTRATION v1.0.0
Level: CONSUMER (L2)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 14:38:04 -06:00

433 lines
12 KiB
Markdown

# PLAN DE EJECUCION CONSOLIDADO
**Proyecto:** MiChangarrito
**Fecha:** 2026-01-10
**Estado:** LISTO PARA EJECUCION
**Version:** 1.0.0
**Fases Cubiertas:** FASE 2-5 (Consolidadas)
---
## RESUMEN DE DISCREPANCIAS A CORREGIR
### Totales por Severidad
| Severidad | Cantidad | Sprint Asignado |
|-----------|----------|-----------------|
| CRITICA | 12 | Sprint 2-3 |
| ALTA | 14 | Sprint 2-6 |
| MEDIA | 8 | Sprint 4-7 |
| **TOTAL** | **34** | - |
---
## SPRINT 1: PREPARACION Y BACKUP
### Tareas
| ID | Tarea | Accion | Validacion |
|----|-------|--------|------------|
| S1-001 | Crear backup completo | `cp -r docs/ backup-docs-2026-01-10/` | Directorio existe |
| S1-002 | Verificar historico/ | `ls orchestration/analisis/historico/` | 5 archivos presentes |
| S1-003 | Crear checkpoint git | `git add . && git commit` | Commit creado |
### Criterios de Exito
- [ ] backup-docs-2026-01-10/ creado
- [ ] historico/ verificado con archivos
- [ ] Commit de checkpoint creado
---
## SPRINT 2: ARQUITECTURA Y ESPECIFICACIONES (F-001)
### Discrepancias a Corregir
| ID | Discrepancia | Archivo | Lineas | Correccion |
|----|--------------|---------|--------|------------|
| S2-001 | React 18 → React 19.2.0 | ARQUITECTURA-TECNICA.md | Seccion Stack | Actualizar version |
| S2-002 | React Router 6 → 7.11.0 | ARQUITECTURA-TECNICA.md | Seccion Stack | Actualizar version |
| S2-003 | Vite no especificado → 7.2.4 | ARQUITECTURA-TECNICA.md | Seccion Stack | Agregar version |
| S2-004 | TailwindCSS sin version | ARQUITECTURA-TECNICA.md | Seccion Stack | Agregar version |
| S2-005 | shadcn/ui documentado pero NO existe | ARQUITECTURA-TECNICA.md | Seccion UI | REMOVER referencia |
| S2-006 | Recharts documentado pero NO existe | ARQUITECTURA-TECNICA.md | Seccion Charts | REMOVER referencia |
| S2-007 | ReportsModule NO existe | ARQUITECTURA-TECNICA.md | Seccion Modulos | REMOVER referencia |
| S2-008 | NotificationsModule NO existe | ARQUITECTURA-TECNICA.md | Seccion Modulos | REMOVER referencia |
| S2-009 | Agregar dependencias reales | ARQUITECTURA-TECNICA.md | Seccion Deps | axios, clsx, lucide-react |
### Acciones Detalladas
**S2-001 a S2-004: Actualizar versiones**
```markdown
# En ARQUITECTURA-TECNICA.md, seccion Stack Frontend:
ANTES:
- React 18
- React Router 6
DESPUES:
- React 19.2.0
- React Router 7.11.0
- Vite 7.2.4
- TailwindCSS 4.0.x
```
**S2-005, S2-006: Remover librerias inexistentes**
```markdown
# REMOVER cualquier mencion de:
- shadcn/ui (no instalado)
- Recharts (no instalado)
```
**S2-007, S2-008: Remover modulos inexistentes**
```markdown
# REMOVER de lista de modulos:
- ReportsModule (no existe en codigo)
- NotificationsModule (no existe en codigo)
```
### Criterios de Exito Sprint 2
- [ ] Versiones de React, Router, Vite correctas
- [ ] Sin referencias a shadcn/ui ni Recharts
- [ ] Sin referencias a ReportsModule/NotificationsModule
- [ ] Dependencias reales documentadas
---
## SPRINT 3: BASE DE DATOS (F-002)
### Discrepancias a Corregir
| ID | Discrepancia | Accion |
|----|--------------|--------|
| S3-001 | Schema integrations NO documentado | Agregar a ARQUITECTURA-DATABASE.md |
| S3-002 | Schema billing NO documentado (5 tablas) | Agregar schema completo |
| S3-003 | Schema marketplace NO documentado (6 tablas) | Agregar schema completo |
| S3-004 | 4 tablas sales adicionales | Documentar en seccion sales |
| S3-005 | 3 tablas subscriptions adicionales | Documentar en seccion subscriptions |
| S3-006 | 2 tablas public adicionales | Documentar en seccion public |
| S3-007 | 10 funciones NO documentadas | Agregar a seccion Funciones |
| S3-008 | ~10 triggers adicionales | Agregar a seccion Triggers |
### Contenido a Agregar
**S3-001: Schema integrations**
```markdown
### Schema: integrations
| Tabla | Descripcion |
|-------|-------------|
| tenant_integration_credentials | Credenciales por tenant |
| tenant_whatsapp_numbers | Numeros WhatsApp por tenant |
ENUMs:
- integration_type
- credential_status
```
**S3-002: Schema billing**
```markdown
### Schema: billing
| Tabla | Descripcion |
|-------|-------------|
| tax_configs | Configuraciones fiscales |
| invoices | Facturas |
| invoice_items | Items de factura |
| invoice_item_taxes | Impuestos por item |
| invoice_history | Historial de facturas |
```
**S3-003: Schema marketplace**
```markdown
### Schema: marketplace
| Tabla | Descripcion |
|-------|-------------|
| suppliers | Proveedores |
| supplier_products | Productos de proveedores |
| supplier_orders | Pedidos a proveedores |
| supplier_order_items | Items de pedido |
| supplier_reviews | Resenas de proveedores |
| supplier_favorites | Favoritos |
```
**S3-007: Funciones a documentar**
```markdown
### Funciones Adicionales
| Funcion | Schema | Proposito |
|---------|--------|-----------|
| orders.generate_order_number() | orders | Generar numero de orden |
| inventory.update_stock_on_sale() | inventory | Actualizar stock en venta |
| subscriptions.generate_referral_code() | subscriptions | Generar codigo referido |
| subscriptions.get_referral_stats() | subscriptions | Estadisticas referidos |
| sales.generate_codi_reference() | sales | Referencia CoDi |
| sales.get_codi_spei_summary() | sales | Resumen CoDi/SPEI |
| billing.get_next_invoice_folio() | billing | Siguiente folio factura |
| billing.get_invoice_summary() | billing | Resumen factura |
| marketplace.update_supplier_rating() | marketplace | Rating proveedor |
| marketplace.find_suppliers_by_zone() | marketplace | Buscar proveedores |
```
### Criterios de Exito Sprint 3
- [ ] Schema integrations documentado
- [ ] Schema billing documentado (5 tablas)
- [ ] Schema marketplace documentado (6 tablas)
- [ ] Tablas adicionales de sales documentadas
- [ ] 10 funciones documentadas
- [ ] Conteo actualizado: 12 schemas, ~49 tablas
---
## SPRINT 4: BACKEND (F-003)
### Discrepancias a Corregir
| ID | Discrepancia | Accion |
|----|--------------|--------|
| S4-001 | InvoicesModule NO documentado (9 endpoints) | Agregar a ESPECIFICACION-COMPONENTES.md |
| S4-002 | WidgetsModule NO documentado (4 endpoints) | Agregar a ESPECIFICACION-COMPONENTES.md |
| S4-003 | ~70 endpoints NO documentados | Documentar por modulo |
| S4-004 | Actualizar conteo modulos: 17→18 | Corregir en documentacion |
### Contenido a Agregar
**S4-001: InvoicesModule**
```markdown
### InvoicesModule
**Controller:** invoices.controller.ts
**Endpoints:** 9
| Metodo | Ruta | Descripcion |
|--------|------|-------------|
| POST | /invoices | Crear factura |
| GET | /invoices | Listar facturas |
| GET | /invoices/:id | Obtener factura |
| PUT | /invoices/:id | Actualizar factura |
| DELETE | /invoices/:id | Eliminar factura |
| POST | /invoices/:id/stamp | Timbrar CFDI |
| POST | /invoices/:id/cancel | Cancelar CFDI |
| GET | /invoices/:id/pdf | Descargar PDF |
| GET | /invoices/:id/xml | Descargar XML |
```
**S4-002: WidgetsModule**
```markdown
### WidgetsModule
**Controller:** widgets.controller.ts
**Endpoints:** 4
| Metodo | Ruta | Descripcion |
|--------|------|-------------|
| GET | /widgets | Listar widgets |
| POST | /widgets | Crear widget |
| PUT | /widgets/:id | Actualizar widget |
| DELETE | /widgets/:id | Eliminar widget |
```
### Criterios de Exito Sprint 4
- [ ] InvoicesModule documentado
- [ ] WidgetsModule documentado
- [ ] Conteo de modulos actualizado a 18
- [ ] Endpoints faltantes documentados
---
## SPRINT 5: FRONTEND (F-004)
### Discrepancias a Corregir
| ID | Discrepancia | Accion |
|----|--------------|--------|
| S5-001 | Register.tsx NO documentada | Agregar a ESPECIFICACION-COMPONENTES.md |
| S5-002 | Reports.tsx documentada pero NO existe | REMOVER de documentacion |
| S5-003 | Sales.tsx confundida con Products.tsx | Corregir referencia |
| S5-004 | Componentes inline NO documentados | Documentar principales |
### Acciones Detalladas
**S5-001: Agregar Register.tsx**
```markdown
### Paginas Frontend
| Pagina | Ruta | Componente |
|--------|------|------------|
| Register | /register | Register.tsx |
```
**S5-002: Remover Reports.tsx**
```markdown
# REMOVER de lista de paginas:
- Reports.tsx (/reports) - NO EXISTE EN CODIGO
```
### Criterios de Exito Sprint 5
- [ ] Register.tsx documentada
- [ ] Reports.tsx removida de documentacion
- [ ] Sin confusiones Sales/Products
- [ ] Conteo de paginas: 12
---
## SPRINT 6: INTEGRACIONES Y EPICAS (F-005, F-006)
### Discrepancias Integraciones
| ID | Discrepancia | Accion |
|----|--------------|--------|
| S6-001 | SAT CFDI solo modelo (5% impl) | Documentar estado real |
| S6-002 | SPEI/STP mock (40% impl) | Documentar como mock |
| S6-003 | CoDi mock (40% impl) | Documentar como mock |
| S6-004 | Firebase FCM solo docs (0% impl) | Marcar como pendiente |
### Discrepancias Epicas
| ID | Epica | Estado Doc | Estado Real | Accion |
|----|-------|------------|-------------|--------|
| S6-005 | MCH-024 CoDi/SPEI | Pendiente | Completado (Base) | Actualizar estado |
| S6-006 | MCH-026 Multi-idioma | Pendiente | Completado (Base) | Actualizar estado |
| S6-007 | MCH-027 SAT | Pendiente | Completado (Base) | Actualizar estado |
| S6-008 | MCH-028 Marketplace | Pendiente | Completado (Base) | Actualizar estado |
| S6-009 | MCH-012 Chat LLM Dueno | Completado | Pendiente | Corregir estado |
| S6-010 | MCH-013 Chat LLM Cliente | Completado | Pendiente | Corregir estado |
### Acciones en Archivos
**INTEGRACIONES-EXTERNAS.md**
```markdown
# Actualizar estado de implementacion:
| Integracion | Estado Real |
|-------------|-------------|
| SAT CFDI 4.0 | MODELO SOLO (5%) - Requiere PAC |
| SPEI/STP | MOCK (40%) - Requiere STP.mx |
| CoDi | MOCK (40%) - Requiere Banxico |
| Firebase FCM | PENDIENTE (0%) |
```
**Epicas MCH-024 a MCH-028**
```markdown
# En cada archivo de epica:
Estado: Completado (Implementacion Base)
Notas: Infraestructura creada, integracion real pendiente
```
### Criterios de Exito Sprint 6
- [ ] Estados de integracion reflejan realidad
- [ ] Epicas MCH-024-028 marcadas "Completado (Base)"
- [ ] Epicas MCH-012, MCH-013 corregidas a "Pendiente"
---
## SPRINT 7: INDICES Y MAPAS (F-007)
### Discrepancias a Corregir
| ID | Discrepancia | Archivo | Accion |
|----|--------------|---------|--------|
| S7-001 | CALCULADORA-CAMBIO.md no listado | docs/_MAP.md | Agregar o crear archivo |
| S7-002 | ESPECIFICACION-COMPONENTES.md no en tabla | docs/02-especificaciones/_MAP.md | Agregar a tabla |
| S7-003 | Omite 2 archivos existentes | docs/02-especificaciones/_MAP.md | Agregar archivos |
| S7-004 | Dice "25+ tablas" pero son 49 | docs/02-especificaciones/_MAP.md | Corregir conteo |
| S7-005 | Dice "27 tablas" pero son 49 | docs/INDICE-ARQUITECTURA.md | Corregir conteo |
### Acciones Detalladas
**S7-001 a S7-003: Actualizar mapas**
```markdown
# En docs/_MAP.md agregar:
- Verificar CALCULADORA-CAMBIO.md existe o crear
# En docs/02-especificaciones/_MAP.md agregar:
- ESPECIFICACION-COMPONENTES.md
- Archivos faltantes
```
**S7-004, S7-005: Corregir conteos**
```markdown
# Conteos correctos:
- Schemas: 12
- Tablas: ~49
- Funciones: 15
- Triggers: 20+
```
### Criterios de Exito Sprint 7
- [ ] docs/_MAP.md completo
- [ ] docs/02-especificaciones/_MAP.md actualizado
- [ ] Conteos de tablas correctos
- [ ] Cero archivos huerfanos
- [ ] Cero referencias rotas
---
## FASE 7: VALIDACION FINAL
### Checklist de Validacion
| Categoria | Criterio | Metodo |
|-----------|----------|--------|
| Arquitectura | Versiones correctas | Comparar package.json |
| Database | 12 schemas documentados | Contar en ARQUITECTURA-DATABASE.md |
| Database | ~49 tablas documentadas | Contar en ARQUITECTURA-DATABASE.md |
| Backend | 18 modulos documentados | Contar en ESPECIFICACION-COMPONENTES.md |
| Frontend | 12 paginas documentadas | Contar en ESPECIFICACION-COMPONENTES.md |
| Integraciones | Estados reales | Comparar con codigo |
| Epicas | 28 con estado correcto | Revisar _MAP.md |
| Indices | Cero huerfanos | Verificar archivos |
| Indices | Cero rotas | grep referencias |
### Metricas Objetivo
| Metrica | Antes | Despues |
|---------|-------|---------|
| Discrepancias CRITICAS | 12 | 0 |
| Discrepancias ALTAS | 14 | 0 |
| Discrepancias MEDIAS | 8 | 0 |
| Referencias rotas | 0 | 0 |
| Archivos huerfanos | 2 | 0 |
| Cobertura schemas | 92% | 100% |
| Cobertura modulos | 94% | 100% |
---
## ORDEN DE EJECUCION
```
Sprint 1 (Preparacion)
|
v
Sprint 2 (Arquitectura)
|
v
Sprint 3 (Database)
|
v
Sprint 4 (Backend)
|
v
Sprint 5 (Frontend)
|
v
Sprint 6 (Integraciones + Epicas)
|
v
Sprint 7 (Indices)
|
v
FASE 7 (Validacion)
```
---
## ESTADO ACTUAL
**Plan:** COMPLETADO Y VALIDADO
**Siguiente:** EJECUTAR SPRINT 1
---
**Generado por:** Orquestador
**Fecha:** 2026-01-10
**Version:** 1.0.0