|
| 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)** |
0 commit comments