9.8 KiB
9.8 KiB
Live E2E Demonstration & Role Showcase Guide
Variable Remuneration, Compensation, and Commissions System - Hoteles Estelar
This guide outlines a comprehensive step-by-step E2E script for presenters. It showcases the application's role-based permissions, database Row-Level Security (RLS) isolation, multilingual language switcher, and n8n background workflow triggers.
1. System Role Permissions Matrix
The platform is designed with a strict Role-Based Access Control (RBAC) layer mapped to the following permissions:
| User Role | Navigation Access | Can Manage Plans? | Can Assign Goals? | Can Ingest Sales? | Can Run Settlement? | Can Approve/Reject? | Can View Audit Logs? |
|---|---|---|---|---|---|---|---|
admin |
All tabs | Yes | Yes | Yes | Yes | Yes (Override) | Yes (diff panel) |
director |
Plans, Goals, Dashboard | Yes | Yes | No | No | No | No (403 Blocked) |
analyst |
Plans, Ingest, Calc, Dash | No | No | Yes | Yes | No | No (403 Blocked) |
commercial_leader |
Plans, Ingest, Approvals | No | No | Yes | No | Yes (Regional) | No (403 Blocked) |
hotel_manager |
Plans, Goals, Approvals | No | No | No | No | Yes (Regional) | No (403 Blocked) |
auditor |
Plans, Goals (Read-only) | No | No | No | No | No | No (403 Blocked) |
collaborator |
History (Personal only) | No | No | No | No | No | No (403 Blocked) |
2. Seeded Accounts & Credentials
Use these pre-configured accounts (all passwords are set to password123) to showcase different user views:
- System Admin (
admin):- Username:
admin - Email:
admin@estelar.com - Hotel Scope:
Estelar Parque de la 93(Global View) - Role:
admin
- Username:
- Planner / Executive View (
director):- Username:
director - Email:
director@estelar.com - Hotel Scope:
Estelar Parque de la 93(Global view for planning) - Role:
director
- Username:
- Finance Operations View (
analista):- Username:
analista - Email:
analista@estelar.com - Hotel Scope:
Estelar Parque de la 93 - Role:
analyst
- Username:
- Hotel Managers (Regional Isolation):
- Medellin Manager:
- Username:
gerente_mde - Email:
gerente.mde@estelar.com - Hotel:
Estelar Medellin(EST-MDE) - Role:
hotel_manager
- Username:
- Cartagena Manager:
- Username:
gerente_ctg - Email:
gerente.ctg@estelar.com - Hotel:
Estelar Cartagena(EST-CTG) - Role:
hotel_manager
- Username:
- Medellin Manager:
- Commercial Leaders (Regional Isolation):
- Medellin Leader:
- Username:
lider_mde - Email:
lider.mde@estelar.com - Hotel:
Estelar Medellin(EST-MDE) - Role:
commercial_leader
- Username:
- Cartagena Leader:
- Username:
lider_ctg - Email:
lider.ctg@estelar.com - Hotel:
Estelar Cartagena(EST-CTG) - Role:
commercial_leader
- Username:
- Medellin Leader:
- Collaborators / Sellers (Personal Isolation):
- Medellin Collaborator:
- Username:
colaborador_mde - Email:
colaborador.mde@estelar.com - Hotel:
Estelar Medellin(EST-MDE) - Role:
collaborator
- Username:
- Cartagena Collaborator:
- Username:
colaborador_ctg - Email:
colaborador.ctg@estelar.com - Hotel:
Estelar Cartagena(EST-CTG) - Role:
collaborator
- Username:
- Medellin Collaborator:
- Auditor / Guest (
consulta):- Username:
consulta - Email:
consulta@estelar.com - Role:
auditor
- Username:
3. Step-by-Step E2E Demo Walkthrough Script
Step 1: Manage Compensation Plans & Rules
- Objective: Show how plans are created, configured, and automatically version-controlled when active.
- Action:
- Login as
director(Planner view). - Navigate to Commission Plans (Planes de Comisión).
- Click Nuevo Plan, enter details (e.g. Plan name, code, type), and click Guardar Plan.
- Find the plan, click Configurar Reglas, add a tier (e.g. 0% to 120% achievement = 2% commission rate), and save.
- Click Activar on the plan. Notice status changes to
ACTIVE(Activo). - Click Inactivar (Versión) to edit the active plan. Notice that the system preserves the original plan version 1 history and automatically clones a new version record (
Version: 2) in draft mode! This showcases strict version auditing.
- Login as
Step 2: Assign Quotas and Goals
- Objective: Define sales targets for sellers.
- Action:
- Still logged in as
director, navigate to Commercial Goals (Metas Comerciales). - Select target type
INDIVIDUAL, pickcolaborador_mde, enter period2026-06, set the target amount to100000, and click Guardar Meta.
- Still logged in as
Step 3: Excel Sales File Ingestion (US-COM-004)
- Objective: Showcase header validations, duplicate upload block (idempotency checks), and file upload features.
- Action:
- Logout, then login as
analista(Finance Operations). - Navigate to Ingest Sales (Cargar Ventas).
- Drag and drop the generated demo spreadsheet: demo_sales_data.xlsx into the loading box, or select it manually.
- Notice the upload progress screen. Once n8n finishes background parsing, the status turns green:
Carga exitosa. - Attempt to drag-and-drop the same file again. The system immediately alerts:
Error: Llave de idempotencia duplicada. Este lote ya ha sido procesado.showing protection against double-payments.
- Logout, then login as
Step 4: Run Settlement Calculation & AI Anomaly Detection
- Objective: Trigger the external n8n settlement engine.
- Action:
- Navigate to Simulation (Simulación) as
analista. - Enter Period
2026-06. Uncheck Simulator Mode to commit records to the database. - Click Calculate.
- The page queries n8n. Wait 5-10 seconds. The webhook invokes the calculate-settlement nodes.
- The results table renders:
colaborador_mde: standard commission calculated, audit state marked asAudited.colaborador_ctg: standard commission calculated for the Cartagena region.
- Navigate to Simulation (Simulación) as
Step 5: Row-Level Security Isolation (The Core Tenant Segregation)
- Objective: Showcase that users in the same roles but working in different hotels cannot cross-access data.
- Action:
- Logout, then login as
colaborador_mde(Medellin Collaborator). - Navigate to History (Historial) and Goals (Metas).
- Notice you only see Medellin (
EST-MDE) sales/goals. - Logout, then login as
colaborador_ctg(Cartagena Collaborator). - Navigate to History and Goals. Notice you only see Cartagena (
EST-CTG) sales/goals. Medellin records are completely invisible. - Logout, then login as
gerente_mde(Medellin Manager). - Navigate to Approvals (Aprobaciones). You only see pending settlements for
colaborador_mde(Medellin). - Logout, then login as
gerente_ctg(Cartagena Manager). - Navigate to Approvals. You only see pending settlements for
colaborador_ctg(Cartagena). You cannot see or approve Medellin records. This demonstrates robust multi-hotel security at the database row level.
- Logout, then login as
Step 6: Commercial Approvals (US-COM-008)
- Objective: Perform commercial leader/manager sign-off.
- Action:
- Under
gerente_ctg(Cartagena Manager), click Approve on the settlement. The status changes toAPPROVEDand generates an audit log. - Logout, then login as
gerente_mde(Medellin Manager). Click Reject on the Medellin settlement, and provide a reason:"Falta validar soporte físico". The status transitions toREJECTED.
- Under
Step 7: Localized AI Audit Notes & Language Switcher
- Objective: Showcase collaborator access, localized AI audit notes, and printing stylesheets.
- Action:
- Logout, then login as
colaborador_ctg(Collaborator/Seller). - Navigate to History (Historial).
- Find the approved record for
2026-06, and click Ver Notas under the AI Audit column. - The localized notes panel expands:
Nota de auditoría en Español: Todo correcto.(or warning notes). - Go to the top-right header language dropdown, select EN.
- Instantly, the UI text translates, and the AI audit note updates dynamically:
Audit note in English: All correct. - Click Download PDF (Descargar PDF). Notice that the browser print dialog mounts a clean, page-break optimized stylesheet with no navigation bar, specifically designed for paper filing.
- Logout, then login as
Step 8: Executive Dashboard (US-COM-012)
- Objective: Showcase executive visual trends.
- Action:
- Logout, then login as
directororanalista. - Navigate to Dashboard (Tablero).
- View the premium glassmorphic KPI cards: Total paid commissions, average achievement rate progress circle, and budget utilization bar.
- View the Recharts SVG line-area charts showing the monthly payout trends vs budget caps, and the comparison bar chart comparing Bogota, Medellin, and Cartagena hotels.
- Logout, then login as
Step 9: System Audit Logs & JSON Diff (US-COM-011)
- Objective: Inspect security mutations and redaction details.
- Action:
- Logout, then login as
admin(System Admin). - Navigate to Audit Logs (Auditoría).
- Select any log row. The side-by-side JSON panel displays the exact snapshot of the database fields before and after the action.
- Security audit: Notice that password hashes or base salaries are redacted as
[REDACTED], keeping user credentials private. - If anyone tries to modify or delete logs, database RLS blocks them immediately.
- Logout, then login as
4. Financial Reports Exporting (US-COM-013)
To test consolidations, run these API endpoints directly in your browser:
- Consolidated Excel Sheet:
/api/reports/export/excel?period=2026-06(Downloads a multi-sheet spreadsheet). - Consolidated PDF HTML print view:
/api/reports/export/pdf?period=2026-06(Generates printable tabular views with signature sign-off lines).