ums

Nota de Arquitectura: Este documento se encuentra actualmente en su versión original (Inglés) y estáá programado para traducción oficial en la hoja de ruta.

Conceptual Data Model

This document details the database schema, entity structures, relationships, and Entity-Relationship diagrams for the User Management System (UMS) under the spec-driven AI strategy BMAD-METHOD.


1. Entity-Relationship Diagram

erDiagram
    ORGANIZATION ||--o{ BRANCH : has
    ORGANIZATION ||--o{ ORGANIZATION : parent_hierarchy
    USER ||--o{ EXTERNAL_ACCESS_REQUEST : sponsors
    ORGANIZATION ||--o{ EXTERNAL_ACCESS_REQUEST : targets
    ORGANIZATION ||--o{ USER : contains
    ORGANIZATION ||--o{ PROFILE : owns

    BRANCH ||--o{ PROFILE : scoped_to
    BRANCH ||--o{ USER_PROFILES : restricts

    USER ||--o{ USER_PROFILES : assigned
    PROFILE ||--o{ USER_PROFILES : holds

    PROFILE }o--o| AUTH_TEMPLATE : implements
    PROFILE ||--o{ AUTHORIZATION : declares
    AUTH_TEMPLATE ||--o{ AUTHORIZATION : templates

    SYSTEM ||--o{ MODULE : contains
    MODULE ||--o{ MENU : contains
    MENU ||--o{ OPTION : contains
    OPTION ||--o{ ACTION : contains
    SYSTEM ||--o{ ACTION : declares
    MODULE ||--o{ ACTION : declares
    MENU ||--o{ ACTION : declares

    AUTHORIZATION }o--|| ACTION : targets
    NETWORK ||--o{ PROFILE : restricts

    SYSTEM ||--o{ IDP_CONFIGURATION : uses
    ORGANIZATION ||--o{ IDP_CONFIGURATION : configures
    SYSTEM ||--o{ SYSTEM_CONFIGURATION : has
    ORGANIZATION ||--o{ SYSTEM_CONFIGURATION : scopes
    SYSTEM ||--o{ FEATURE_FLAG : governs
    FEATURE_FLAG ||--o{ FLAG_EVALUATION_LOG : produces

2. Entity Attributes Specification

A. User Entity

B. Entidad Organization (Organización)

[!IMPORTANT] Esta entidad representa un nodo empresarial. Una organización puede ser el Tenant corporativo principal (INTERNAL), o un actor externo como un CLIENT o SUPPLIER B2B.

C. Branch Entity (Sedes)

[!IMPORTANT] This entity represents a physical or logical sub-unit of an Organization (e.g., Callao Port Terminal, Lurin Warehouse). It is the branch context used for hierarchical, context-aware authorization routing.

D. Profile Entity

E. Authorization Entity

F. Auth Template Entity

G. System Entity

H. Module / Menu / Option / Action Entities

[!NOTE] These form the hierarchical navigation topology compiled into the Authorization Graph. The resource hierarchy is: System → Module → Menu → Option. Actions can be attached at any level (System, Module, Menu, or Option).

I. IDP_CONFIGURATION Entity (NEW — Configuration Context)

J. SYSTEM_CONFIGURATION Entity (NEW — Configuration Context)

K. FEATURE_FLAG Entity (NEW — Configuration Context)

L. FLAG_EVALUATION_LOG Entity (NEW — Audit Context)

M. Entidad EXTERNAL_ACCESS_REQUEST (NUEVO — Contexto de Aprobación B2B)


3.1 Estándar Obligatorio de Catálogos Paramétricos

Todas las entidades de parámetros/configuración/catálogos DEBEN incluir como mínimo:

description DEBE documentar claramente:

  1. para qué se usa,
  2. impacto funcional,
  3. comportamiento esperado,
  4. alcance/contexto de configuración aplicable.

Este estándar aplica a parámetros globales, por tenant y por system/suite; feature flags; políticas; configuraciones de seguridad; workflows; reglas de negocio; y configuraciones de notificación/aprobación.

Además, estáas entidades deben definir:


4. Key Precedence Axioms (Engine Rules)

  1. Deny-by-Default: An action is blocked until an explicit ALLOW is declared by a profile or template.
  2. Permissive Union: If no DENY is present, the user inherits all active ALLOW blocks from all assigned profiles.
  3. Explicit Deny Dominance: A DENY from any active profile instantly invalidates matching ALLOW blocks across all other profiles.
  4. Branch Scope Precedence: Branch-scoped profiles override org-wide profiles for the matching branch context.