@fiado/type-kit 3.140.0 → 3.142.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_test_/unit/platformRbac/dtos/CreateTenantRequest.test.ts +6 -5
- package/_test_/unit/platformRbac/enums/__snapshots__/permissionBits.test.ts.snap +1 -73
- package/_test_/unit/platformRbac/tenantTypes.test.ts +5 -40
- package/bin/platformRbac/dtos/CreateTenantRequest.d.ts +5 -4
- package/bin/platformRbac/dtos/CreateTenantRequest.js +1 -2
- package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +22 -0
- package/bin/{walletFunding/dtos/CancelFundingRequest.js → platformRbac/dtos/ResendOtpRequest.js} +16 -13
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
- package/bin/{cognitoBackofficeConnector/dtos/MfaPoolConfig.js → platformRbac/dtos/ResendSelfRegisterOtpRequest.js} +18 -18
- package/bin/platformRbac/enums/Permission.d.ts +0 -77
- package/bin/platformRbac/enums/Permission.js +8 -186
- package/bin/platformRbac/enums/PermissionCategory.d.ts +0 -7
- package/bin/platformRbac/enums/PermissionCategory.js +4 -9
- package/bin/platformRbac/tenantTypes.d.ts +18 -13
- package/bin/platformRbac/tenantTypes.js +20 -30
- package/bin/remittance/dtos/RemittanceAuditLog.d.ts +42 -0
- package/bin/remittance/dtos/RemittanceAuditLog.js +62 -0
- package/bin/remittance/dtos/RemittanceCohort.d.ts +62 -0
- package/bin/remittance/dtos/RemittanceCohort.js +105 -0
- package/bin/remittance/dtos/index.d.ts +2 -0
- package/bin/remittance/dtos/index.js +2 -0
- package/bin/remittance/dtos/internal/RemittanceCohortCount.d.ts +16 -0
- package/bin/remittance/dtos/internal/RemittanceCohortCount.js +34 -0
- package/bin/remittance/enums/AuditAction.d.ts +12 -0
- package/bin/remittance/enums/AuditAction.js +16 -0
- package/bin/remittance/enums/AuditEntityType.d.ts +12 -0
- package/bin/remittance/enums/AuditEntityType.js +16 -0
- package/bin/remittance/enums/CohortField.d.ts +23 -0
- package/bin/remittance/enums/CohortField.js +27 -0
- package/bin/remittance/enums/CohortOperator.d.ts +11 -0
- package/bin/remittance/enums/CohortOperator.js +15 -0
- package/bin/remittance/enums/CohortRefresh.d.ts +9 -0
- package/bin/remittance/enums/CohortRefresh.js +13 -0
- package/bin/remittance/enums/index.d.ts +5 -0
- package/bin/remittance/enums/index.js +5 -0
- package/bin/remittance/index.d.ts +1 -0
- package/bin/remittance/index.js +1 -0
- package/package.json +1 -1
- package/src/platformRbac/dtos/CreateTenantRequest.ts +5 -4
- package/src/platformRbac/enums/Permission.ts +8 -191
- package/src/platformRbac/enums/PermissionCategory.ts +4 -9
- package/src/platformRbac/tenantTypes.ts +21 -32
- package/src/remittance/dtos/RemittanceAuditLog.ts +60 -0
- package/src/remittance/dtos/RemittanceCohort.ts +112 -0
- package/src/remittance/dtos/index.ts +2 -0
- package/src/remittance/dtos/internal/RemittanceCohortCount.ts +24 -0
- package/src/remittance/enums/AuditAction.ts +12 -0
- package/src/remittance/enums/AuditEntityType.ts +12 -0
- package/src/remittance/enums/CohortField.ts +23 -0
- package/src/remittance/enums/CohortOperator.ts +11 -0
- package/src/remittance/enums/CohortRefresh.ts +9 -0
- package/src/remittance/enums/index.ts +5 -0
- package/src/remittance/index.ts +1 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.d.ts +0 -7
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +0 -20
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +0 -11
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +0 -4
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +0 -6
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.d.ts +0 -17
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.js +0 -39
- package/bin/rbac/enums/PoolKind.d.ts +0 -16
- package/bin/rbac/enums/PoolKind.js +0 -20
- package/bin/rbac/index.d.ts +0 -1
- package/bin/rbac/index.js +0 -17
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +0 -5
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.js +0 -31
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +0 -7
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +0 -6
- package/bin/walletFunding/dtos/CancelFundingRequest.d.ts +0 -11
- package/bin/walletFunding/dtos/CancelFundingResponse.d.ts +0 -14
- package/bin/walletFunding/dtos/CancelFundingResponse.js +0 -12
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.d.ts +0 -3
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.js +0 -21
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.d.ts +0 -7
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +0 -6
|
@@ -107,112 +107,11 @@ var Permission;
|
|
|
107
107
|
// DEC-RBAC-038: gestión de scope-entities de nivel genérico — crear/editar/borrar entidades del nivel inferior; scope-bound.
|
|
108
108
|
Permission["TENANT_LEVEL_MANAGE"] = "tenant.level.manage";
|
|
109
109
|
// ====================================================
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
Permission["RETAIL_USER_CREATE"] = "retail.user.create";
|
|
116
|
-
Permission["RETAIL_USER_CREATE_LATERAL"] = "retail.user.create.lateral";
|
|
117
|
-
Permission["RETAIL_USER_READ"] = "retail.user.read";
|
|
118
|
-
Permission["RETAIL_USER_UPDATE"] = "retail.user.update";
|
|
119
|
-
Permission["RETAIL_USER_STATUS"] = "retail.user.status";
|
|
120
|
-
Permission["RETAIL_USER_DELETE"] = "retail.user.delete";
|
|
121
|
-
Permission["RETAIL_USER_PASSWORD_RESET"] = "retail.user.password.reset";
|
|
122
|
-
Permission["RETAIL_USER_MFA_RESET"] = "retail.user.mfa.reset";
|
|
123
|
-
Permission["RETAIL_PRODUCT_CREATE"] = "retail.product.create";
|
|
124
|
-
Permission["RETAIL_PRODUCT_LIST"] = "retail.product.list";
|
|
125
|
-
Permission["RETAIL_PRODUCT_VIEW"] = "retail.product.view";
|
|
126
|
-
Permission["RETAIL_PRODUCT_UPDATE"] = "retail.product.update";
|
|
127
|
-
Permission["RETAIL_PRODUCT_DELETE"] = "retail.product.delete";
|
|
128
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'retail.product.mdm.config' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
129
|
-
Permission["RETAIL_PRODUCT_MDM_CONFIG"] = "retail.product.mdm_config";
|
|
130
|
-
Permission["RETAIL_INVENTORY_LIST"] = "retail.inventory.list";
|
|
131
|
-
Permission["RETAIL_INVENTORY_VIEW"] = "retail.inventory.view";
|
|
132
|
-
Permission["RETAIL_INVENTORY_UPDATE"] = "retail.inventory.update";
|
|
133
|
-
Permission["RETAIL_SALE_CREATE"] = "retail.sale.create";
|
|
134
|
-
Permission["RETAIL_SALE_LIST"] = "retail.sale.list";
|
|
135
|
-
Permission["RETAIL_SALE_CANCEL"] = "retail.sale.cancel";
|
|
136
|
-
Permission["RETAIL_STORE_MANAGE"] = "retail.store.manage";
|
|
137
|
-
Permission["RETAIL_RETAILER_MANAGE"] = "retail.retailer.manage";
|
|
138
|
-
// ====================================================
|
|
139
|
-
// LEND — créditos + cobranza
|
|
140
|
-
// ====================================================
|
|
141
|
-
Permission["LEND_CREDIT_CREATE"] = "lend.credit.create";
|
|
142
|
-
Permission["LEND_CREDIT_LIST"] = "lend.credit.list";
|
|
143
|
-
Permission["LEND_CREDIT_VIEW"] = "lend.credit.view";
|
|
144
|
-
Permission["LEND_CREDIT_UPDATE"] = "lend.credit.update";
|
|
145
|
-
Permission["LEND_CREDIT_LIQUIDATE"] = "lend.credit.liquidate";
|
|
146
|
-
Permission["LEND_CREDIT_RESTRUCTURE"] = "lend.credit.restructure";
|
|
147
|
-
Permission["LEND_PAYMENT_APPLY"] = "lend.payment.apply";
|
|
148
|
-
Permission["LEND_PAYMENT_LIST"] = "lend.payment.list";
|
|
149
|
-
Permission["LEND_PAYMENT_REVERSE"] = "lend.payment.reverse";
|
|
150
|
-
Permission["LEND_INSTALLMENT_VIEW"] = "lend.installment.view";
|
|
151
|
-
// ====================================================
|
|
152
|
-
// MDM — device management (subset especializado de LEND)
|
|
153
|
-
// ====================================================
|
|
154
|
-
Permission["MDM_DEVICE_ENROLL"] = "mdm.device.enroll";
|
|
155
|
-
Permission["MDM_DEVICE_RELEASE"] = "mdm.device.release";
|
|
156
|
-
Permission["MDM_DEVICE_ARCHIVE"] = "mdm.device.archive";
|
|
157
|
-
Permission["MDM_DEVICE_DEACTIVATE"] = "mdm.device.deactivate";
|
|
158
|
-
Permission["MDM_DEVICE_LOCK_MANUAL"] = "mdm.device.lock.manual";
|
|
159
|
-
Permission["MDM_DEVICE_UNLOCK_MANUAL"] = "mdm.device.unlock.manual";
|
|
160
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'mdm.device.pin.unlock' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
161
|
-
Permission["MDM_DEVICE_PIN_UNLOCK"] = "mdm.device.pin_unlock";
|
|
162
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'mdm.device.extend.validity' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
163
|
-
Permission["MDM_DEVICE_EXTEND_VALIDITY"] = "mdm.device.extend_validity";
|
|
164
|
-
Permission["MDM_DEVICE_NOTIFY"] = "mdm.device.notify";
|
|
165
|
-
Permission["MDM_DEVICE_STATUS_VIEW"] = "mdm.device.status.view";
|
|
166
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'mdm.operation.log.view' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
167
|
-
Permission["MDM_OPERATION_LOG_VIEW"] = "mdm.operation_log.view";
|
|
168
|
-
Permission["MDM_TEST"] = "mdm.test";
|
|
169
|
-
// ====================================================
|
|
170
|
-
// PAY — futuro FiadoPay (placeholder, no usado en MVP)
|
|
171
|
-
// ====================================================
|
|
172
|
-
Permission["PAY_TRANSACTION_VIEW"] = "pay.transaction.view";
|
|
173
|
-
// ====================================================
|
|
174
|
-
// AGENTS — Fiado Agents (tenant type AGENTS, roles scope GROUP).
|
|
175
|
-
// Permisos de DOMINIO derivados de los endpoints/pantallas reales del webapp de agents
|
|
176
|
-
// (ver fiado-agents-webapp/docs/rbac/RBAC-agents.md §5.2). El aislamiento entre orgs lo da el
|
|
177
|
-
// scope GROUP del roleAssignment (scopeRef = Group_GT.id), no un permiso aparte.
|
|
178
|
-
// ====================================================
|
|
179
|
-
// Gate de ACCESO a la app web de Agents (gobernanza). Sin este permiso el usuario no
|
|
180
|
-
// entra a la app. Lo otorgan los 5 roles GROUP de agents (en su propio repo, no acá).
|
|
181
|
-
Permission["AGENTS_APP_ACCESS"] = "agents.app.access";
|
|
182
|
-
Permission["AGENTS_AGENT_LIST"] = "agents.agent.list";
|
|
183
|
-
Permission["AGENTS_AGENT_CREATE"] = "agents.agent.create";
|
|
184
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'agents.agent.create.bulk' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
185
|
-
Permission["AGENTS_AGENT_CREATE_BULK"] = "agents.agent.create_bulk";
|
|
186
|
-
Permission["AGENTS_AGENT_MOVE"] = "agents.agent.move";
|
|
187
|
-
Permission["AGENTS_AGENT_DELETE"] = "agents.agent.delete";
|
|
188
|
-
Permission["AGENTS_REFERRAL_VIEW"] = "agents.referral.view";
|
|
189
|
-
Permission["AGENTS_RANKING_VIEW"] = "agents.ranking.view";
|
|
190
|
-
Permission["AGENTS_PRODUCTION_VIEW"] = "agents.production.view";
|
|
191
|
-
Permission["AGENTS_PERSON_SEARCH"] = "agents.person.search";
|
|
192
|
-
Permission["AGENTS_PERSON_VIEW"] = "agents.person.view";
|
|
193
|
-
Permission["AGENTS_PERSON_UPDATE"] = "agents.person.update";
|
|
194
|
-
Permission["AGENTS_PERSON_CREATE"] = "agents.person.create";
|
|
195
|
-
Permission["AGENTS_DOCUMENT_VIEW"] = "agents.document.view";
|
|
196
|
-
Permission["AGENTS_DOCUMENT_UPLOAD"] = "agents.document.upload";
|
|
197
|
-
Permission["AGENTS_ADDRESS_VIEW"] = "agents.address.view";
|
|
198
|
-
Permission["AGENTS_ADDRESS_MANAGE"] = "agents.address.manage";
|
|
199
|
-
Permission["AGENTS_BENEFICIARY_VIEW"] = "agents.beneficiary.view";
|
|
200
|
-
Permission["AGENTS_BENEFICIARY_MANAGE"] = "agents.beneficiary.manage";
|
|
201
|
-
Permission["AGENTS_CARD_ISSUE"] = "agents.card.issue";
|
|
202
|
-
Permission["AGENTS_CHAT_VIEW"] = "agents.chat.view";
|
|
203
|
-
Permission["AGENTS_CHAT_SEND"] = "agents.chat.send";
|
|
204
|
-
Permission["AGENTS_NOTIFICATION_SEND"] = "agents.notification.send";
|
|
205
|
-
Permission["AGENTS_EXPORT_RUN"] = "agents.export.run";
|
|
206
|
-
Permission["AGENTS_CATALOG_VIEW"] = "agents.catalog.view";
|
|
207
|
-
// Gestión de grupos del tenant AGENTS (scope TENANT — el operador). Espejo de retail.retailer.manage.
|
|
208
|
-
Permission["AGENTS_GROUP_MANAGE"] = "agents.group.manage";
|
|
209
|
-
// Gestión de usuarios DENTRO de un grupo (scope GROUP — el group_owner/admin sobre su grupo; el
|
|
210
|
-
// operador la cubre por TENANT). Crea usuarios + asigna roles group_* acotado al groupId. DEC-102.
|
|
211
|
-
Permission["AGENTS_GROUP_USER_MANAGE"] = "agents.group.user.manage";
|
|
212
|
-
// ====================================================
|
|
213
|
-
// LEVEL{1,2,3} — primitivas RBAC genéricas por nivel (DEC-RBAC-063, ADITIVO)
|
|
214
|
-
// Permisos básicos auto-sembrables por nivel genérico (data-driven). Coexisten con los
|
|
215
|
-
// legacy retail.*/agents.* (categorías @deprecated), NO los reemplazan en la línea 3.x.
|
|
110
|
+
// LEVEL{1,2,3} — primitivas RBAC genéricas por nivel (DEC-RBAC-063)
|
|
111
|
+
// Permisos básicos auto-sembrables por nivel genérico (data-driven). Los permisos de
|
|
112
|
+
// DOMINIO (retail.*/lend.*/mdm.*/pay.*/agents.*) fueron purgados del catálogo (v4.0.0,
|
|
113
|
+
// BREAKING): el type-kit contiene SOLO el vocabulario del sistema RBAC; los permisos de
|
|
114
|
+
// dominio viven como data (catálogo por aplicación), no hardcodeados acá.
|
|
216
115
|
// ====================================================
|
|
217
116
|
Permission["LEVEL1_USER_CREATE"] = "level1.user.create";
|
|
218
117
|
Permission["LEVEL1_USER_READ"] = "level1.user.read";
|
|
@@ -308,87 +207,10 @@ exports.PERMISSION_BIT_ORDER = [
|
|
|
308
207
|
Permission.TENANT_SECURITY_POLICY_MANAGE,
|
|
309
208
|
Permission.TENANT_BRANDING_MANAGE,
|
|
310
209
|
Permission.TENANT_AUDIT_VIEW,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
Permission.RETAIL_USER_UPDATE,
|
|
315
|
-
Permission.RETAIL_USER_STATUS,
|
|
316
|
-
Permission.RETAIL_USER_DELETE,
|
|
317
|
-
Permission.RETAIL_USER_PASSWORD_RESET,
|
|
318
|
-
Permission.RETAIL_USER_MFA_RESET,
|
|
319
|
-
Permission.RETAIL_PRODUCT_CREATE,
|
|
320
|
-
Permission.RETAIL_PRODUCT_LIST,
|
|
321
|
-
Permission.RETAIL_PRODUCT_VIEW,
|
|
322
|
-
Permission.RETAIL_PRODUCT_UPDATE,
|
|
323
|
-
Permission.RETAIL_PRODUCT_DELETE,
|
|
324
|
-
Permission.RETAIL_PRODUCT_MDM_CONFIG,
|
|
325
|
-
Permission.RETAIL_INVENTORY_LIST,
|
|
326
|
-
Permission.RETAIL_INVENTORY_VIEW,
|
|
327
|
-
Permission.RETAIL_INVENTORY_UPDATE,
|
|
328
|
-
Permission.RETAIL_SALE_CREATE,
|
|
329
|
-
Permission.RETAIL_SALE_LIST,
|
|
330
|
-
Permission.RETAIL_SALE_CANCEL,
|
|
331
|
-
Permission.RETAIL_STORE_MANAGE,
|
|
332
|
-
Permission.RETAIL_RETAILER_MANAGE,
|
|
333
|
-
Permission.LEND_CREDIT_CREATE,
|
|
334
|
-
Permission.LEND_CREDIT_LIST,
|
|
335
|
-
Permission.LEND_CREDIT_VIEW,
|
|
336
|
-
Permission.LEND_CREDIT_UPDATE,
|
|
337
|
-
Permission.LEND_CREDIT_LIQUIDATE,
|
|
338
|
-
Permission.LEND_CREDIT_RESTRUCTURE,
|
|
339
|
-
Permission.LEND_PAYMENT_APPLY,
|
|
340
|
-
Permission.LEND_PAYMENT_LIST,
|
|
341
|
-
Permission.LEND_PAYMENT_REVERSE,
|
|
342
|
-
Permission.LEND_INSTALLMENT_VIEW,
|
|
343
|
-
Permission.MDM_DEVICE_ENROLL,
|
|
344
|
-
Permission.MDM_DEVICE_RELEASE,
|
|
345
|
-
Permission.MDM_DEVICE_ARCHIVE,
|
|
346
|
-
Permission.MDM_DEVICE_DEACTIVATE,
|
|
347
|
-
Permission.MDM_DEVICE_LOCK_MANUAL,
|
|
348
|
-
Permission.MDM_DEVICE_UNLOCK_MANUAL,
|
|
349
|
-
Permission.MDM_DEVICE_PIN_UNLOCK,
|
|
350
|
-
Permission.MDM_DEVICE_EXTEND_VALIDITY,
|
|
351
|
-
Permission.MDM_DEVICE_NOTIFY,
|
|
352
|
-
Permission.MDM_DEVICE_STATUS_VIEW,
|
|
353
|
-
Permission.MDM_OPERATION_LOG_VIEW,
|
|
354
|
-
Permission.MDM_TEST,
|
|
355
|
-
Permission.PAY_TRANSACTION_VIEW,
|
|
356
|
-
// AGENTS (append-only) — Fiado Agents domain perms.
|
|
357
|
-
Permission.AGENTS_AGENT_LIST,
|
|
358
|
-
Permission.AGENTS_AGENT_CREATE,
|
|
359
|
-
Permission.AGENTS_AGENT_CREATE_BULK,
|
|
360
|
-
Permission.AGENTS_AGENT_MOVE,
|
|
361
|
-
Permission.AGENTS_AGENT_DELETE,
|
|
362
|
-
Permission.AGENTS_REFERRAL_VIEW,
|
|
363
|
-
Permission.AGENTS_RANKING_VIEW,
|
|
364
|
-
Permission.AGENTS_PRODUCTION_VIEW,
|
|
365
|
-
Permission.AGENTS_PERSON_SEARCH,
|
|
366
|
-
Permission.AGENTS_PERSON_VIEW,
|
|
367
|
-
Permission.AGENTS_PERSON_UPDATE,
|
|
368
|
-
Permission.AGENTS_DOCUMENT_VIEW,
|
|
369
|
-
Permission.AGENTS_DOCUMENT_UPLOAD,
|
|
370
|
-
Permission.AGENTS_ADDRESS_VIEW,
|
|
371
|
-
Permission.AGENTS_ADDRESS_MANAGE,
|
|
372
|
-
Permission.AGENTS_BENEFICIARY_VIEW,
|
|
373
|
-
Permission.AGENTS_BENEFICIARY_MANAGE,
|
|
374
|
-
Permission.AGENTS_CARD_ISSUE,
|
|
375
|
-
Permission.AGENTS_CHAT_VIEW,
|
|
376
|
-
Permission.AGENTS_CHAT_SEND,
|
|
377
|
-
Permission.AGENTS_NOTIFICATION_SEND,
|
|
378
|
-
Permission.AGENTS_EXPORT_RUN,
|
|
379
|
-
Permission.AGENTS_CATALOG_VIEW,
|
|
380
|
-
Permission.AGENTS_GROUP_MANAGE,
|
|
381
|
-
Permission.AGENTS_GROUP_USER_MANAGE,
|
|
382
|
-
// Append-only: nuevo permiso agregado 2026-06-18 (DEC-A2-02). Va al FINAL para no correr los bits
|
|
383
|
-
// existentes (PERMS_VERSION cambia, pero los índices previos se conservan).
|
|
384
|
-
Permission.AGENTS_PERSON_CREATE,
|
|
385
|
-
// Append-only 2026-06-18 (DEC-RBAC-017): catálogo de campos personalizados por tenant. Al FINAL para
|
|
386
|
-
// no correr bits existentes. (El bitset está deprecado por token-flaco, pero el orden se mantiene
|
|
387
|
-
// sincronizado con el enum para que el test de bits no rompa.)
|
|
210
|
+
// Append-only 2026-06-18 (DEC-RBAC-017): catálogo de campos personalizados por tenant.
|
|
211
|
+
// (El bitset está deprecado por token-flaco, pero el orden se mantiene sincronizado con el
|
|
212
|
+
// enum para que el test de bits no rompa.)
|
|
388
213
|
Permission.PLATFORM_TENANT_USERFIELDS_MANAGE,
|
|
389
|
-
// Append-only 2026-06-21: gate de acceso a la app web de Agents (gobernanza). Al FINAL para no
|
|
390
|
-
// correr bits existentes (PERMS_VERSION cambia, pero los índices previos se conservan).
|
|
391
|
-
Permission.AGENTS_APP_ACCESS,
|
|
392
214
|
// Append-only 2026-06-19: lateral platform (platform_super_admin asigna roles scope PLATFORM).
|
|
393
215
|
// Al FINAL para no correr bits existentes (PERMS_VERSION cambia, índices previos se conservan).
|
|
394
216
|
Permission.PLATFORM_USER_CREATE_LATERAL,
|
|
@@ -6,14 +6,7 @@ export declare enum PermissionCategory {
|
|
|
6
6
|
RBAC = "rbac",
|
|
7
7
|
PLATFORM = "platform",
|
|
8
8
|
TENANT = "tenant",
|
|
9
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
10
|
-
RETAIL = "retail",
|
|
11
|
-
LEND = "lend",
|
|
12
|
-
MDM = "mdm",
|
|
13
9
|
AUDIT = "audit",
|
|
14
|
-
PAY = "pay",
|
|
15
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
16
|
-
AGENTS = "agents",
|
|
17
10
|
LEVEL1 = "level1",
|
|
18
11
|
LEVEL2 = "level2",
|
|
19
12
|
LEVEL3 = "level3"
|
|
@@ -10,16 +10,11 @@ var PermissionCategory;
|
|
|
10
10
|
PermissionCategory["RBAC"] = "rbac";
|
|
11
11
|
PermissionCategory["PLATFORM"] = "platform";
|
|
12
12
|
PermissionCategory["TENANT"] = "tenant";
|
|
13
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
14
|
-
PermissionCategory["RETAIL"] = "retail";
|
|
15
|
-
PermissionCategory["LEND"] = "lend";
|
|
16
|
-
PermissionCategory["MDM"] = "mdm";
|
|
17
13
|
PermissionCategory["AUDIT"] = "audit";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
// Coexisten con RETAIL/AGENTS (@deprecated), no los reemplazan en la línea 3.x.
|
|
14
|
+
// DEC-RBAC-063: categorías de las primitivas RBAC por nivel genérico.
|
|
15
|
+
// Las categorías de DOMINIO (retail/lend/mdm/pay/agents) fueron purgadas del catálogo
|
|
16
|
+
// (v4.0.0, BREAKING): el type-kit contiene SOLO el vocabulario del sistema RBAC; el dominio
|
|
17
|
+
// vive como data (catálogo por aplicación), no hardcodeado acá.
|
|
23
18
|
PermissionCategory["LEVEL1"] = "level1";
|
|
24
19
|
PermissionCategory["LEVEL2"] = "level2";
|
|
25
20
|
PermissionCategory["LEVEL3"] = "level3";
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { PermissionScope } from './enums/PermissionScope';
|
|
2
2
|
/**
|
|
3
|
-
* Tipos de tenant
|
|
4
|
-
* jerarquía de niveles DEBAJO de TENANT (data-driven). Hoy solo existe `retail`.
|
|
3
|
+
* Tipos de tenant de DOMINIO (retail/agents) — PURGADOS (v4.0.0, BREAKING).
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* El modelo de tipos de tenant de dominio se consolidó en niveles genéricos (LEVEL_1..n)
|
|
6
|
+
* data-driven (DEC-RBAC-062/063). El type-kit contiene SOLO el vocabulario del sistema RBAC;
|
|
7
|
+
* la jerarquía de niveles de cada aplicación vive como data (catálogo por aplicación,
|
|
8
|
+
* ver `LevelDef` en `application/Application`), no hardcodeada acá.
|
|
9
|
+
*
|
|
10
|
+
* El enum queda SIN miembros de dominio a propósito. La maquinaria genérica
|
|
11
|
+
* (`TENANT_TYPES`, `levelsOf`, `tableSuffixForLevel`, `scopeRankOrder`) se conserva para no
|
|
12
|
+
* romper a los consumidores (ej. `ScopeValidationService._rank` vía `scopeRankOrder`), pero
|
|
13
|
+
* ya no aporta niveles legacy: el orden queda definido por los niveles genéricos.
|
|
8
14
|
*/
|
|
9
15
|
export declare enum TenantType {
|
|
10
|
-
RETAIL = "retail",
|
|
11
|
-
AGENTS = "agents"
|
|
12
16
|
}
|
|
13
17
|
interface TenantTypeDef {
|
|
14
18
|
displayName: string;
|
|
@@ -17,17 +21,18 @@ interface TenantTypeDef {
|
|
|
17
21
|
/** Sufijo de tabla DDB por nivel (el prefix del tenant se antepone en runtime). */
|
|
18
22
|
tableSuffix: Partial<Record<PermissionScope, string>>;
|
|
19
23
|
}
|
|
20
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Registro de tipos de tenant de dominio — VACÍO tras la purga (v4.0.0). Las jerarquías de
|
|
26
|
+
* niveles se definen como data por aplicación (LEVEL_n), no acá.
|
|
27
|
+
*/
|
|
21
28
|
export declare const TENANT_TYPES: Record<TenantType, TenantTypeDef>;
|
|
22
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
23
29
|
export declare function levelsOf(type: TenantType): PermissionScope[];
|
|
24
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
25
30
|
export declare function tableSuffixForLevel(type: TenantType, level: PermissionScope): string | undefined;
|
|
26
31
|
/**
|
|
27
|
-
* Orden global de scopes para ORDENAR (ej. UI): PLATFORM, TENANT + niveles
|
|
28
|
-
* ⚠️ NO usar para COBERTURA de autorización: es un orden total que cruzaría ramas
|
|
29
|
-
*
|
|
30
|
-
*
|
|
32
|
+
* Orden global de scopes para ORDENAR (ej. UI): PLATFORM, TENANT + niveles genéricos.
|
|
33
|
+
* ⚠️ NO usar para COBERTURA de autorización: es un orden total que cruzaría ramas.
|
|
34
|
+
* La cobertura se decide con una relación explícita por niveles — ver `canAccess`/`scopeCovers`
|
|
35
|
+
* en @fiado/gateway-adapter (DEC-RBAC-010).
|
|
31
36
|
*/
|
|
32
37
|
export declare function scopeRankOrder(): PermissionScope[];
|
|
33
38
|
export {};
|
|
@@ -6,47 +6,37 @@ exports.tableSuffixForLevel = tableSuffixForLevel;
|
|
|
6
6
|
exports.scopeRankOrder = scopeRankOrder;
|
|
7
7
|
const PermissionScope_1 = require("./enums/PermissionScope");
|
|
8
8
|
/**
|
|
9
|
-
* Tipos de tenant
|
|
10
|
-
* jerarquía de niveles DEBAJO de TENANT (data-driven). Hoy solo existe `retail`.
|
|
9
|
+
* Tipos de tenant de DOMINIO (retail/agents) — PURGADOS (v4.0.0, BREAKING).
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* El modelo de tipos de tenant de dominio se consolidó en niveles genéricos (LEVEL_1..n)
|
|
12
|
+
* data-driven (DEC-RBAC-062/063). El type-kit contiene SOLO el vocabulario del sistema RBAC;
|
|
13
|
+
* la jerarquía de niveles de cada aplicación vive como data (catálogo por aplicación,
|
|
14
|
+
* ver `LevelDef` en `application/Application`), no hardcodeada acá.
|
|
15
|
+
*
|
|
16
|
+
* El enum queda SIN miembros de dominio a propósito. La maquinaria genérica
|
|
17
|
+
* (`TENANT_TYPES`, `levelsOf`, `tableSuffixForLevel`, `scopeRankOrder`) se conserva para no
|
|
18
|
+
* romper a los consumidores (ej. `ScopeValidationService._rank` vía `scopeRankOrder`), pero
|
|
19
|
+
* ya no aporta niveles legacy: el orden queda definido por los niveles genéricos.
|
|
14
20
|
*/
|
|
15
21
|
var TenantType;
|
|
16
22
|
(function (TenantType) {
|
|
17
|
-
TenantType["RETAIL"] = "retail";
|
|
18
|
-
TenantType["AGENTS"] = "agents";
|
|
19
23
|
})(TenantType || (exports.TenantType = TenantType = {}));
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
tableSuffix: {
|
|
26
|
-
[PermissionScope_1.PermissionScope.RETAILER]: 'SharedRetailer',
|
|
27
|
-
[PermissionScope_1.PermissionScope.STORE]: 'SharedStore',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
// Fiado Agents — un único nivel GROUP debajo de TENANT.
|
|
31
|
-
[TenantType.AGENTS]: {
|
|
32
|
-
displayName: 'Agents',
|
|
33
|
-
levels: [PermissionScope_1.PermissionScope.GROUP],
|
|
34
|
-
tableSuffix: { [PermissionScope_1.PermissionScope.GROUP]: 'SharedGroup' },
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
24
|
+
/**
|
|
25
|
+
* Registro de tipos de tenant de dominio — VACÍO tras la purga (v4.0.0). Las jerarquías de
|
|
26
|
+
* niveles se definen como data por aplicación (LEVEL_n), no acá.
|
|
27
|
+
*/
|
|
28
|
+
exports.TENANT_TYPES = {};
|
|
38
29
|
function levelsOf(type) {
|
|
39
30
|
return exports.TENANT_TYPES[type].levels;
|
|
40
31
|
}
|
|
41
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
42
32
|
function tableSuffixForLevel(type, level) {
|
|
43
33
|
return exports.TENANT_TYPES[type].tableSuffix[level];
|
|
44
34
|
}
|
|
45
35
|
/**
|
|
46
|
-
* Orden global de scopes para ORDENAR (ej. UI): PLATFORM, TENANT + niveles
|
|
47
|
-
* ⚠️ NO usar para COBERTURA de autorización: es un orden total que cruzaría ramas
|
|
48
|
-
*
|
|
49
|
-
*
|
|
36
|
+
* Orden global de scopes para ORDENAR (ej. UI): PLATFORM, TENANT + niveles genéricos.
|
|
37
|
+
* ⚠️ NO usar para COBERTURA de autorización: es un orden total que cruzaría ramas.
|
|
38
|
+
* La cobertura se decide con una relación explícita por niveles — ver `canAccess`/`scopeCovers`
|
|
39
|
+
* en @fiado/gateway-adapter (DEC-RBAC-010).
|
|
50
40
|
*/
|
|
51
41
|
function scopeRankOrder() {
|
|
52
42
|
const order = [PermissionScope_1.PermissionScope.PLATFORM, PermissionScope_1.PermissionScope.TENANT];
|
|
@@ -55,7 +45,7 @@ function scopeRankOrder() {
|
|
|
55
45
|
if (!order.includes(lvl))
|
|
56
46
|
order.push(lvl);
|
|
57
47
|
}
|
|
58
|
-
// DEC-RBAC-032: niveles genéricos al final del orden total (UI/ranking). Append-only
|
|
48
|
+
// DEC-RBAC-032: niveles genéricos al final del orden total (UI/ranking). Append-only.
|
|
59
49
|
for (const lvl of [PermissionScope_1.PermissionScope.LEVEL_1, PermissionScope_1.PermissionScope.LEVEL_2, PermissionScope_1.PermissionScope.LEVEL_3]) {
|
|
60
50
|
if (!order.includes(lvl))
|
|
61
51
|
order.push(lvl);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AuditAction } from "../enums/AuditAction";
|
|
2
|
+
import { AuditEntityType } from "../enums/AuditEntityType";
|
|
3
|
+
/**
|
|
4
|
+
* DTOs del audit trail del backoffice de remesas (RemittanceAuditLog_GT, dueño:
|
|
5
|
+
* remittance-business). Append-only: registra "quién cambió qué, cuándo" en cada
|
|
6
|
+
* mutación (Configuración, Variables Operativas y, a futuro, suspend/reactivate
|
|
7
|
+
* desde el connector vía api-invoker — por eso el request vive en type-kit).
|
|
8
|
+
*
|
|
9
|
+
* MVP persiste `summary` + `after` (snapshot nuevo); `before` se agrega después
|
|
10
|
+
* si la UI quiere diff visual.
|
|
11
|
+
*/
|
|
12
|
+
/** Request de append (helper `recordAudit` en rb; futuro cross-lambda). */
|
|
13
|
+
export declare class AuditAppendRequest {
|
|
14
|
+
entityType: AuditEntityType;
|
|
15
|
+
/** Id de la entidad afectada (cohortId, segmentId, directoryId…). */
|
|
16
|
+
entityId: string;
|
|
17
|
+
action: AuditAction;
|
|
18
|
+
/** Email del operador (claim del JWT) o "sistema" para jobs. */
|
|
19
|
+
actor: string;
|
|
20
|
+
/** Descripción legible ("Editó condiciones del cohort 'Activo'"). */
|
|
21
|
+
summary: string;
|
|
22
|
+
/** Snapshot del estado nuevo de la entidad (opcional). */
|
|
23
|
+
after?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
/** Entrada del audit trail (response). */
|
|
26
|
+
export declare class AuditLogEntry {
|
|
27
|
+
entityType: AuditEntityType;
|
|
28
|
+
/** SK: ISO-8601 + `#<uuid>` (orden cronológico + unicidad dentro del entityType). */
|
|
29
|
+
at: string;
|
|
30
|
+
actor: string;
|
|
31
|
+
entityId: string;
|
|
32
|
+
action: AuditAction;
|
|
33
|
+
summary: string;
|
|
34
|
+
after: Record<string, unknown> | null;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
}
|
|
37
|
+
/** Response de GET /backoffice/audit (paginación estándar index/pageSize). */
|
|
38
|
+
export declare class AuditListResponse {
|
|
39
|
+
items: AuditLogEntry[];
|
|
40
|
+
/** Cursor opaco (base64) para la próxima página; null/ausente = última. */
|
|
41
|
+
index?: string | null;
|
|
42
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AuditListResponse = exports.AuditLogEntry = exports.AuditAppendRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const AuditAction_1 = require("../enums/AuditAction");
|
|
15
|
+
const AuditEntityType_1 = require("../enums/AuditEntityType");
|
|
16
|
+
/**
|
|
17
|
+
* DTOs del audit trail del backoffice de remesas (RemittanceAuditLog_GT, dueño:
|
|
18
|
+
* remittance-business). Append-only: registra "quién cambió qué, cuándo" en cada
|
|
19
|
+
* mutación (Configuración, Variables Operativas y, a futuro, suspend/reactivate
|
|
20
|
+
* desde el connector vía api-invoker — por eso el request vive en type-kit).
|
|
21
|
+
*
|
|
22
|
+
* MVP persiste `summary` + `after` (snapshot nuevo); `before` se agrega después
|
|
23
|
+
* si la UI quiere diff visual.
|
|
24
|
+
*/
|
|
25
|
+
/** Request de append (helper `recordAudit` en rb; futuro cross-lambda). */
|
|
26
|
+
class AuditAppendRequest {
|
|
27
|
+
}
|
|
28
|
+
exports.AuditAppendRequest = AuditAppendRequest;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsEnum)(AuditEntityType_1.AuditEntityType),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AuditAppendRequest.prototype, "entityType", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], AuditAppendRequest.prototype, "entityId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsEnum)(AuditAction_1.AuditAction),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], AuditAppendRequest.prototype, "action", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AuditAppendRequest.prototype, "actor", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsString)(),
|
|
47
|
+
(0, class_validator_1.MaxLength)(500),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], AuditAppendRequest.prototype, "summary", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
52
|
+
(0, class_validator_1.IsObject)(),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], AuditAppendRequest.prototype, "after", void 0);
|
|
55
|
+
/** Entrada del audit trail (response). */
|
|
56
|
+
class AuditLogEntry {
|
|
57
|
+
}
|
|
58
|
+
exports.AuditLogEntry = AuditLogEntry;
|
|
59
|
+
/** Response de GET /backoffice/audit (paginación estándar index/pageSize). */
|
|
60
|
+
class AuditListResponse {
|
|
61
|
+
}
|
|
62
|
+
exports.AuditListResponse = AuditListResponse;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CohortField } from "../enums/CohortField";
|
|
2
|
+
import { CohortOperator } from "../enums/CohortOperator";
|
|
3
|
+
import { CohortRefresh } from "../enums/CohortRefresh";
|
|
4
|
+
/**
|
|
5
|
+
* DTOs de Cohorts (Dashboard Ops · Configuración §3, EP-26..30).
|
|
6
|
+
*
|
|
7
|
+
* Un cohort es un grupo dinámico de clientes definido por condiciones en AND
|
|
8
|
+
* (rule builder del mockup) que se recalcula periódicamente. Dueño de la tabla:
|
|
9
|
+
* remittance-business (RemittanceCohorts_GT). Solo se persiste el count (D4.5),
|
|
10
|
+
* nunca la membership.
|
|
11
|
+
*/
|
|
12
|
+
/** Condición del rule builder: `SI <field> <op> <value>`. Todas en AND. */
|
|
13
|
+
export declare class CohortCondition {
|
|
14
|
+
field: CohortField;
|
|
15
|
+
op: CohortOperator;
|
|
16
|
+
value: number;
|
|
17
|
+
}
|
|
18
|
+
/** Body de EP-27 POST /backoffice/config/cohorts. */
|
|
19
|
+
export declare class CreateCohortRequest {
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
conditions: CohortCondition[];
|
|
23
|
+
refresh: CohortRefresh;
|
|
24
|
+
}
|
|
25
|
+
/** Body de EP-28 PUT /backoffice/config/cohorts/{id} (reemplazo completo, patrón Save del mockup). */
|
|
26
|
+
export declare class UpdateCohortRequest {
|
|
27
|
+
name: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
conditions: CohortCondition[];
|
|
30
|
+
refresh: CohortRefresh;
|
|
31
|
+
}
|
|
32
|
+
/** Cohort completo (response). `memberCount`/`pctTotal` son null si nunca se calculó. */
|
|
33
|
+
export declare class Cohort {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
description: string | null;
|
|
37
|
+
conditions: CohortCondition[];
|
|
38
|
+
refresh: CohortRefresh;
|
|
39
|
+
/** Clientes actualmente en el cohort (snapshot del último recálculo). */
|
|
40
|
+
memberCount: number | null;
|
|
41
|
+
/** % del total de RemittanceUsers (denominador = todos, no solo ACTIVE). 0-100. */
|
|
42
|
+
pctTotal: number | null;
|
|
43
|
+
lastCalculatedAt: string | null;
|
|
44
|
+
/** ISO — próxima corrida que el cron horario debe honrar (derivado de `refresh`). */
|
|
45
|
+
nextCalculationAt: string;
|
|
46
|
+
createdAt: string;
|
|
47
|
+
updatedAt: string;
|
|
48
|
+
createdBy: string;
|
|
49
|
+
updatedBy: string;
|
|
50
|
+
}
|
|
51
|
+
/** Response de EP-26 GET /backoffice/config/cohorts (tabla chica, sin paginación). */
|
|
52
|
+
export declare class CohortListResponse {
|
|
53
|
+
items: Cohort[];
|
|
54
|
+
}
|
|
55
|
+
/** Response de EP-30 POST /backoffice/config/cohorts/{id}/recalcular. */
|
|
56
|
+
export declare class RecalculateCohortResponse {
|
|
57
|
+
id: string;
|
|
58
|
+
memberCount: number;
|
|
59
|
+
pctTotal: number;
|
|
60
|
+
lastCalculatedAt: string;
|
|
61
|
+
nextCalculationAt: string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RecalculateCohortResponse = exports.CohortListResponse = exports.Cohort = exports.UpdateCohortRequest = exports.CreateCohortRequest = exports.CohortCondition = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const CohortField_1 = require("../enums/CohortField");
|
|
16
|
+
const CohortOperator_1 = require("../enums/CohortOperator");
|
|
17
|
+
const CohortRefresh_1 = require("../enums/CohortRefresh");
|
|
18
|
+
/**
|
|
19
|
+
* DTOs de Cohorts (Dashboard Ops · Configuración §3, EP-26..30).
|
|
20
|
+
*
|
|
21
|
+
* Un cohort es un grupo dinámico de clientes definido por condiciones en AND
|
|
22
|
+
* (rule builder del mockup) que se recalcula periódicamente. Dueño de la tabla:
|
|
23
|
+
* remittance-business (RemittanceCohorts_GT). Solo se persiste el count (D4.5),
|
|
24
|
+
* nunca la membership.
|
|
25
|
+
*/
|
|
26
|
+
/** Condición del rule builder: `SI <field> <op> <value>`. Todas en AND. */
|
|
27
|
+
class CohortCondition {
|
|
28
|
+
}
|
|
29
|
+
exports.CohortCondition = CohortCondition;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsEnum)(CohortField_1.CohortField),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CohortCondition.prototype, "field", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsEnum)(CohortOperator_1.CohortOperator),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], CohortCondition.prototype, "op", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsNumber)(),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], CohortCondition.prototype, "value", void 0);
|
|
42
|
+
/** Body de EP-27 POST /backoffice/config/cohorts. */
|
|
43
|
+
class CreateCohortRequest {
|
|
44
|
+
}
|
|
45
|
+
exports.CreateCohortRequest = CreateCohortRequest;
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsString)(),
|
|
48
|
+
(0, class_validator_1.Length)(3, 100),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], CreateCohortRequest.prototype, "name", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
(0, class_validator_1.IsString)(),
|
|
54
|
+
(0, class_validator_1.MaxLength)(500),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], CreateCohortRequest.prototype, "description", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_validator_1.IsArray)(),
|
|
59
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
60
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
61
|
+
(0, class_transformer_1.Type)(() => CohortCondition),
|
|
62
|
+
__metadata("design:type", Array)
|
|
63
|
+
], CreateCohortRequest.prototype, "conditions", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, class_validator_1.IsEnum)(CohortRefresh_1.CohortRefresh),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], CreateCohortRequest.prototype, "refresh", void 0);
|
|
68
|
+
/** Body de EP-28 PUT /backoffice/config/cohorts/{id} (reemplazo completo, patrón Save del mockup). */
|
|
69
|
+
class UpdateCohortRequest {
|
|
70
|
+
}
|
|
71
|
+
exports.UpdateCohortRequest = UpdateCohortRequest;
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, class_validator_1.IsString)(),
|
|
74
|
+
(0, class_validator_1.Length)(3, 100),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], UpdateCohortRequest.prototype, "name", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, class_validator_1.IsOptional)(),
|
|
79
|
+
(0, class_validator_1.IsString)(),
|
|
80
|
+
(0, class_validator_1.MaxLength)(500),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], UpdateCohortRequest.prototype, "description", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, class_validator_1.IsArray)(),
|
|
85
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
86
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
87
|
+
(0, class_transformer_1.Type)(() => CohortCondition),
|
|
88
|
+
__metadata("design:type", Array)
|
|
89
|
+
], UpdateCohortRequest.prototype, "conditions", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, class_validator_1.IsEnum)(CohortRefresh_1.CohortRefresh),
|
|
92
|
+
__metadata("design:type", String)
|
|
93
|
+
], UpdateCohortRequest.prototype, "refresh", void 0);
|
|
94
|
+
/** Cohort completo (response). `memberCount`/`pctTotal` son null si nunca se calculó. */
|
|
95
|
+
class Cohort {
|
|
96
|
+
}
|
|
97
|
+
exports.Cohort = Cohort;
|
|
98
|
+
/** Response de EP-26 GET /backoffice/config/cohorts (tabla chica, sin paginación). */
|
|
99
|
+
class CohortListResponse {
|
|
100
|
+
}
|
|
101
|
+
exports.CohortListResponse = CohortListResponse;
|
|
102
|
+
/** Response de EP-30 POST /backoffice/config/cohorts/{id}/recalcular. */
|
|
103
|
+
class RecalculateCohortResponse {
|
|
104
|
+
}
|
|
105
|
+
exports.RecalculateCohortResponse = RecalculateCohortResponse;
|