Some checks failed
ERP Core CI / Backend Lint (push) Has been cancelled
ERP Core CI / Backend Unit Tests (push) Has been cancelled
ERP Core CI / Backend Integration Tests (push) Has been cancelled
ERP Core CI / Frontend Lint (push) Has been cancelled
ERP Core CI / Frontend Unit Tests (push) Has been cancelled
ERP Core CI / Frontend E2E Tests (push) Has been cancelled
ERP Core CI / Database DDL Validation (push) Has been cancelled
ERP Core CI / Backend Build (push) Has been cancelled
ERP Core CI / Frontend Build (push) Has been cancelled
ERP Core CI / CI Success (push) Has been cancelled
Performance Tests / Lighthouse CI (push) Has been cancelled
Performance Tests / Bundle Size Analysis (push) Has been cancelled
Performance Tests / k6 Load Tests (push) Has been cancelled
Performance Tests / Performance Summary (push) Has been cancelled
- HERENCIA-SIMCO.md actualizado con directivas v3.7 y v3.8 - Actualizaciones en modulos CRM y OpenAPI Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
899 lines
24 KiB
Markdown
899 lines
24 KiB
Markdown
# PLAN AJUSTADO - FASE 2 (CAPVED)
|
|
|
|
**Fecha:** 2026-01-10
|
|
**Basado en:** `ANALISIS-DETALLADO-FASE1-2026-01-10.md`
|
|
**Plan Original:** `PLAN-VALIDACION-DESARROLLO-2026-01-06.md`
|
|
**Fase CAPVED:** P (Planeacion)
|
|
**Orquestador:** Claude Code - Opus 4.5
|
|
|
|
---
|
|
|
|
## RESUMEN EJECUTIVO
|
|
|
|
Plan ajustado basado en verificacion real de archivos existentes. Se reducen 26 SP del total original debido a tareas ya completadas.
|
|
|
|
### Comparativa de Story Points
|
|
|
|
| Sprint | Original | Refinado Anterior | **Ajustado** | Delta vs Original |
|
|
|--------|----------|------------------|--------------|-------------------|
|
|
| Sprint 1 | 44 SP | 36 SP | **22 SP** | -22 SP (-50%) |
|
|
| Sprint 2 | 39 SP | 37 SP | **37 SP** | -2 SP (-5%) |
|
|
| Sprint 3 | 36 SP | 36 SP | **36 SP** | 0 SP |
|
|
| Sprint 4 | 33 SP | 33 SP | **31 SP** | -2 SP (-6%) |
|
|
| **TOTAL** | **152 SP** | **142 SP** | **126 SP** | **-26 SP (-17%)** |
|
|
|
|
---
|
|
|
|
## 1. TAREAS ELIMINADAS (YA COMPLETADAS)
|
|
|
|
Las siguientes tareas del plan original NO requieren trabajo:
|
|
|
|
| Tarea ID | Titulo | SP Eliminados | Razon |
|
|
|----------|--------|---------------|-------|
|
|
| DB-001 | Crear HR Schema | 8 SP | `12-hr.sql` existe (870 lineas, 19+ tablas) |
|
|
| DB-003 | track_field_changes() | 3 SP | Existe en `09-system.sql` (lineas 681-773) |
|
|
| DB-004 | Crear seed data | 5 SP | 8 archivos seeds existen en `database/seeds/` |
|
|
| **TOTAL ELIMINADO** | - | **16 SP** | - |
|
|
|
|
---
|
|
|
|
## 2. TAREAS REDUCIDAS
|
|
|
|
| Tarea ID | Titulo | SP Original | SP Ajustado | Razon |
|
|
|----------|--------|-------------|-------------|-------|
|
|
| BE-001 | Jest Setup | 5 SP | 2 SP | Jest/Supertest instalados, solo config |
|
|
| BE-006 | Permission Cache | 4 SP | 2 SP | Redis config existe y completo |
|
|
| DB-002 | RLS Validation | 5 SP | 2 SP | Tests SQL ya existen, solo ejecutar |
|
|
| FE-015 | Frontend Tests | 3 SP | 1 SP | Vitest/Playwright instalados |
|
|
| **TOTAL REDUCIDO** | - | **17 SP** | **7 SP** | **-10 SP** |
|
|
|
|
---
|
|
|
|
## 3. PLAN DETALLADO POR SPRINT
|
|
|
|
### 3.1 SPRINT 1: Foundation - Tests Setup + Catalogs Inicio
|
|
|
|
**Duracion:** 2 semanas
|
|
**Story Points:** 22 SP (antes 44 SP)
|
|
**Objetivo:** Validar seguridad, configurar tests, iniciar frontend catalogs
|
|
|
|
#### Database (2 SP)
|
|
|
|
```yaml
|
|
DB-002:
|
|
titulo: "Ejecutar y validar RLS Tests"
|
|
sp: 2
|
|
estado: AJUSTADO (antes 5 SP)
|
|
descripcion: |
|
|
Los tests SQL ya existen en database/tests/:
|
|
- rls-validation.sql
|
|
- tenant-isolation.sql
|
|
- sql-functions.sql
|
|
|
|
Trabajo requerido:
|
|
- Ejecutar tests en ambiente de desarrollo
|
|
- Verificar que todos pasen
|
|
- Documentar resultados
|
|
- Crear reporte de cobertura RLS
|
|
|
|
archivos_existentes:
|
|
- database/tests/rls-validation.sql
|
|
- database/tests/tenant-isolation.sql
|
|
- database/tests/sql-functions.sql
|
|
|
|
archivos_a_crear:
|
|
- database/tests/REPORTE-RLS-2026-01.md
|
|
|
|
criterios_aceptacion:
|
|
- 100% tests RLS pasando
|
|
- Tenant isolation verificado
|
|
- Documentacion de resultados
|
|
|
|
perfil: PERFIL-DATABASE.md
|
|
dependencias: []
|
|
```
|
|
|
|
#### Backend (10 SP)
|
|
|
|
```yaml
|
|
BE-001:
|
|
titulo: "Configurar Jest y crear setup base"
|
|
sp: 2
|
|
estado: AJUSTADO (antes 5 SP)
|
|
descripcion: |
|
|
Jest y Supertest ya estan instalados en package.json.
|
|
|
|
Trabajo requerido:
|
|
- Crear/verificar jest.config.js
|
|
- Crear tests/setup.ts con configuracion de DB de test
|
|
- Crear factories basicas (user, tenant)
|
|
|
|
archivos_existentes:
|
|
- backend/package.json (jest: ^29.7.0, supertest: ^7.0.0)
|
|
|
|
archivos_a_crear:
|
|
- backend/jest.config.js
|
|
- backend/tests/setup.ts
|
|
- backend/tests/factories/user.factory.ts
|
|
- backend/tests/factories/tenant.factory.ts
|
|
- backend/tests/utils/test-helpers.ts
|
|
|
|
criterios_aceptacion:
|
|
- npm test ejecuta sin errores
|
|
- DB de test se crea/destruye correctamente
|
|
- Factories generan datos validos
|
|
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: []
|
|
|
|
BE-002:
|
|
titulo: "Tests Auth Module"
|
|
sp: 8
|
|
estado: SIN CAMBIOS
|
|
descripcion: |
|
|
Crear suite completa de tests para modulo auth:
|
|
- Unit tests para services
|
|
- Integration tests para controllers
|
|
- E2E tests para flujos completos
|
|
|
|
archivos_a_crear:
|
|
- backend/src/modules/auth/__tests__/auth.service.spec.ts
|
|
- backend/src/modules/auth/__tests__/auth.controller.spec.ts
|
|
- backend/src/modules/auth/__tests__/auth.integration.spec.ts
|
|
- backend/src/modules/auth/__tests__/token.service.spec.ts
|
|
|
|
casos_de_prueba:
|
|
login:
|
|
- happy path (email + password validos)
|
|
- invalid email format
|
|
- wrong password
|
|
- rate limiting (5 intentos)
|
|
- locked account
|
|
register:
|
|
- success
|
|
- duplicate email
|
|
- weak password
|
|
- invalid tenant
|
|
refresh_token:
|
|
- valid refresh
|
|
- expired token
|
|
- revoked token
|
|
logout:
|
|
- single session
|
|
- all sessions
|
|
change_password:
|
|
- success
|
|
- wrong current password
|
|
- weak new password
|
|
|
|
cobertura_target: ">80%"
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: [BE-001]
|
|
```
|
|
|
|
#### Frontend (10 SP)
|
|
|
|
```yaml
|
|
FE-001:
|
|
titulo: "Feature Catalogs - Estructura"
|
|
sp: 5
|
|
estado: SIN CAMBIOS
|
|
descripcion: |
|
|
Crear estructura completa del feature catalogs siguiendo patron FSD.
|
|
|
|
archivos_a_crear:
|
|
- frontend/src/features/catalogs/index.ts
|
|
- frontend/src/features/catalogs/api/catalogs.api.ts
|
|
- frontend/src/features/catalogs/types/catalog.types.ts
|
|
- frontend/src/features/catalogs/hooks/useCountries.ts
|
|
- frontend/src/features/catalogs/hooks/useCurrencies.ts
|
|
- frontend/src/features/catalogs/hooks/useUom.ts
|
|
- frontend/src/features/catalogs/hooks/useCategories.ts
|
|
- frontend/src/features/catalogs/components/CountrySelect.tsx
|
|
- frontend/src/features/catalogs/components/CurrencySelect.tsx
|
|
- frontend/src/features/catalogs/components/UomSelect.tsx
|
|
|
|
patron_a_seguir: "features/users/ (estructura existente)"
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: []
|
|
|
|
FE-002:
|
|
titulo: "Countries & States Pages"
|
|
sp: 5
|
|
estado: SIN CAMBIOS
|
|
descripcion: |
|
|
CRUD completo para paises y estados.
|
|
|
|
archivos_a_crear:
|
|
- frontend/src/pages/catalogs/countries/CountriesListPage.tsx
|
|
- frontend/src/pages/catalogs/countries/CountryDetailPage.tsx
|
|
- frontend/src/pages/catalogs/countries/CountryFormPage.tsx
|
|
- frontend/src/pages/catalogs/states/StatesByCountryPage.tsx
|
|
- frontend/src/features/catalogs/components/CountryForm.tsx
|
|
- frontend/src/features/catalogs/components/StateForm.tsx
|
|
|
|
funcionalidades:
|
|
- Lista de paises con busqueda y paginacion
|
|
- Detalle de pais con estados
|
|
- Crear/editar pais
|
|
- CRUD estados por pais
|
|
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-001]
|
|
```
|
|
|
|
#### Resumen Sprint 1
|
|
|
|
| Capa | Tareas | SP |
|
|
|------|--------|-----|
|
|
| Database | DB-002 | 2 |
|
|
| Backend | BE-001, BE-002 | 10 |
|
|
| Frontend | FE-001, FE-002 | 10 |
|
|
| **TOTAL** | **5 tareas** | **22 SP** |
|
|
|
|
---
|
|
|
|
### 3.2 SPRINT 2: Tests Foundation + Catalogs Frontend
|
|
|
|
**Duracion:** 2 semanas
|
|
**Story Points:** 37 SP
|
|
**Objetivo:** Completar tests foundation, terminar catalogs frontend
|
|
|
|
#### Backend (17 SP)
|
|
|
|
```yaml
|
|
BE-003:
|
|
titulo: "Tests Users Module"
|
|
sp: 5
|
|
descripcion: |
|
|
18+ test cases para modulo users
|
|
archivos_a_crear:
|
|
- backend/src/modules/users/__tests__/users.service.spec.ts
|
|
- backend/src/modules/users/__tests__/users.controller.spec.ts
|
|
casos_de_prueba:
|
|
- CRUD operations (create, read, update, delete)
|
|
- Search with filters
|
|
- Pagination
|
|
- Role assignment
|
|
- Activate/deactivate user
|
|
- Multi-tenant isolation
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: [BE-001]
|
|
|
|
BE-004:
|
|
titulo: "Tests Roles Module"
|
|
sp: 5
|
|
descripcion: |
|
|
15+ test cases para modulo roles
|
|
archivos_a_crear:
|
|
- backend/src/modules/roles/__tests__/roles.service.spec.ts
|
|
- backend/src/modules/roles/__tests__/roles.controller.spec.ts
|
|
casos_de_prueba:
|
|
- CRUD roles
|
|
- Permission assignment
|
|
- System role protection (no delete/modify)
|
|
- Role hierarchy
|
|
- Permission validation
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: [BE-001]
|
|
|
|
BE-005:
|
|
titulo: "Tests Tenants Module"
|
|
sp: 5
|
|
descripcion: |
|
|
12+ test cases para modulo tenants
|
|
archivos_a_crear:
|
|
- backend/src/modules/tenants/__tests__/tenants.service.spec.ts
|
|
- backend/src/modules/tenants/__tests__/tenants.controller.spec.ts
|
|
casos_de_prueba:
|
|
- Tenant creation/update
|
|
- Feature flags per tenant
|
|
- Plan limits validation
|
|
- Tenant isolation
|
|
- Settings management
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: [BE-001]
|
|
|
|
BE-006:
|
|
titulo: "Permission Cache Service"
|
|
sp: 2
|
|
estado: AJUSTADO (antes 4-6 SP)
|
|
descripcion: |
|
|
Redis config ya existe y esta completo.
|
|
Solo crear servicio de cache de permisos.
|
|
archivos_existentes:
|
|
- backend/src/config/redis.ts (179 lineas, redisClient, blacklistToken, etc.)
|
|
archivos_a_crear:
|
|
- backend/src/modules/auth/services/permission-cache.service.ts
|
|
funcionalidades:
|
|
- Cache de permisos por usuario (key: user:{id}:permissions)
|
|
- TTL: 1 hora
|
|
- Invalidacion en cambio de rol
|
|
- Fallback a DB si Redis no disponible
|
|
target_performance: "<5ms lookup"
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: []
|
|
```
|
|
|
|
#### Frontend (20 SP)
|
|
|
|
```yaml
|
|
FE-003:
|
|
titulo: "Currencies Pages"
|
|
sp: 5
|
|
archivos_a_crear:
|
|
- frontend/src/pages/catalogs/currencies/CurrenciesListPage.tsx
|
|
- frontend/src/pages/catalogs/currencies/CurrencyFormPage.tsx
|
|
- frontend/src/pages/catalogs/currencies/ExchangeRatesPage.tsx
|
|
- frontend/src/features/catalogs/components/CurrencyForm.tsx
|
|
- frontend/src/features/catalogs/components/ExchangeRateForm.tsx
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-001]
|
|
|
|
FE-004:
|
|
titulo: "Units of Measure Pages"
|
|
sp: 5
|
|
archivos_a_crear:
|
|
- frontend/src/pages/catalogs/uom/UomCategoriesListPage.tsx
|
|
- frontend/src/pages/catalogs/uom/UomListPage.tsx
|
|
- frontend/src/features/catalogs/components/UomCategoryForm.tsx
|
|
- frontend/src/features/catalogs/components/UomForm.tsx
|
|
- frontend/src/features/catalogs/components/UomSelect.tsx
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-001]
|
|
|
|
FE-005:
|
|
titulo: "Product Categories Pages"
|
|
sp: 8
|
|
archivos_a_crear:
|
|
- frontend/src/pages/catalogs/categories/CategoriesTreePage.tsx
|
|
- frontend/src/pages/catalogs/categories/CategoryFormPage.tsx
|
|
- frontend/src/features/catalogs/components/CategoryTree.tsx
|
|
- frontend/src/features/catalogs/components/CategoryForm.tsx
|
|
- frontend/src/features/catalogs/hooks/useCategoryTree.ts
|
|
funcionalidades:
|
|
- Vista de arbol expandible
|
|
- Drag & drop para reorganizar
|
|
- CRUD con jerarquia
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-001]
|
|
|
|
FE-006:
|
|
titulo: "Rutas y navegacion Catalogs"
|
|
sp: 2
|
|
archivos_a_modificar:
|
|
- frontend/src/app/router/routes.tsx
|
|
rutas_a_agregar:
|
|
- /catalogs
|
|
- /catalogs/countries
|
|
- /catalogs/countries/:id
|
|
- /catalogs/currencies
|
|
- /catalogs/currencies/:id
|
|
- /catalogs/uom
|
|
- /catalogs/uom/:id
|
|
- /catalogs/categories
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-002, FE-003, FE-004, FE-005]
|
|
```
|
|
|
|
#### Resumen Sprint 2
|
|
|
|
| Capa | Tareas | SP |
|
|
|------|--------|-----|
|
|
| Backend | BE-003, BE-004, BE-005, BE-006 | 17 |
|
|
| Frontend | FE-003, FE-004, FE-005, FE-006 | 20 |
|
|
| **TOTAL** | **8 tareas** | **37 SP** |
|
|
|
|
---
|
|
|
|
### 3.3 SPRINT 3: OAuth + Settings Frontend
|
|
|
|
**Duracion:** 2 semanas
|
|
**Story Points:** 36 SP
|
|
**Objetivo:** OAuth integration, tests core business, inicio settings
|
|
|
|
#### Backend (22 SP)
|
|
|
|
```yaml
|
|
BE-007:
|
|
titulo: "Tests Financial Module"
|
|
sp: 8
|
|
archivos_a_crear:
|
|
- backend/src/modules/financial/__tests__/journal.service.spec.ts
|
|
- backend/src/modules/financial/__tests__/invoice.service.spec.ts
|
|
- backend/src/modules/financial/__tests__/payment.service.spec.ts
|
|
casos_de_prueba:
|
|
- Journal entries balance validation
|
|
- Invoice workflow (draft -> posted -> paid)
|
|
- Payment reconciliation
|
|
- Multi-currency handling
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: [BE-001]
|
|
|
|
BE-008:
|
|
titulo: "Tests Inventory Module"
|
|
sp: 6
|
|
archivos_a_crear:
|
|
- backend/src/modules/inventory/__tests__/product.service.spec.ts
|
|
- backend/src/modules/inventory/__tests__/stock.service.spec.ts
|
|
casos_de_prueba:
|
|
- Stock moves validation
|
|
- Valuation (FIFO, LIFO, Average)
|
|
- Stock adjustments
|
|
- Location transfers
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: [BE-001]
|
|
|
|
BE-009:
|
|
titulo: "OAuth2 Integration"
|
|
sp: 8
|
|
archivos_a_crear:
|
|
- backend/src/modules/auth/providers/google.provider.ts
|
|
- backend/src/modules/auth/providers/microsoft.provider.ts
|
|
- backend/src/modules/auth/providers/oauth.types.ts
|
|
archivos_a_modificar:
|
|
- backend/src/modules/auth/auth.routes.ts
|
|
- backend/src/modules/auth/auth.controller.ts
|
|
endpoints:
|
|
- GET /auth/oauth/google
|
|
- GET /auth/oauth/google/callback
|
|
- GET /auth/oauth/microsoft
|
|
- GET /auth/oauth/microsoft/callback
|
|
- POST /auth/oauth/link
|
|
- DELETE /auth/oauth/unlink/:provider
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: []
|
|
```
|
|
|
|
#### Frontend (14 SP)
|
|
|
|
```yaml
|
|
FE-007:
|
|
titulo: "Stores Catalogs (Zustand)"
|
|
sp: 3
|
|
archivos_a_crear:
|
|
- frontend/src/shared/stores/useCurrencyStore.ts
|
|
- frontend/src/shared/stores/useCatalogCacheStore.ts
|
|
funcionalidades:
|
|
- Current currency global
|
|
- Cache de listas de catalogos
|
|
- Invalidacion automatica
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: []
|
|
|
|
FE-008:
|
|
titulo: "Feature Settings - Estructura"
|
|
sp: 3
|
|
archivos_a_crear:
|
|
- frontend/src/features/settings/index.ts
|
|
- frontend/src/features/settings/api/settings.api.ts
|
|
- frontend/src/features/settings/types/settings.types.ts
|
|
- frontend/src/features/settings/hooks/useSystemSettings.ts
|
|
- frontend/src/features/settings/hooks/useTenantSettings.ts
|
|
- frontend/src/features/settings/hooks/useUserPreferences.ts
|
|
patron_a_seguir: "features/tenants/"
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: []
|
|
|
|
FE-009:
|
|
titulo: "System Settings Page"
|
|
sp: 5
|
|
archivos_a_crear:
|
|
- frontend/src/pages/settings/SystemSettingsPage.tsx
|
|
- frontend/src/features/settings/components/GeneralSettingsForm.tsx
|
|
- frontend/src/features/settings/components/EmailSettingsForm.tsx
|
|
- frontend/src/features/settings/components/SecuritySettingsForm.tsx
|
|
secciones:
|
|
- General (app name, logo, timezone)
|
|
- Email (SMTP config)
|
|
- Security (password policy, session timeout)
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-008]
|
|
|
|
FE-010-A:
|
|
titulo: "Tenant Settings Page (inicio)"
|
|
sp: 3
|
|
archivos_a_crear:
|
|
- frontend/src/pages/settings/TenantSettingsPage.tsx (estructura base)
|
|
- frontend/src/features/settings/components/BrandingForm.tsx
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-008]
|
|
```
|
|
|
|
#### Resumen Sprint 3
|
|
|
|
| Capa | Tareas | SP |
|
|
|------|--------|-----|
|
|
| Backend | BE-007, BE-008, BE-009 | 22 |
|
|
| Frontend | FE-007, FE-008, FE-009, FE-010-A | 14 |
|
|
| **TOTAL** | **7 tareas** | **36 SP** |
|
|
|
|
---
|
|
|
|
### 3.4 SPRINT 4: 2FA + Settings Completion
|
|
|
|
**Duracion:** 2 semanas
|
|
**Story Points:** 31 SP
|
|
**Objetivo:** Implementar 2FA, completar settings, tests frontend
|
|
|
|
#### Backend (12 SP)
|
|
|
|
```yaml
|
|
BE-010:
|
|
titulo: "2FA/MFA Implementation"
|
|
sp: 8
|
|
archivos_a_crear:
|
|
- backend/src/modules/auth/services/mfa.service.ts
|
|
- backend/src/modules/auth/services/totp.service.ts
|
|
- backend/src/modules/auth/__tests__/mfa.service.spec.ts
|
|
archivos_a_modificar:
|
|
- backend/src/modules/auth/auth.routes.ts
|
|
- backend/src/modules/auth/auth.controller.ts
|
|
endpoints:
|
|
- POST /auth/mfa/setup (genera QR)
|
|
- POST /auth/mfa/verify (verifica codigo)
|
|
- POST /auth/mfa/disable
|
|
- GET /auth/mfa/backup-codes
|
|
- POST /auth/mfa/regenerate-backup
|
|
funcionalidades:
|
|
- TOTP (Google Authenticator compatible)
|
|
- Backup codes (10 codes de un solo uso)
|
|
- Recovery flow
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: []
|
|
|
|
BE-011:
|
|
titulo: "Email Verification Flow"
|
|
sp: 4
|
|
archivos_a_crear:
|
|
- backend/src/modules/auth/services/email-verification.service.ts
|
|
- backend/src/shared/services/email.service.ts
|
|
archivos_a_modificar:
|
|
- backend/src/modules/auth/auth.routes.ts
|
|
endpoints:
|
|
- POST /auth/verify-email/send
|
|
- GET /auth/verify-email/:token
|
|
- POST /auth/verify-email/resend
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
dependencias: []
|
|
```
|
|
|
|
#### Frontend (19 SP)
|
|
|
|
```yaml
|
|
FE-010-B:
|
|
titulo: "Tenant Settings Page (completar)"
|
|
sp: 2
|
|
archivos_a_crear:
|
|
- frontend/src/features/settings/components/LocalizationForm.tsx
|
|
- frontend/src/features/settings/components/FeaturesForm.tsx
|
|
archivos_a_modificar:
|
|
- frontend/src/pages/settings/TenantSettingsPage.tsx
|
|
secciones:
|
|
- Localization (language, timezone, dateFormat)
|
|
- Features enabled (checkboxes)
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-010-A]
|
|
|
|
FE-011:
|
|
titulo: "User Preferences Page"
|
|
sp: 5
|
|
archivos_a_crear:
|
|
- frontend/src/pages/settings/UserPreferencesPage.tsx
|
|
- frontend/src/features/settings/components/ThemePreferencesForm.tsx
|
|
- frontend/src/features/settings/components/LanguagePreferencesForm.tsx
|
|
- frontend/src/features/settings/components/NotificationPreferencesForm.tsx
|
|
secciones:
|
|
- Theme (light/dark/system)
|
|
- Language
|
|
- Notifications (email, push, in-app)
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-008]
|
|
|
|
FE-012:
|
|
titulo: "Feature Flags Management"
|
|
sp: 5
|
|
archivos_a_crear:
|
|
- frontend/src/pages/settings/FeatureFlagsPage.tsx
|
|
- frontend/src/features/settings/components/FeatureFlagToggle.tsx
|
|
- frontend/src/features/settings/components/FeatureFlagList.tsx
|
|
funcionalidades:
|
|
- Lista de feature flags
|
|
- Toggle por tenant
|
|
- Descripcion de cada flag
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: [FE-008]
|
|
|
|
FE-013:
|
|
titulo: "Settings Stores (Zustand)"
|
|
sp: 3
|
|
archivos_a_crear:
|
|
- frontend/src/shared/stores/useSettingsStore.ts
|
|
- frontend/src/shared/stores/useFeatureFlagsStore.ts
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: []
|
|
|
|
FE-014:
|
|
titulo: "Theme Selector Component"
|
|
sp: 3
|
|
archivos_a_crear:
|
|
- frontend/src/shared/components/organisms/ThemeSelector.tsx
|
|
archivos_a_modificar:
|
|
- frontend/src/shared/stores/useUIStore.ts
|
|
funcionalidades:
|
|
- Light/Dark/System toggle
|
|
- Persistent en localStorage
|
|
- Aplica clases Tailwind (dark:)
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: []
|
|
|
|
FE-015:
|
|
titulo: "Frontend Tests Config"
|
|
sp: 1
|
|
estado: AJUSTADO (antes 3 SP)
|
|
descripcion: |
|
|
Vitest ya instalado. Solo verificar/ajustar config.
|
|
archivos_existentes:
|
|
- frontend/package.json (vitest: ^2.1.5)
|
|
archivos_a_verificar:
|
|
- frontend/vitest.config.ts
|
|
- frontend/tests/setup.ts
|
|
perfil: PERFIL-FRONTEND.md
|
|
dependencias: []
|
|
```
|
|
|
|
#### Resumen Sprint 4
|
|
|
|
| Capa | Tareas | SP |
|
|
|------|--------|-----|
|
|
| Backend | BE-010, BE-011 | 12 |
|
|
| Frontend | FE-010-B, FE-011, FE-012, FE-013, FE-014, FE-015 | 19 |
|
|
| **TOTAL** | **8 tareas** | **31 SP** |
|
|
|
|
---
|
|
|
|
## 4. GRAFO DE DEPENDENCIAS ACTUALIZADO
|
|
|
|
```mermaid
|
|
graph TD
|
|
subgraph Sprint1["SPRINT 1 (22 SP)"]
|
|
DB002[DB-002: RLS Validation]
|
|
BE001[BE-001: Jest Setup]
|
|
BE002[BE-002: Auth Tests]
|
|
FE001[FE-001: Catalogs Structure]
|
|
FE002[FE-002: Countries Pages]
|
|
|
|
BE001 --> BE002
|
|
FE001 --> FE002
|
|
end
|
|
|
|
subgraph Sprint2["SPRINT 2 (37 SP)"]
|
|
BE003[BE-003: Users Tests]
|
|
BE004[BE-004: Roles Tests]
|
|
BE005[BE-005: Tenants Tests]
|
|
BE006[BE-006: Permission Cache]
|
|
FE003[FE-003: Currencies]
|
|
FE004[FE-004: UoM]
|
|
FE005[FE-005: Categories]
|
|
FE006[FE-006: Routes]
|
|
|
|
BE001 --> BE003
|
|
BE001 --> BE004
|
|
BE001 --> BE005
|
|
FE001 --> FE003
|
|
FE001 --> FE004
|
|
FE001 --> FE005
|
|
FE002 --> FE006
|
|
FE003 --> FE006
|
|
FE004 --> FE006
|
|
FE005 --> FE006
|
|
end
|
|
|
|
subgraph Sprint3["SPRINT 3 (36 SP)"]
|
|
BE007[BE-007: Financial Tests]
|
|
BE008[BE-008: Inventory Tests]
|
|
BE009[BE-009: OAuth]
|
|
FE007[FE-007: Catalog Stores]
|
|
FE008[FE-008: Settings Structure]
|
|
FE009[FE-009: System Settings]
|
|
FE010A[FE-010-A: Tenant Settings inicio]
|
|
|
|
BE001 --> BE007
|
|
BE001 --> BE008
|
|
FE008 --> FE009
|
|
FE008 --> FE010A
|
|
end
|
|
|
|
subgraph Sprint4["SPRINT 4 (31 SP)"]
|
|
BE010[BE-010: 2FA/MFA]
|
|
BE011[BE-011: Email Verification]
|
|
FE010B[FE-010-B: Tenant Settings completar]
|
|
FE011[FE-011: User Preferences]
|
|
FE012[FE-012: Feature Flags]
|
|
FE013[FE-013: Settings Stores]
|
|
FE014[FE-014: Theme Selector]
|
|
FE015[FE-015: Frontend Tests]
|
|
|
|
BE009 --> BE010
|
|
BE010 --> BE011
|
|
FE010A --> FE010B
|
|
FE008 --> FE011
|
|
FE008 --> FE012
|
|
end
|
|
|
|
%% Cross-sprint dependencies
|
|
DB002 -.-> BE005
|
|
BE002 -.-> FE001
|
|
```
|
|
|
|
---
|
|
|
|
## 5. PERFILES DE AGENTES REQUERIDOS
|
|
|
|
```yaml
|
|
sprint_1:
|
|
database_agent:
|
|
perfil: PERFIL-DATABASE.md
|
|
tareas: [DB-002]
|
|
sp: 2
|
|
|
|
backend_agent:
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
tareas: [BE-001, BE-002]
|
|
sp: 10
|
|
|
|
frontend_agent:
|
|
perfil: PERFIL-FRONTEND.md
|
|
tareas: [FE-001, FE-002]
|
|
sp: 10
|
|
|
|
sprint_2:
|
|
backend_agent:
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
tareas: [BE-003, BE-004, BE-005, BE-006]
|
|
sp: 17
|
|
|
|
frontend_agent:
|
|
perfil: PERFIL-FRONTEND.md
|
|
tareas: [FE-003, FE-004, FE-005, FE-006]
|
|
sp: 20
|
|
|
|
sprint_3:
|
|
backend_agent:
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
tareas: [BE-007, BE-008, BE-009]
|
|
sp: 22
|
|
|
|
frontend_agent:
|
|
perfil: PERFIL-FRONTEND.md
|
|
tareas: [FE-007, FE-008, FE-009, FE-010-A]
|
|
sp: 14
|
|
|
|
sprint_4:
|
|
backend_agent:
|
|
perfil: PERFIL-BACKEND-EXPRESS.md
|
|
tareas: [BE-010, BE-011]
|
|
sp: 12
|
|
|
|
frontend_agent:
|
|
perfil: PERFIL-FRONTEND.md
|
|
tareas: [FE-010-B, FE-011, FE-012, FE-013, FE-014, FE-015]
|
|
sp: 19
|
|
```
|
|
|
|
---
|
|
|
|
## 6. CRITERIOS DE ACEPTACION POR SPRINT
|
|
|
|
### Sprint 1 - Criterios
|
|
|
|
```yaml
|
|
database:
|
|
- [ ] RLS tests ejecutados (psql -f rls-validation.sql)
|
|
- [ ] Todos los tests pasando (0 failures)
|
|
- [ ] Tenant isolation verificado
|
|
- [ ] Reporte de validacion creado
|
|
|
|
backend:
|
|
- [ ] jest.config.js existe y funciona
|
|
- [ ] npm test ejecuta sin errores
|
|
- [ ] Auth tests: >80% cobertura
|
|
- [ ] Todos los tests pasando
|
|
|
|
frontend:
|
|
- [ ] features/catalogs/ estructura completa
|
|
- [ ] Countries CRUD funcional
|
|
- [ ] Paginas renderizando correctamente
|
|
```
|
|
|
|
### Sprint 2 - Criterios
|
|
|
|
```yaml
|
|
backend:
|
|
- [ ] Users tests: >80% cobertura
|
|
- [ ] Roles tests: >80% cobertura
|
|
- [ ] Tenants tests: >80% cobertura
|
|
- [ ] Permission cache: <5ms lookup
|
|
|
|
frontend:
|
|
- [ ] Currencies CRUD funcional
|
|
- [ ] UoM CRUD funcional
|
|
- [ ] Categories tree funcional
|
|
- [ ] Todas las rutas accesibles
|
|
```
|
|
|
|
### Sprint 3 - Criterios
|
|
|
|
```yaml
|
|
backend:
|
|
- [ ] OAuth Google login funcional
|
|
- [ ] OAuth Microsoft login funcional
|
|
- [ ] Financial tests: >60% cobertura
|
|
- [ ] Inventory tests: >60% cobertura
|
|
|
|
frontend:
|
|
- [ ] Settings estructura completa
|
|
- [ ] System settings guardando correctamente
|
|
- [ ] Stores funcionando
|
|
```
|
|
|
|
### Sprint 4 - Criterios
|
|
|
|
```yaml
|
|
backend:
|
|
- [ ] 2FA TOTP funcional (Google Authenticator)
|
|
- [ ] Backup codes generando
|
|
- [ ] Email verification enviando
|
|
- [ ] Recovery flow funcional
|
|
|
|
frontend:
|
|
- [ ] Settings module 100% completo
|
|
- [ ] Theme selector funcionando
|
|
- [ ] Feature flags toggle funcionando
|
|
- [ ] Vitest config verificado
|
|
```
|
|
|
|
---
|
|
|
|
## 7. RIESGOS Y MITIGACIONES
|
|
|
|
| Riesgo | Probabilidad | Impacto | Estado | Mitigacion |
|
|
|--------|-------------|---------|--------|------------|
|
|
| Jest setup complejo | BAJA | Medio | MITIGADO | Ya instalado |
|
|
| HR Schema faltante | ELIMINADO | - | CERRADO | Ya existe |
|
|
| Redis no disponible | BAJA | Bajo | MITIGADO | Config con fallback |
|
|
| OAuth API changes | BAJA | Medio | PENDIENTE | Usar SDKs oficiales |
|
|
| RLS performance | MEDIA | Alto | PENDIENTE | Ejecutar tests en Sprint 1 |
|
|
| Frontend scope creep | ALTA | Medio | ACTIVO | Seguir specs existentes |
|
|
|
|
---
|
|
|
|
## 8. RESUMEN FINAL
|
|
|
|
### Metricas del Plan Ajustado
|
|
|
|
| Metrica | Valor |
|
|
|---------|-------|
|
|
| Total Story Points | 126 SP |
|
|
| Sprints | 4 |
|
|
| Tareas totales | 28 |
|
|
| Tareas eliminadas | 4 (16 SP) |
|
|
| Tareas reducidas | 4 (10 SP) |
|
|
| Reduccion total | 26 SP (17%) |
|
|
|
|
### Distribucion por Capa
|
|
|
|
| Capa | SP | % del Total |
|
|
|------|-----|-------------|
|
|
| Database | 2 | 2% |
|
|
| Backend | 61 | 48% |
|
|
| Frontend | 63 | 50% |
|
|
| **TOTAL** | **126** | **100%** |
|
|
|
|
---
|
|
|
|
**Documento generado por:** ORQUESTADOR (Claude Code Opus 4.5)
|
|
**Sistema:** SIMCO + CAPVED
|
|
**Fase actual:** P (Planeacion) - COMPLETADA
|
|
**Proxima fase:** V (Validacion de Planeacion)
|