@fiado/type-kit 3.186.0 → 3.188.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/retailOrg/enums/ZoneStatusEnum.test.ts +14 -1
- package/bin/index.d.ts +1 -0
- package/bin/index.js +4 -1
- package/bin/loanCollectorAssignment/dtos/PriorityWeights.d.ts +10 -0
- package/bin/loanCollectorAssignment/dtos/PriorityWeights.js +43 -0
- package/bin/loanCollectorAssignment/dtos/requests/AutoAssignRequest.d.ts +9 -0
- package/bin/{walletFunding/dtos/CancelFundingReferenceRequest.js → loanCollectorAssignment/dtos/requests/AutoAssignRequest.js} +17 -9
- package/bin/loanCollectorAssignment/dtos/requests/CreateAssignmentRuleRequest.d.ts +12 -0
- package/bin/loanCollectorAssignment/dtos/requests/CreateAssignmentRuleRequest.js +46 -0
- package/bin/loanCollectorAssignment/dtos/requests/ReassignRequest.d.ts +7 -0
- package/bin/{walletFunding/dtos/CancelWalletFundingRequest.js → loanCollectorAssignment/dtos/requests/ReassignRequest.js} +11 -5
- package/bin/loanCollectorAssignment/dtos/requests/RedistributeRequest.d.ts +7 -0
- package/bin/{walletFunding/dtos/CancelFundingRequest.js → loanCollectorAssignment/dtos/requests/RedistributeRequest.js} +9 -15
- package/bin/loanCollectorAssignment/dtos/requests/UpdateAssignmentRuleRequest.d.ts +12 -0
- package/bin/loanCollectorAssignment/dtos/requests/UpdateAssignmentRuleRequest.js +49 -0
- package/bin/loanCollectorAssignment/dtos/responses/AssignmentRuleResponse.d.ts +15 -0
- package/bin/loanCollectorAssignment/dtos/responses/AssignmentRuleResponse.js +2 -0
- package/bin/loanCollectorAssignment/dtos/responses/CollectorAssignmentResponse.d.ts +16 -0
- package/bin/loanCollectorAssignment/dtos/responses/CollectorAssignmentResponse.js +2 -0
- package/bin/loanCollectorAssignment/dtos/responses/CollectorLoadResponse.d.ts +11 -0
- package/bin/loanCollectorAssignment/dtos/responses/CollectorLoadResponse.js +2 -0
- package/bin/loanCollectorAssignment/dtos/responses/RedistributeSummaryResponse.d.ts +9 -0
- package/bin/loanCollectorAssignment/dtos/responses/RedistributeSummaryResponse.js +2 -0
- package/bin/loanCollectorAssignment/enums/AssignmentStatusEnum.d.ts +10 -0
- package/bin/loanCollectorAssignment/enums/AssignmentStatusEnum.js +14 -0
- package/bin/loanCollectorAssignment/enums/AssignmentStrategyEnum.d.ts +12 -0
- package/bin/loanCollectorAssignment/enums/AssignmentStrategyEnum.js +16 -0
- package/bin/loanCollectorAssignment/index.d.ts +12 -0
- package/bin/loanCollectorAssignment/index.js +32 -0
- package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +22 -0
- package/bin/{cognitoBackofficeConnector/dtos/MfaPoolConfig.js → platformRbac/dtos/ResendOtpRequest.js} +18 -18
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.js +36 -0
- package/bin/retailOrg/enums/ZoneStatusEnum.d.ts +13 -1
- package/bin/retailOrg/enums/ZoneStatusEnum.js +13 -1
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/loanCollectorAssignment/dtos/PriorityWeights.ts +27 -0
- package/src/loanCollectorAssignment/dtos/requests/AutoAssignRequest.ts +23 -0
- package/src/loanCollectorAssignment/dtos/requests/CreateAssignmentRuleRequest.ts +29 -0
- package/src/loanCollectorAssignment/dtos/requests/ReassignRequest.ts +13 -0
- package/src/loanCollectorAssignment/dtos/requests/RedistributeRequest.ts +13 -0
- package/src/loanCollectorAssignment/dtos/requests/UpdateAssignmentRuleRequest.ts +32 -0
- package/src/loanCollectorAssignment/dtos/responses/AssignmentRuleResponse.ts +16 -0
- package/src/loanCollectorAssignment/dtos/responses/CollectorAssignmentResponse.ts +17 -0
- package/src/loanCollectorAssignment/dtos/responses/CollectorLoadResponse.ts +11 -0
- package/src/loanCollectorAssignment/dtos/responses/RedistributeSummaryResponse.ts +10 -0
- package/src/loanCollectorAssignment/enums/AssignmentStatusEnum.ts +10 -0
- package/src/loanCollectorAssignment/enums/AssignmentStrategyEnum.ts +12 -0
- package/src/loanCollectorAssignment/index.ts +19 -0
- package/src/retailOrg/enums/ZoneStatusEnum.ts +13 -1
- 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/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/CancelWalletFundingResponse.d.ts +0 -7
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +0 -6
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
3
|
+
* Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
|
|
4
|
+
* `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
|
|
5
|
+
* server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
|
|
6
|
+
* scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
|
|
7
|
+
*/
|
|
8
|
+
export declare class ResendSelfRegisterOtpRequest {
|
|
9
|
+
tenantId: string;
|
|
10
|
+
email: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.ResendSelfRegisterOtpRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
17
|
+
* Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
|
|
18
|
+
* `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
|
|
19
|
+
* server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
|
|
20
|
+
* scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
|
|
21
|
+
*/
|
|
22
|
+
class ResendSelfRegisterOtpRequest {
|
|
23
|
+
}
|
|
24
|
+
exports.ResendSelfRegisterOtpRequest = ResendSelfRegisterOtpRequest;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ResendSelfRegisterOtpRequest.prototype, "tenantId", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
(0, class_validator_1.IsEmail)(),
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ResendSelfRegisterOtpRequest.prototype, "email", void 0);
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Estado operativo de una zona comercial de un retailer.
|
|
3
|
+
*
|
|
4
|
+
* Alineado con `RetailerStatusEnum` / `StoreStatusEnum` / `RetailUserStatusEnum`: los cuatro comparten
|
|
5
|
+
* ACTIVE | SUSPENDED | INACTIVE. `SUSPENDED` se agregó (F1, 2026-07-16) porque Zone era el ÚNICO que no
|
|
6
|
+
* podía expresar la SUSPENSIÓN POR CASCADA: el spec pide que suspender un retailer suspenda POR LECTURA
|
|
7
|
+
* a sus zonas/stores/users (`estadoEfectivo = propio AND cadena de padres`, auto-reversible al
|
|
8
|
+
* reactivar, sin fan-out de escrituras). Sin `SUSPENDED`, la zona solo podía reportar `INACTIVE` — que
|
|
9
|
+
* acá significa **soft-delete** — así que una zona suspendida por su padre aparecería BORRADA.
|
|
10
|
+
* Verificado en dev: con el retailer SUSPENDED, sus stores reportaban SUSPENDED y sus zonas seguían
|
|
11
|
+
* ACTIVE (fuga de la regla de negocio).
|
|
12
|
+
*
|
|
3
13
|
* @enum {string}
|
|
4
14
|
*
|
|
5
15
|
* @property {string} ACTIVE - Zona activa y operando.
|
|
6
|
-
* @property {string}
|
|
16
|
+
* @property {string} SUSPENDED - Suspendida por cascada del padre (REVERSIBLE — no es una baja).
|
|
17
|
+
* @property {string} INACTIVE - Zona dada de baja (soft-delete).
|
|
7
18
|
*/
|
|
8
19
|
export declare enum ZoneStatusEnum {
|
|
9
20
|
ACTIVE = "ACTIVE",
|
|
21
|
+
SUSPENDED = "SUSPENDED",
|
|
10
22
|
INACTIVE = "INACTIVE"
|
|
11
23
|
}
|
|
@@ -3,13 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ZoneStatusEnum = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Estado operativo de una zona comercial de un retailer.
|
|
6
|
+
*
|
|
7
|
+
* Alineado con `RetailerStatusEnum` / `StoreStatusEnum` / `RetailUserStatusEnum`: los cuatro comparten
|
|
8
|
+
* ACTIVE | SUSPENDED | INACTIVE. `SUSPENDED` se agregó (F1, 2026-07-16) porque Zone era el ÚNICO que no
|
|
9
|
+
* podía expresar la SUSPENSIÓN POR CASCADA: el spec pide que suspender un retailer suspenda POR LECTURA
|
|
10
|
+
* a sus zonas/stores/users (`estadoEfectivo = propio AND cadena de padres`, auto-reversible al
|
|
11
|
+
* reactivar, sin fan-out de escrituras). Sin `SUSPENDED`, la zona solo podía reportar `INACTIVE` — que
|
|
12
|
+
* acá significa **soft-delete** — así que una zona suspendida por su padre aparecería BORRADA.
|
|
13
|
+
* Verificado en dev: con el retailer SUSPENDED, sus stores reportaban SUSPENDED y sus zonas seguían
|
|
14
|
+
* ACTIVE (fuga de la regla de negocio).
|
|
15
|
+
*
|
|
6
16
|
* @enum {string}
|
|
7
17
|
*
|
|
8
18
|
* @property {string} ACTIVE - Zona activa y operando.
|
|
9
|
-
* @property {string}
|
|
19
|
+
* @property {string} SUSPENDED - Suspendida por cascada del padre (REVERSIBLE — no es una baja).
|
|
20
|
+
* @property {string} INACTIVE - Zona dada de baja (soft-delete).
|
|
10
21
|
*/
|
|
11
22
|
var ZoneStatusEnum;
|
|
12
23
|
(function (ZoneStatusEnum) {
|
|
13
24
|
ZoneStatusEnum["ACTIVE"] = "ACTIVE";
|
|
25
|
+
ZoneStatusEnum["SUSPENDED"] = "SUSPENDED";
|
|
14
26
|
ZoneStatusEnum["INACTIVE"] = "INACTIVE";
|
|
15
27
|
})(ZoneStatusEnum || (exports.ZoneStatusEnum = ZoneStatusEnum = {}));
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -108,5 +108,8 @@ export * as LoanConfig from './loanConfig';
|
|
|
108
108
|
// LoanOfferings: DTOs/enums del lambda loan-offerings-business (comp 07 — planes de crédito,
|
|
109
109
|
// financieras, M:N retailer↔plan y simulador de cuota; SureKeep Fase 1 — pista Loan).
|
|
110
110
|
export * as LoanOfferings from './loanOfferings';
|
|
111
|
+
// LoanCollectorAssignment: DTOs/enums del lambda loan-collector-assignment-business (comp 08 — reglas de
|
|
112
|
+
// asignación de cartera de cobranza + asignaciones crédito↔cobrador; SureKeep Fase 1 — pista Loan).
|
|
113
|
+
export * as LoanCollectorAssignment from './loanCollectorAssignment';
|
|
111
114
|
export * from './messaging';
|
|
112
115
|
export * from './complaint';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsInt, Max, Min } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Pesos del ranking ponderado del algoritmo (modelo-datos §7.1). Cada peso es 0..100; la regla
|
|
6
|
+
* cross-campo `storeMatch + loadAvailable + seniority === 100` la valida el manager del lambda
|
|
7
|
+
* (WeightsSumInvalidError) — class-validator no cubre validaciones entre campos.
|
|
8
|
+
*/
|
|
9
|
+
export class PriorityWeights {
|
|
10
|
+
@Expose()
|
|
11
|
+
@IsInt()
|
|
12
|
+
@Min(0)
|
|
13
|
+
@Max(100)
|
|
14
|
+
storeMatch!: number;
|
|
15
|
+
|
|
16
|
+
@Expose()
|
|
17
|
+
@IsInt()
|
|
18
|
+
@Min(0)
|
|
19
|
+
@Max(100)
|
|
20
|
+
loadAvailable!: number;
|
|
21
|
+
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsInt()
|
|
24
|
+
@Min(0)
|
|
25
|
+
@Max(100)
|
|
26
|
+
seniority!: number;
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de POST /private/collector-assignments/auto-assign (hot path). Lo invoca loan-credit-business
|
|
6
|
+
* al crearse un crédito (F3+); en F1 se prueba con `creditId` dummy. Elige cobrador y persiste ACTIVE.
|
|
7
|
+
*/
|
|
8
|
+
export class AutoAssignRequest {
|
|
9
|
+
@Expose()
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
retailerId!: string;
|
|
13
|
+
|
|
14
|
+
@Expose()
|
|
15
|
+
@IsString()
|
|
16
|
+
@IsNotEmpty()
|
|
17
|
+
creditId!: string;
|
|
18
|
+
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
storeId!: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsEnum, IsInt, IsOptional, Min, ValidateNested } from 'class-validator';
|
|
3
|
+
import { AssignmentStrategyEnum } from '../../enums/AssignmentStrategyEnum';
|
|
4
|
+
import { PriorityWeights } from '../PriorityWeights';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Body de POST /retailers/:retailerId/assignment-rules. Crea una regla de asignación.
|
|
8
|
+
* Los pesos deben sumar 100 (lo valida el manager). `active: true` desactiva la regla activa anterior.
|
|
9
|
+
*/
|
|
10
|
+
export class CreateAssignmentRuleRequest {
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsEnum(AssignmentStrategyEnum)
|
|
13
|
+
strategy!: AssignmentStrategyEnum;
|
|
14
|
+
|
|
15
|
+
@Expose()
|
|
16
|
+
@IsOptional()
|
|
17
|
+
@IsInt()
|
|
18
|
+
@Min(1)
|
|
19
|
+
maxLoadPerCollector?: number | null;
|
|
20
|
+
|
|
21
|
+
@Expose()
|
|
22
|
+
@ValidateNested()
|
|
23
|
+
@Type(() => PriorityWeights)
|
|
24
|
+
priorityWeights!: PriorityWeights;
|
|
25
|
+
|
|
26
|
+
@Expose()
|
|
27
|
+
@IsBoolean()
|
|
28
|
+
active!: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de POST /retailers/:retailerId/collector-assignments/:assignmentId/reassign (reasignación manual).
|
|
6
|
+
* `reason` obligatorio (auditoría de acción crítica — modelo-datos §10).
|
|
7
|
+
*/
|
|
8
|
+
export class ReassignRequest {
|
|
9
|
+
@Expose()
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
reason!: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Body de POST /retailers/:retailerId/collectors/:userId/redistribute. Redistribuye la cartera activa de
|
|
6
|
+
* un cobrador (ej. al desactivarlo). `reason` obligatorio (ej. `USER_INACTIVATED`) — auditoría §10.
|
|
7
|
+
*/
|
|
8
|
+
export class RedistributeRequest {
|
|
9
|
+
@Expose()
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
reason!: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsEnum, IsInt, IsOptional, Min, ValidateNested } from 'class-validator';
|
|
3
|
+
import { AssignmentStrategyEnum } from '../../enums/AssignmentStrategyEnum';
|
|
4
|
+
import { PriorityWeights } from '../PriorityWeights';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Body de PUT /retailers/:retailerId/assignment-rules/:ruleId. Update parcial: todos los campos opcionales.
|
|
8
|
+
* Si se envían `priorityWeights`, deben sumar 100 (lo valida el manager).
|
|
9
|
+
*/
|
|
10
|
+
export class UpdateAssignmentRuleRequest {
|
|
11
|
+
@Expose()
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@IsEnum(AssignmentStrategyEnum)
|
|
14
|
+
strategy?: AssignmentStrategyEnum;
|
|
15
|
+
|
|
16
|
+
@Expose()
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsInt()
|
|
19
|
+
@Min(1)
|
|
20
|
+
maxLoadPerCollector?: number | null;
|
|
21
|
+
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
@ValidateNested()
|
|
25
|
+
@Type(() => PriorityWeights)
|
|
26
|
+
priorityWeights?: PriorityWeights;
|
|
27
|
+
|
|
28
|
+
@Expose()
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@IsBoolean()
|
|
31
|
+
active?: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssignmentStrategyEnum } from '../../enums/AssignmentStrategyEnum';
|
|
2
|
+
import { PriorityWeights } from '../PriorityWeights';
|
|
3
|
+
|
|
4
|
+
/** Shape de salida de una regla de asignación (modelo-datos §7.1). */
|
|
5
|
+
export interface AssignmentRuleResponse {
|
|
6
|
+
ruleId: string;
|
|
7
|
+
retailerId: string;
|
|
8
|
+
strategy: AssignmentStrategyEnum;
|
|
9
|
+
maxLoadPerCollector: number | null;
|
|
10
|
+
priorityWeights: PriorityWeights;
|
|
11
|
+
active: boolean;
|
|
12
|
+
createdBy: string;
|
|
13
|
+
updatedBy: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AssignmentStatusEnum } from '../../enums/AssignmentStatusEnum';
|
|
2
|
+
|
|
3
|
+
/** Shape de salida de una asignación crédito↔cobrador (modelo-datos §7.2). */
|
|
4
|
+
export interface CollectorAssignmentResponse {
|
|
5
|
+
assignmentId: string;
|
|
6
|
+
retailerId: string;
|
|
7
|
+
creditId: string;
|
|
8
|
+
storeId: string;
|
|
9
|
+
collectorUserId: string;
|
|
10
|
+
assignedAt: string;
|
|
11
|
+
status: AssignmentStatusEnum;
|
|
12
|
+
reassignedFromUserId: string | null;
|
|
13
|
+
createdBy: string;
|
|
14
|
+
updatedBy: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carga actual de un cobrador (flow 07.2 / GET /retailers/:retailerId/collector-loads).
|
|
3
|
+
* `activeAssignments` = COUNT de asignaciones ACTIVE (GSI collectorUserId-assignedAt-index).
|
|
4
|
+
* `threshold` = maxLoadPerCollector de la regla activa (null si no hay tope).
|
|
5
|
+
*/
|
|
6
|
+
export interface CollectorLoadResponse {
|
|
7
|
+
collectorUserId: string;
|
|
8
|
+
activeAssignments: number;
|
|
9
|
+
threshold: number | null;
|
|
10
|
+
storeIds: string[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Resultado de redistribuir la cartera activa de un cobrador (flow 07.4). */
|
|
2
|
+
export interface RedistributeSummaryResponse {
|
|
3
|
+
reassignedCount: number;
|
|
4
|
+
errors: RedistributeError[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface RedistributeError {
|
|
8
|
+
creditId: string;
|
|
9
|
+
reason: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de una asignación crédito↔cobrador (modelo-datos §7.2). Historial append-only:
|
|
3
|
+
* 1 crédito = 1 `ACTIVE`; reasignación → row vieja `REASSIGNED`; release/liquidado → `INACTIVE`.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export enum AssignmentStatusEnum {
|
|
7
|
+
ACTIVE = 'ACTIVE',
|
|
8
|
+
INACTIVE = 'INACTIVE',
|
|
9
|
+
REASSIGNED = 'REASSIGNED',
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estrategia de asignación de cartera de cobranza (modelo-datos §7.1 / M6 §7.5).
|
|
3
|
+
* DEC-008 (loan-collector-assignment): se soportan las 4 + ranking híbrido (strategy + priorityWeights).
|
|
4
|
+
* A RATIFICAR con Jaime/senior: M6 §7.5 solo respalda 3 — `ROUND_ROBIN` es adición del spec 08.
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export enum AssignmentStrategyEnum {
|
|
8
|
+
BY_STORE = 'BY_STORE',
|
|
9
|
+
BY_LOAD = 'BY_LOAD',
|
|
10
|
+
BY_SENIORITY = 'BY_SENIORITY',
|
|
11
|
+
ROUND_ROBIN = 'ROUND_ROBIN',
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Enums
|
|
2
|
+
export * from './enums/AssignmentStrategyEnum';
|
|
3
|
+
export * from './enums/AssignmentStatusEnum';
|
|
4
|
+
|
|
5
|
+
// Shared DTOs
|
|
6
|
+
export * from './dtos/PriorityWeights';
|
|
7
|
+
|
|
8
|
+
// Request DTOs
|
|
9
|
+
export * from './dtos/requests/CreateAssignmentRuleRequest';
|
|
10
|
+
export * from './dtos/requests/UpdateAssignmentRuleRequest';
|
|
11
|
+
export * from './dtos/requests/AutoAssignRequest';
|
|
12
|
+
export * from './dtos/requests/ReassignRequest';
|
|
13
|
+
export * from './dtos/requests/RedistributeRequest';
|
|
14
|
+
|
|
15
|
+
// Response DTOs
|
|
16
|
+
export * from './dtos/responses/AssignmentRuleResponse';
|
|
17
|
+
export * from './dtos/responses/CollectorAssignmentResponse';
|
|
18
|
+
export * from './dtos/responses/CollectorLoadResponse';
|
|
19
|
+
export * from './dtos/responses/RedistributeSummaryResponse';
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Estado operativo de una zona comercial de un retailer.
|
|
3
|
+
*
|
|
4
|
+
* Alineado con `RetailerStatusEnum` / `StoreStatusEnum` / `RetailUserStatusEnum`: los cuatro comparten
|
|
5
|
+
* ACTIVE | SUSPENDED | INACTIVE. `SUSPENDED` se agregó (F1, 2026-07-16) porque Zone era el ÚNICO que no
|
|
6
|
+
* podía expresar la SUSPENSIÓN POR CASCADA: el spec pide que suspender un retailer suspenda POR LECTURA
|
|
7
|
+
* a sus zonas/stores/users (`estadoEfectivo = propio AND cadena de padres`, auto-reversible al
|
|
8
|
+
* reactivar, sin fan-out de escrituras). Sin `SUSPENDED`, la zona solo podía reportar `INACTIVE` — que
|
|
9
|
+
* acá significa **soft-delete** — así que una zona suspendida por su padre aparecería BORRADA.
|
|
10
|
+
* Verificado en dev: con el retailer SUSPENDED, sus stores reportaban SUSPENDED y sus zonas seguían
|
|
11
|
+
* ACTIVE (fuga de la regla de negocio).
|
|
12
|
+
*
|
|
3
13
|
* @enum {string}
|
|
4
14
|
*
|
|
5
15
|
* @property {string} ACTIVE - Zona activa y operando.
|
|
6
|
-
* @property {string}
|
|
16
|
+
* @property {string} SUSPENDED - Suspendida por cascada del padre (REVERSIBLE — no es una baja).
|
|
17
|
+
* @property {string} INACTIVE - Zona dada de baja (soft-delete).
|
|
7
18
|
*/
|
|
8
19
|
export enum ZoneStatusEnum {
|
|
9
20
|
ACTIVE = 'ACTIVE',
|
|
21
|
+
SUSPENDED = 'SUSPENDED',
|
|
10
22
|
INACTIVE = 'INACTIVE',
|
|
11
23
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PoolKind } from '../../rbac/enums/PoolKind';
|
|
2
|
-
/**
|
|
3
|
-
* Shape del `PoolConfigRow` expuesto al caller (BFF M18 / otros lambdas Fiado).
|
|
4
|
-
* Refleja la configuración de un Cognito User Pool registrado en la tabla
|
|
5
|
-
* `PoolConfigs_GT` del lambda `cognito-backoffice-connector`.
|
|
6
|
-
*/
|
|
7
|
-
export declare class PoolConfigResponse {
|
|
8
|
-
userPoolId: string;
|
|
9
|
-
userPoolArn: string;
|
|
10
|
-
region: string;
|
|
11
|
-
poolKind: PoolKind;
|
|
12
|
-
displayName: string;
|
|
13
|
-
appClients: Record<string, {
|
|
14
|
-
clientId: string;
|
|
15
|
-
clientName: string;
|
|
16
|
-
}>;
|
|
17
|
-
status: 'active' | 'deprecated';
|
|
18
|
-
createdAt: number;
|
|
19
|
-
updatedAt: number;
|
|
20
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PoolConfigResponse = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Shape del `PoolConfigRow` expuesto al caller (BFF M18 / otros lambdas Fiado).
|
|
6
|
-
* Refleja la configuración de un Cognito User Pool registrado en la tabla
|
|
7
|
-
* `PoolConfigs_GT` del lambda `cognito-backoffice-connector`.
|
|
8
|
-
*/
|
|
9
|
-
class PoolConfigResponse {
|
|
10
|
-
}
|
|
11
|
-
exports.PoolConfigResponse = PoolConfigResponse;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
|
|
2
|
-
/**
|
|
3
|
-
* Cross-field validator: si `requireMfa: true`, entonces `mfaTypes` debe tener
|
|
4
|
-
* al menos 1 elemento. Si `requireMfa: false`, `mfaTypes` puede ser vacío.
|
|
5
|
-
*
|
|
6
|
-
* Razón: cuando el pool nace con MFA habilitado, el connector llama
|
|
7
|
-
* `SetUserPoolMfaConfigCommand` con la lista de tipos del DTO. Si el array
|
|
8
|
-
* llega vacío con `requireMfa: true`, el SDK rechaza con InvalidParameterException
|
|
9
|
-
* y el pool queda en estado inconsistente (MfaConfiguration:'ON' sin tipos).
|
|
10
|
-
* Mejor rechazar en validación del DTO antes de tocar AWS.
|
|
11
|
-
*
|
|
12
|
-
* Ver pivote v1.4.1 TD-017 cerrado + spec doc §1 R3.
|
|
13
|
-
*/
|
|
14
|
-
export declare class MfaTypesRequiresOne implements ValidatorConstraintInterface {
|
|
15
|
-
validate(mfaTypes: unknown, args: ValidationArguments): boolean;
|
|
16
|
-
defaultMessage(): string;
|
|
17
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.MfaTypesRequiresOne = void 0;
|
|
10
|
-
const class_validator_1 = require("class-validator");
|
|
11
|
-
/**
|
|
12
|
-
* Cross-field validator: si `requireMfa: true`, entonces `mfaTypes` debe tener
|
|
13
|
-
* al menos 1 elemento. Si `requireMfa: false`, `mfaTypes` puede ser vacío.
|
|
14
|
-
*
|
|
15
|
-
* Razón: cuando el pool nace con MFA habilitado, el connector llama
|
|
16
|
-
* `SetUserPoolMfaConfigCommand` con la lista de tipos del DTO. Si el array
|
|
17
|
-
* llega vacío con `requireMfa: true`, el SDK rechaza con InvalidParameterException
|
|
18
|
-
* y el pool queda en estado inconsistente (MfaConfiguration:'ON' sin tipos).
|
|
19
|
-
* Mejor rechazar en validación del DTO antes de tocar AWS.
|
|
20
|
-
*
|
|
21
|
-
* Ver pivote v1.4.1 TD-017 cerrado + spec doc §1 R3.
|
|
22
|
-
*/
|
|
23
|
-
let MfaTypesRequiresOne = class MfaTypesRequiresOne {
|
|
24
|
-
validate(mfaTypes, args) {
|
|
25
|
-
const obj = args.object;
|
|
26
|
-
if (obj.requireMfa === true) {
|
|
27
|
-
return Array.isArray(mfaTypes) && mfaTypes.length >= 1;
|
|
28
|
-
}
|
|
29
|
-
// requireMfa: false → cualquier mfaTypes pasa.
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
defaultMessage() {
|
|
33
|
-
return 'mfaTypes requiere al menos un tipo cuando requireMfa=true';
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
exports.MfaTypesRequiresOne = MfaTypesRequiresOne;
|
|
37
|
-
exports.MfaTypesRequiresOne = MfaTypesRequiresOne = __decorate([
|
|
38
|
-
(0, class_validator_1.ValidatorConstraint)({ name: 'MfaTypesRequiresOneWhenMfaRequired', async: false })
|
|
39
|
-
], MfaTypesRequiresOne);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tipo de User Pool de Cognito desde la perspectiva del modelo RBAC Fiado.
|
|
3
|
-
*
|
|
4
|
-
* Origen: spec del proyecto `cognito-backoffice-connector` (Fase 0, componente 01
|
|
5
|
-
* documento `docs/superpowers/specs/2026-05-26-cognito-connector-decisiones-pendientes-design.md`).
|
|
6
|
-
*
|
|
7
|
-
* Decisión (TD-003): el proyecto converge en estos 2 valores. El documento componente 03
|
|
8
|
-
* lista 3 valores (incluyendo una variante adicional) pero queda como outlier — la
|
|
9
|
-
* decisión vigente en los 6 docs restantes y en el plan de implementación es 2 valores:
|
|
10
|
-
* - BACKOFFICE_PLATFORM — pool del backoffice de plataforma (cross-tenant)
|
|
11
|
-
* - BACKOFFICE_TENANT — pool por tenant (multi-tenant isolation)
|
|
12
|
-
*/
|
|
13
|
-
export declare enum PoolKind {
|
|
14
|
-
BACKOFFICE_PLATFORM = "BACKOFFICE_PLATFORM",
|
|
15
|
-
BACKOFFICE_TENANT = "BACKOFFICE_TENANT"
|
|
16
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PoolKind = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Tipo de User Pool de Cognito desde la perspectiva del modelo RBAC Fiado.
|
|
6
|
-
*
|
|
7
|
-
* Origen: spec del proyecto `cognito-backoffice-connector` (Fase 0, componente 01
|
|
8
|
-
* documento `docs/superpowers/specs/2026-05-26-cognito-connector-decisiones-pendientes-design.md`).
|
|
9
|
-
*
|
|
10
|
-
* Decisión (TD-003): el proyecto converge en estos 2 valores. El documento componente 03
|
|
11
|
-
* lista 3 valores (incluyendo una variante adicional) pero queda como outlier — la
|
|
12
|
-
* decisión vigente en los 6 docs restantes y en el plan de implementación es 2 valores:
|
|
13
|
-
* - BACKOFFICE_PLATFORM — pool del backoffice de plataforma (cross-tenant)
|
|
14
|
-
* - BACKOFFICE_TENANT — pool por tenant (multi-tenant isolation)
|
|
15
|
-
*/
|
|
16
|
-
var PoolKind;
|
|
17
|
-
(function (PoolKind) {
|
|
18
|
-
PoolKind["BACKOFFICE_PLATFORM"] = "BACKOFFICE_PLATFORM";
|
|
19
|
-
PoolKind["BACKOFFICE_TENANT"] = "BACKOFFICE_TENANT";
|
|
20
|
-
})(PoolKind || (exports.PoolKind = PoolKind = {}));
|
package/bin/rbac/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './enums/PoolKind';
|
package/bin/rbac/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./enums/PoolKind"), exports);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
-
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
-
export declare class CancelFundingReferenceResponse {
|
|
4
|
-
fundingId: string;
|
|
5
|
-
status: BenefitPaymentStatusEnum;
|
|
6
|
-
errorCode?: WalletFundingErrorCodeEnum;
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Request del cancel via Centro de Beneficios (spec 13 v2.0).
|
|
3
|
-
* `fundingId` viaja en el path, `directoryId` se resuelve del JWT.
|
|
4
|
-
* `providerModuleName` permite al marketplace rutear al publisher correcto
|
|
5
|
-
* sin tener que persistir el mapping (el wallet-app sabe el moduleName
|
|
6
|
-
* porque vino en la respuesta del authorize).
|
|
7
|
-
*/
|
|
8
|
-
export declare class CancelFundingRequest {
|
|
9
|
-
idempotencyKey: string;
|
|
10
|
-
providerModuleName: string;
|
|
11
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
-
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
-
/**
|
|
4
|
-
* Response del cancel via Centro de Beneficios (spec 13 v2.0).
|
|
5
|
-
* `status` reusa `BenefitPaymentStatusEnum` (APPROVED = cancel aceptado;
|
|
6
|
-
* REJECTED = no se pudo) para consistencia con `CancelFundingReferenceResponse`
|
|
7
|
-
* (marketplace ↔ connector). Idempotente: re-cancelar devuelve APPROVED.
|
|
8
|
-
*/
|
|
9
|
-
export declare class CancelFundingResponse {
|
|
10
|
-
fundingId: string;
|
|
11
|
-
status: BenefitPaymentStatusEnum;
|
|
12
|
-
errorCode?: WalletFundingErrorCodeEnum;
|
|
13
|
-
message?: string;
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CancelFundingResponse = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Response del cancel via Centro de Beneficios (spec 13 v2.0).
|
|
6
|
-
* `status` reusa `BenefitPaymentStatusEnum` (APPROVED = cancel aceptado;
|
|
7
|
-
* REJECTED = no se pudo) para consistencia con `CancelFundingReferenceResponse`
|
|
8
|
-
* (marketplace ↔ connector). Idempotente: re-cancelar devuelve APPROVED.
|
|
9
|
-
*/
|
|
10
|
-
class CancelFundingResponse {
|
|
11
|
-
}
|
|
12
|
-
exports.CancelFundingResponse = CancelFundingResponse;
|