Skip to content

Commit 522eddd

Browse files
committed
docs: implement DDD design construction portal and add detailed domain model documentation for all system contexts.
1 parent 0e52636 commit 522eddd

23 files changed

Lines changed: 2156 additions & 2 deletions

README.es.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ npm install; npx nx run app-web:dev
4040
| **Entrega del Proyecto** | [Backlog del Proyecto](./docs/governance/project-es/index.md) | Épicas MVP, historias de usuario y diseño funcional de módulos core. |
4141
| **Requerimientos** | [Índice de Requerimientos](./docs/governance/requirements-es/index.md) | Historias funcionales, glosario de negocio y modelo de datos conceptual. |
4242
| **Arquitectura** | [Portal de Arquitectura](./docs/architecture/index.es.md) | Diseño ER de base de datos, mapas de entidades y visores interactivos. |
43+
| **Construccion** | [Portal de Construccion](./docs/governance/construction/index.md) | Diseño DDD de la capa de dominio (bounded contexts, agregados, eventos, comandos). |
4344

4445
---
4546

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ npm install; npx nx run app-web:dev
4040
| **Project Delivery** | [Project Backlog](./docs/governance/project/index.md) | MVP epics, user stories, and functional design of core modules. |
4141
| **Requirements** | [Requirements Index](./docs/governance/requirements/index.md) | Functional stories, business glossary, and conceptual data model. |
4242
| **Architecture** | [Architecture Portal](./docs/architecture/index.md) | Database ER design, entity maps, and interactive viewers. |
43+
| **Construction** | [Construction Portal](./docs/governance/construction/index.md) | DDD domain layer design (bounded contexts, aggregates, events, commands). |
4344

4445
---
4546

docs/MASTER_INDEX.es.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,21 @@ Especificaciones de Ingeniería y Ciclo de Vida del Producto para el User Manage
3434
- [Diseño de Base de Datos ER](./architecture/blueprints-es/database-design-er.md)
3535
- [Formatos de Exportación ER](./architecture/blueprints-es/er-export-formats.md)
3636
- [Portal de Arquitectura](./architecture/index.es.md)
37+
38+
### Fase 04 -- Construccion y Diseño de Dominio
39+
40+
- [Portal de Construccion](./governance/construction/index.md)
41+
- [Portal DDD](./governance/construction/ddd-design/index.md)
42+
- [Mapa de Bounded Contexts](./governance/construction/ddd-design/01-bounded-context-map.md)
43+
- [Lenguaje Ubicuo](./governance/construction/ddd-design/02-ubiquitous-language.md)
44+
- [Contexto Identity](./governance/construction/ddd-design/03-identity-context.md)
45+
- [Contexto Authorization](./governance/construction/ddd-design/04-authorization-context.md)
46+
- [Contexto Configuration](./governance/construction/ddd-design/05-configuration-context.md)
47+
- [Contexto Audit](./governance/construction/ddd-design/06-audit-context.md)
48+
- [Contexto Approvals](./governance/construction/ddd-design/07-approvals-context.md)
49+
- [Contexto IGA](./governance/construction/ddd-design/08-iga-context.md)
50+
- [Contexto Compliance](./governance/construction/ddd-design/09-compliance-context.md)
51+
- [Flujos Cross-Contexto](./governance/construction/ddd-design/10-cross-context-flows.md)
52+
- [Primitivas DDD](./governance/construction/ddd-design/11-ddd-primitives.md)
53+
- [Decisiones de Diseno y Vacios](./governance/construction/ddd-design/12-design-decisions.md)
54+
- [Viewer Interactivo DDD](./governance/construction/ddd-design/interactive-ddd-viewer.html)

docs/MASTER_INDEX.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,21 @@ Product Lifecycle and Engineering Specifications for the User Management System
3636
- [Interactive ER Viewer](./architecture/blueprints/interactive-er-viewer.html)
3737
- [Service Entity Map](./architecture/blueprints/service-entity-map.md)
3838
- [Architecture Portal](./architecture/index.md)
39+
40+
### Phase 04 -- Construction & Domain Design
41+
42+
- [Construction Portal](./governance/construction/index.md)
43+
- [DDD Design Portal](./governance/construction/ddd-design/index.md)
44+
- [Bounded Context Map](./governance/construction/ddd-design/01-bounded-context-map.md)
45+
- [Ubiquitous Language](./governance/construction/ddd-design/02-ubiquitous-language.md)
46+
- [Identity Context](./governance/construction/ddd-design/03-identity-context.md)
47+
- [Authorization Context](./governance/construction/ddd-design/04-authorization-context.md)
48+
- [Configuration Context](./governance/construction/ddd-design/05-configuration-context.md)
49+
- [Audit Context](./governance/construction/ddd-design/06-audit-context.md)
50+
- [Approvals Context](./governance/construction/ddd-design/07-approvals-context.md)
51+
- [IGA Context](./governance/construction/ddd-design/08-iga-context.md)
52+
- [Compliance Context](./governance/construction/ddd-design/09-compliance-context.md)
53+
- [Cross-Context Flows](./governance/construction/ddd-design/10-cross-context-flows.md)
54+
- [DDD Primitives](./governance/construction/ddd-design/11-ddd-primitives.md)
55+
- [Design Decisions & Gaps](./governance/construction/ddd-design/12-design-decisions.md)
56+
- [Interactive DDD Viewer](./governance/construction/ddd-design/interactive-ddd-viewer.html)

docs/architecture/index.es.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Planos detallados de ingeniería centrados en:
1111
- **[Diseño de Base de Datos ER](./blueprints-es/database-design-er.md)**: El modelo entidad-relación de referencia.
1212
- **[Formatos de Exportación ER](./blueprints-es/er-export-formats.md)**: Exportaciones SQL, Mermaid e imágenes del esquema.
1313

14+
### Relacionado — Diseño de Capa de Dominio
15+
- **[Portal DDD](../governance/construction/ddd-design/index.md)**: Bounded contexts, agregados, value objects, comandos, eventos y maquinas de estado para el producto completo.
16+
- **[Viewer Interactivo DDD](../governance/construction/ddd-design/interactive-ddd-viewer.html)**: Herramienta en el navegador para explorar el mapa de contextos, maquinas de estado y flujos cross-contexto.
17+
1418
---
1519

1620
**[Volver al Índice Maestro](../MASTER_INDEX.es.md)** | **[Volver al README Raíz](../../README.es.md)**

docs/architecture/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Detailed engineering blueprints focusing on:
1313
- **[Interactive ER Viewer](./blueprints/interactive-er-viewer.html)**: Browser-based tool to explore the database structure.
1414
- **[Service Entity Map](./blueprints/service-entity-map.md)**: Logical mapping between system services and database entities.
1515

16+
### Related — Domain Layer Design
17+
- **[DDD Design Portal](../governance/construction/ddd-design/index.md)**: Bounded contexts, aggregates, value objects, commands, events, and state machines for the complete product.
18+
- **[Interactive DDD Viewer](../governance/construction/ddd-design/interactive-ddd-viewer.html)**: Browser-based tool to explore bounded context map, state machines, and cross-context flows.
19+
1620
---
1721

1822
**[Back to Master Index](../MASTER_INDEX.md)** | **[Back to Root README](../../README.md)**
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Bounded Context Map
2+
3+
**Tipo:** DDD — Mapa de Contextos
4+
**Version:** 2.0 | **Fecha:** 2026-05-15 | **Estado:** Propuesto
5+
**Alcance:** Producto completo — FS-01 a FS-16
6+
7+
> **Visualizacion interactiva:** [interactive-ddd-viewer.html](./interactive-ddd-viewer.html) — seccion "Bounded Context Map"
8+
9+
---
10+
11+
## Diagrama de Contextos
12+
13+
<details>
14+
<summary>Ver codigo Mermaid (referencia)</summary>
15+
16+
```mermaid
17+
graph TD
18+
subgraph Core["Nucleo del Producto"]
19+
A["BC-A: Identity\nums_identity\n.NET 8"]
20+
B["BC-B: Authorization\nums_authz\n.NET 8"]
21+
end
22+
23+
subgraph Supporting["Soporte Operacional"]
24+
C["BC-C: Configuration\nums_config\n.NET 8"]
25+
F["BC-F: Approvals\nums_approval\n.NET 8"]
26+
H["BC-H: IGA\nums_iga\n.NET 8"]
27+
I["BC-I: Compliance\nums_compliance\n.NET 8"]
28+
end
29+
30+
subgraph Generic["Genericos"]
31+
D["BC-D: Audit\nums_audit\n.NET 8"]
32+
G["BC-G: Cache\nRedis\nInfrastructura"]
33+
E["BC-E: Console PAP\nReact SPA\nSin entidades propias"]
34+
end
35+
36+
A -->|"Customer-Supplier\nUser + Org + Branch claims"| B
37+
A -->|"Customer-Supplier\nTenant scope keys"| C
38+
A -->|"Customer-Supplier\nUserRegisteredEvent"| F
39+
A -->|"Customer-Supplier\nUserRegisteredEvent"| H
40+
A -->|"Customer-Supplier\nUserRegisteredEvent"| I
41+
A -->|"Conformist\nevents"| D
42+
43+
C -->|"Customer-Supplier\nIdP config al gateway"| A
44+
B -->|"Read-Aside\nauth_graph cache"| G
45+
C -->|"Read-Aside\ncfg + flags cache"| G
46+
B -->|"Conformist\nevents"| D
47+
C -->|"Conformist\nevents"| D
48+
49+
H -->|"Customer-Supplier\nPromotionApprovedEvent"| B
50+
H -->|"Customer-Supplier\npromocion requiere workflow"| F
51+
H -->|"Conformist\nevents"| D
52+
53+
I -->|"Customer-Supplier\nDocumentExpiredEvent BLOCK"| A
54+
I -->|"Customer-Supplier\nvalidacion doc"| F
55+
I -->|"Conformist\nevents"| D
56+
57+
F -->|"Customer-Supplier\nprovisioning B2B"| A
58+
F -->|"Customer-Supplier\nasignacion Profile post-aprobacion"| B
59+
F -->|"Conformist\nevents"| D
60+
61+
E -->|"Customer-Supplier\nREST APIs"| A
62+
E -->|"Customer-Supplier\nREST APIs"| B
63+
E -->|"Customer-Supplier\nREST APIs"| C
64+
E -->|"Customer-Supplier\nREST APIs"| F
65+
```
66+
67+
</details>
68+
69+
---
70+
71+
## Catalogo de Contextos
72+
73+
| Codigo | Nombre | Schema SQL | Clasificacion | FS |
74+
|--------|--------|-----------|---------------|-----|
75+
| BC-A | Identity | `ums_identity` | Core | FS-01, FS-03, FS-08, FS-09 |
76+
| BC-B | Authorization | `ums_authz` | Core | FS-02, FS-04, FS-05, FS-06, FS-07 |
77+
| BC-C | Configuration | `ums_config` | Supporting | FS-08, FS-09, FS-13 |
78+
| BC-D | Audit | `ums_audit` | Generic | Todos |
79+
| BC-E | Console PAP | React SPA | Generic | Todos (UI) |
80+
| BC-F | Approvals | `ums_approval` | Supporting | FS-10, FS-11, FS-12 |
81+
| BC-G | Cache | Redis | Generic | BC-B, BC-C |
82+
| BC-H | IGA | `ums_iga` | Supporting | FS-12, FS-14 |
83+
| BC-I | Compliance | `ums_compliance` | Supporting | FS-11, FS-15, FS-16 |
84+
85+
---
86+
87+
## Tabla de Relaciones
88+
89+
| Upstream | Downstream | Patron | Contrato |
90+
|----------|-----------|--------|----------|
91+
| Identity | Authorization | Customer-Supplier | User/Org/Branch claims via eventos o API |
92+
| Identity | Configuration | Customer-Supplier | Tenant scope keys para aislamiento de config |
93+
| Identity | Approvals | Customer-Supplier | Registro de usuario externo desencadena workflow |
94+
| Identity | IGA | Customer-Supplier | `UserRegisteredEvent` para inicializar tracking |
95+
| Identity | Compliance | Customer-Supplier | `UserRegisteredEvent` para inicializar documentos |
96+
| Configuration | Identity | Customer-Supplier | IdP config provista al Auth Gateway para routing |
97+
| Authorization | Cache | Shared Kernel `ICachePort` | Read-aside; invalidacion en mutaciones |
98+
| Configuration | Cache | Shared Kernel `IConfigCachePort` | Read-aside cfg + flags; TTL 60-900s |
99+
| IGA | Authorization | Customer-Supplier | `PromotionApprovedEvent` actualiza Profile |
100+
| IGA | Approvals | Customer-Supplier | Promocion requiere ApprovalRequest |
101+
| Compliance | Identity | Customer-Supplier | `DocumentExpiredEvent` ejecuta BLOCK_ACCESS |
102+
| Compliance | Approvals | Customer-Supplier | Validacion documental abre workflow |
103+
| Approvals | Identity | Customer-Supplier | `ApprovalResolvedEvent` activa UserAccount (ONBOARDING) |
104+
| Approvals | Authorization | Customer-Supplier | `ApprovalResolvedEvent` asigna Profile (PROFILE_ASSIGNMENT) |
105+
| Todos | Audit | Conformist | Eventos inmutables appendeados al ledger |
106+
| Console | Todos | Customer-Supplier | REST versionado; tratado como consumidor externo |
107+
108+
---
109+
110+
## Anti-Corruption Layers
111+
112+
| Frontera | Mecanismo | Motivo |
113+
|---------|-----------|--------|
114+
| Authorization — IdP externo | `IAuthenticationPort` Strategy Pattern | Evita acoplamiento con SDK de Zitadel/Okta |
115+
| Configuration — Feature Flag Providers | `IFeatureFlagPort` Strategy Pattern | Evita LaunchDarkly/Unleash en dominio |
116+
| Configuration — Secret Vault | `ISecretStorePort` Strategy Pattern | Evita AWS Secrets Manager / HashiCorp en dominio |
117+
| Authorization — Redis | `ICachePort` | Evita cliente Redis en capa de dominio |
118+
| Configuration — Redis | `IConfigCachePort` | Namespace separado de auth_graph |
119+
| Compliance — Notificaciones | `INotificationPort` Strategy Pattern | Evita SDK SMTP/Twilio en dominio |
120+
| Compliance — Almacenamiento | `IDocumentStoragePort` Strategy Pattern | Evita SDK MinIO/S3 en dominio |
121+
| Authorization — Event Bus | `IEventBusPort` | Evita Kafka/RabbitMQ en use cases |
122+
123+
---
124+
125+
**[Indice DDD](./index.md)** | **[Siguiente: Lenguaje Ubicuo](./02-ubiquitous-language.md)**
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Lenguaje Ubicuo
2+
3+
**Tipo:** DDD — Ubiquitous Language
4+
**Version:** 2.0 | **Fecha:** 2026-05-15 | **Estado:** Propuesto
5+
**Alcance:** Producto completo — FS-01 a FS-16
6+
7+
Terminos canonicos que todos los artefactos de codigo, documentacion y conversacion deben respetar. Cualquier termino fuera de esta tabla debe ser propuesto y aprobado antes de usarse en el codigo.
8+
9+
---
10+
11+
## Glosario de Dominio
12+
13+
| Termino de Negocio | Clase de Dominio | Contexto | FS |
14+
|-------------------|-----------------|----------|----|
15+
| Organizacion / Tenant | `Tenant` | Identity | FS-03 |
16+
| Sede | `Branch` | Identity | FS-03 |
17+
| Usuario | `UserAccount` | Identity | FS-01, FS-03, FS-09, FS-10 |
18+
| Sistema / Aplicacion | `SystemSuite` | Authorization | FS-04 |
19+
| Modulo | `FunctionalModule` | Authorization | FS-04 |
20+
| Menu (submodulo) | `FunctionalSubmodule` | Authorization | FS-04 |
21+
| Opcion | `FunctionalOption` | Authorization | FS-04 |
22+
| Accion | `Action` | Authorization | FS-02, FS-04 |
23+
| Rol | `Role` | Authorization | FS-02, FS-05 |
24+
| Plantilla de Autorizacion | `PermissionTemplate` | Authorization | FS-02, FS-05, FS-06 |
25+
| Perfil | `Profile` | Authorization | FS-05, FS-06, FS-07 |
26+
| Permiso Efectivo | `ProfilePermission` | Authorization | FS-05, FS-07 |
27+
| Regla de Asignacion Auto | `TemplateAssignmentRule` | Authorization | FS-06 |
28+
| Grafo de Autorizacion | `CompiledPolicyGraph` (runtime VO) | Authorization | FS-07 |
29+
| Config de Proveedor de Identidad | `IdpConfiguration` | Configuration | FS-01, FS-03, FS-08 |
30+
| Parametro de Configuracion | `AppConfiguration` | Configuration | FS-08, FS-13 |
31+
| Indicador de Funcionalidad | `FeatureFlag` | Configuration | FS-08, FS-13 |
32+
| Solicitud de Aprobacion | `ApprovalRequest` | Approvals | FS-10, FS-12 |
33+
| Flujo de Aprobacion | `ApprovalWorkflow` | Approvals | FS-10, FS-12 |
34+
| Proceso de Promocion | `UserPromotionProcess` | IGA | FS-12 |
35+
| Criterio de Promocion | `RolePromotionCriteria` | IGA | FS-12 |
36+
| Delegacion de Administracion | `UserManagementDelegation` | IGA | FS-14 |
37+
| Documento del Usuario | `UserDocument` | Compliance | FS-11, FS-15, FS-16 |
38+
| Tipo de Documento | `DocumentType` | Compliance | FS-11, FS-15, FS-16 |
39+
| Regla de Notificacion | `NotificationRule` | Compliance | FS-15 |
40+
| Politica de Enforcement | `AccessEnforcementPolicy` | Compliance | FS-16 |
41+
42+
---
43+
44+
## Estados Canonicos por Agregado
45+
46+
| Agregado | Estados |
47+
|---------|---------|
48+
| `UserAccount` | `PENDING` / `ACTIVE` / `BLOCKED` |
49+
| `PermissionTemplate` | `DRAFT` / `PUBLISHED` / `DEPRECATED` |
50+
| `AppConfiguration` | `DRAFT` / `PUBLISHED` / `ARCHIVED` |
51+
| `ApprovalRequest` | `PENDING` / `APPROVED` / `REJECTED` / `CANCELLED` / `EXPIRED` |
52+
| `UserPromotionProcess` | `EVALUATING` / `CRITERIA_MET` / `PENDING_APPROVAL` / `PROMOTED` |
53+
| `UserDocument` | `PENDING_REVIEW` / `VALID` / `EXPIRED` / `REJECTED` |
54+
| `Tenant` | `ACTIVE` / `SUSPENDED` / `ARCHIVED` |
55+
| `SystemSuite` | `DRAFT` / `PUBLISHED` / `RETIRED` |
56+
| `IdpConfiguration` | `DRAFT` / `ACTIVE` / `INACTIVE` |
57+
| `UserManagementDelegation` | `ACTIVE` / `REVOKED` / `EXPIRED` |
58+
59+
---
60+
61+
**[Anterior: Bounded Context Map](./01-bounded-context-map.md)** | **[Indice DDD](./index.md)** | **[Siguiente: Identity Context](./03-identity-context.md)**

0 commit comments

Comments
 (0)