@fiado/type-kit 3.157.0 → 3.158.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/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.d.ts +7 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.js +36 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +20 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +11 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +4 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +6 -0
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.d.ts +17 -0
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.js +39 -0
- package/bin/rbac/enums/PoolKind.d.ts +16 -0
- package/bin/rbac/enums/PoolKind.js +20 -0
- package/bin/rbac/index.d.ts +1 -0
- package/bin/rbac/index.js +17 -0
- package/bin/remittance/dtos/RemittancePricingTable.d.ts +41 -0
- package/bin/remittance/dtos/RemittancePricingTable.js +16 -0
- package/bin/remittance/dtos/RemittanceRule.d.ts +65 -0
- package/bin/remittance/dtos/RemittanceRule.js +107 -0
- package/bin/remittance/dtos/index.d.ts +2 -0
- package/bin/remittance/dtos/index.js +2 -0
- package/bin/remittance/enums/AuditAction.d.ts +2 -1
- package/bin/remittance/enums/AuditAction.js +1 -0
- package/bin/remittance/enums/RuleActionType.d.ts +9 -0
- package/bin/remittance/enums/RuleActionType.js +13 -0
- package/bin/remittance/enums/RuleCategory.d.ts +9 -0
- package/bin/remittance/enums/RuleCategory.js +13 -0
- package/bin/remittance/enums/RuleField.d.ts +13 -0
- package/bin/remittance/enums/RuleField.js +17 -0
- package/bin/remittance/enums/RuleOperator.d.ts +7 -0
- package/bin/remittance/enums/RuleOperator.js +11 -0
- package/bin/remittance/enums/index.d.ts +4 -0
- package/bin/remittance/enums/index.js +4 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +1 -10
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.js +3 -13
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +1 -9
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +0 -7
- package/bin/walletFunding/dtos/CancelFundingRequest.d.ts +11 -0
- package/bin/{platformRbac/dtos/CompleteMyProfileRequest.js → walletFunding/dtos/CancelFundingRequest.js} +14 -15
- package/bin/walletFunding/dtos/CancelFundingResponse.d.ts +14 -0
- package/bin/walletFunding/dtos/CancelFundingResponse.js +12 -0
- package/package.json +1 -1
- package/src/remittance/dtos/RemittancePricingTable.ts +44 -0
- package/src/remittance/dtos/RemittanceRule.ts +114 -0
- package/src/remittance/dtos/index.ts +2 -0
- package/src/remittance/enums/AuditAction.ts +1 -0
- package/src/remittance/enums/RuleActionType.ts +9 -0
- package/src/remittance/enums/RuleCategory.ts +9 -0
- package/src/remittance/enums/RuleField.ts +13 -0
- package/src/remittance/enums/RuleOperator.ts +7 -0
- package/src/remittance/enums/index.ts +4 -0
- package/bin/platformRbac/dtos/CompleteMyProfileRequest.d.ts +0 -9
|
@@ -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.MfaPoolConfig = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const MfaTypesRequiresOne_1 = require("../validators/MfaTypesRequiresOne");
|
|
16
|
+
// EMAIL_OTP removido (3.41.0): el cognito-backoffice-connector no provisiona
|
|
17
|
+
// EmailMfaConfiguration a nivel pool (requiere infra SES que no está montada
|
|
18
|
+
// y la integración con messages-lambda aún no tiene diseño). Ver TD-020 +
|
|
19
|
+
// DEC-001 en cognito-backoffice-connector/docs/. Si se reintroduce, agregar
|
|
20
|
+
// 'EMAIL_OTP' a este array.
|
|
21
|
+
const ALLOWED_MFA_TYPES = ['SOFTWARE_TOKEN_MFA'];
|
|
22
|
+
class MfaPoolConfig {
|
|
23
|
+
}
|
|
24
|
+
exports.MfaPoolConfig = MfaPoolConfig;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsBoolean)(),
|
|
28
|
+
__metadata("design:type", Boolean)
|
|
29
|
+
], MfaPoolConfig.prototype, "requireMfa", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
(0, class_validator_1.IsArray)(),
|
|
33
|
+
(0, class_validator_1.IsIn)(ALLOWED_MFA_TYPES, { each: true }),
|
|
34
|
+
(0, class_validator_1.Validate)(MfaTypesRequiresOne_1.MfaTypesRequiresOne),
|
|
35
|
+
__metadata("design:type", Array)
|
|
36
|
+
], MfaPoolConfig.prototype, "mfaTypes", void 0);
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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);
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums/PoolKind';
|
|
@@ -0,0 +1,17 @@
|
|
|
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);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PromotionKind } from "../enums/PromotionKind";
|
|
2
|
+
import { PromotionStatus } from "../enums/PromotionStatus";
|
|
3
|
+
import { RemittanceCorridor } from "../enums/RemittanceCorridor";
|
|
4
|
+
/**
|
|
5
|
+
* DTOs de la Tabla completa (Dashboard Ops · Variables Operativas §4). Vista
|
|
6
|
+
* COMPUTADA read-only (sin tabla en DDB): Precio Base × Promociones expandido por
|
|
7
|
+
* tramo. Cada fila de promo = la promo aplicada SOLA sobre la base (escenario
|
|
8
|
+
* unitario, NO el resolver). Dueño del cómputo: remittance-business.
|
|
9
|
+
*/
|
|
10
|
+
/** Fila: (combinación × tramo) × (Base | una promo aplicada sola). */
|
|
11
|
+
export declare class PricingTableRow {
|
|
12
|
+
corridor: RemittanceCorridor;
|
|
13
|
+
segmentId: string;
|
|
14
|
+
segmentName: string;
|
|
15
|
+
/** null = fila Base. */
|
|
16
|
+
promoId: string | null;
|
|
17
|
+
/** El front pinta "Base" en cursiva si null. */
|
|
18
|
+
promoName: string | null;
|
|
19
|
+
/** Columna TIPO (badge); null = Base. */
|
|
20
|
+
kind: PromotionKind | null;
|
|
21
|
+
/** Columna CÓDIGO. */
|
|
22
|
+
code: string | null;
|
|
23
|
+
/** Columna AUD. ADICIONAL: la dimensión que restringe MÁS ALLÁ de la combinación (hoy: cohortName). null = sin restricción. */
|
|
24
|
+
additionalAudience: string | null;
|
|
25
|
+
/** Columna VIGENCIA (badge): ACTIVE | PERMANENT | SCHEDULED; null = Base. */
|
|
26
|
+
promoStatus: PromotionStatus | null;
|
|
27
|
+
/** "$1 – $49" / "$500+". */
|
|
28
|
+
tierLabel: string;
|
|
29
|
+
amountMin: number;
|
|
30
|
+
amountMax: number | null;
|
|
31
|
+
muEffectiveBps: number;
|
|
32
|
+
feeEffectiveUsd: number;
|
|
33
|
+
/** Para pintar en verde SOLO lo que la promo cambió. */
|
|
34
|
+
muChanged: boolean;
|
|
35
|
+
feeChanged: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare class PricingTableResponse {
|
|
38
|
+
items: PricingTableRow[];
|
|
39
|
+
/** ISO — "computed at". */
|
|
40
|
+
generatedAt: string;
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PricingTableResponse = exports.PricingTableRow = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* DTOs de la Tabla completa (Dashboard Ops · Variables Operativas §4). Vista
|
|
6
|
+
* COMPUTADA read-only (sin tabla en DDB): Precio Base × Promociones expandido por
|
|
7
|
+
* tramo. Cada fila de promo = la promo aplicada SOLA sobre la base (escenario
|
|
8
|
+
* unitario, NO el resolver). Dueño del cómputo: remittance-business.
|
|
9
|
+
*/
|
|
10
|
+
/** Fila: (combinación × tramo) × (Base | una promo aplicada sola). */
|
|
11
|
+
class PricingTableRow {
|
|
12
|
+
}
|
|
13
|
+
exports.PricingTableRow = PricingTableRow;
|
|
14
|
+
class PricingTableResponse {
|
|
15
|
+
}
|
|
16
|
+
exports.PricingTableResponse = PricingTableResponse;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { RuleActionType } from "../enums/RuleActionType";
|
|
2
|
+
import { RuleCategory } from "../enums/RuleCategory";
|
|
3
|
+
import { RuleField } from "../enums/RuleField";
|
|
4
|
+
import { RuleOperator } from "../enums/RuleOperator";
|
|
5
|
+
import { RemittanceCorridor } from "../enums/RemittanceCorridor";
|
|
6
|
+
/**
|
|
7
|
+
* DTOs de Reglas (Dashboard Ops · Variables Operativas §3). Barandas del pricing:
|
|
8
|
+
* CAP (fuerza al límite / bloquea save), VALIDATION (bloquea save), ALARM (notifica
|
|
9
|
+
* a un comité). Dueño de la tabla: remittance-business (RemittanceRules_GT). La
|
|
10
|
+
* coherencia campo×categoría×acción es cross-field → la valida el manager, no
|
|
11
|
+
* class-validator. El enforcement POR TX (clamps) es Fase B; Fase A = al guardar config.
|
|
12
|
+
*/
|
|
13
|
+
/** Alcance: campo AUSENTE = "aplica a todas" (mockup: "Vacío en una dimensión = aplica a todas"). */
|
|
14
|
+
export declare class RuleScope {
|
|
15
|
+
corridor?: RemittanceCorridor;
|
|
16
|
+
segmentId?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class CreateRuleRequest {
|
|
19
|
+
name: string;
|
|
20
|
+
category: RuleCategory;
|
|
21
|
+
active: boolean;
|
|
22
|
+
conditionField: RuleField;
|
|
23
|
+
conditionOp: RuleOperator;
|
|
24
|
+
conditionValue: number;
|
|
25
|
+
actionType: RuleActionType;
|
|
26
|
+
/** Requerido si actionType=NOTIFY (regla en el manager); id de RemittanceCommittees_GT. */
|
|
27
|
+
committeeId?: string;
|
|
28
|
+
actionMessage?: string;
|
|
29
|
+
scope: RuleScope;
|
|
30
|
+
description?: string;
|
|
31
|
+
}
|
|
32
|
+
/** PUT — reemplazo completo (incluye el toggle `active`). */
|
|
33
|
+
export declare class UpdateRuleRequest extends CreateRuleRequest {
|
|
34
|
+
}
|
|
35
|
+
/** Regla completa (response). */
|
|
36
|
+
export declare class Rule {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
category: RuleCategory;
|
|
40
|
+
active: boolean;
|
|
41
|
+
description: string | null;
|
|
42
|
+
conditionField: RuleField;
|
|
43
|
+
conditionOp: RuleOperator;
|
|
44
|
+
conditionValue: number;
|
|
45
|
+
actionType: RuleActionType;
|
|
46
|
+
committeeId: string | null;
|
|
47
|
+
/** Display resuelto del comité (null si no NOTIFY o no resoluble). */
|
|
48
|
+
committeeName: string | null;
|
|
49
|
+
actionMessage: string | null;
|
|
50
|
+
scope: {
|
|
51
|
+
corridor: RemittanceCorridor | null;
|
|
52
|
+
segmentId: string | null;
|
|
53
|
+
};
|
|
54
|
+
/** Display resuelto del segmento del alcance. */
|
|
55
|
+
scopeSegmentName: string | null;
|
|
56
|
+
/** Disparos del mes corriente (0 si el contador es de un mes anterior). Columna DISP.(MES). */
|
|
57
|
+
triggersMonth: number;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
createdBy: string;
|
|
61
|
+
updatedBy: string;
|
|
62
|
+
}
|
|
63
|
+
export declare class RuleListResponse {
|
|
64
|
+
items: Rule[];
|
|
65
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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.RuleListResponse = exports.Rule = exports.UpdateRuleRequest = exports.CreateRuleRequest = exports.RuleScope = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const RuleActionType_1 = require("../enums/RuleActionType");
|
|
16
|
+
const RuleCategory_1 = require("../enums/RuleCategory");
|
|
17
|
+
const RuleField_1 = require("../enums/RuleField");
|
|
18
|
+
const RuleOperator_1 = require("../enums/RuleOperator");
|
|
19
|
+
const RemittanceCorridor_1 = require("../enums/RemittanceCorridor");
|
|
20
|
+
/**
|
|
21
|
+
* DTOs de Reglas (Dashboard Ops · Variables Operativas §3). Barandas del pricing:
|
|
22
|
+
* CAP (fuerza al límite / bloquea save), VALIDATION (bloquea save), ALARM (notifica
|
|
23
|
+
* a un comité). Dueño de la tabla: remittance-business (RemittanceRules_GT). La
|
|
24
|
+
* coherencia campo×categoría×acción es cross-field → la valida el manager, no
|
|
25
|
+
* class-validator. El enforcement POR TX (clamps) es Fase B; Fase A = al guardar config.
|
|
26
|
+
*/
|
|
27
|
+
/** Alcance: campo AUSENTE = "aplica a todas" (mockup: "Vacío en una dimensión = aplica a todas"). */
|
|
28
|
+
class RuleScope {
|
|
29
|
+
}
|
|
30
|
+
exports.RuleScope = RuleScope;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsEnum)(RemittanceCorridor_1.RemittanceCorridor),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], RuleScope.prototype, "corridor", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.IsString)(),
|
|
39
|
+
(0, class_validator_1.Length)(1, 100),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], RuleScope.prototype, "segmentId", void 0);
|
|
42
|
+
class CreateRuleRequest {
|
|
43
|
+
}
|
|
44
|
+
exports.CreateRuleRequest = CreateRuleRequest;
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsString)(),
|
|
47
|
+
(0, class_validator_1.Length)(3, 100),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], CreateRuleRequest.prototype, "name", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsEnum)(RuleCategory_1.RuleCategory),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], CreateRuleRequest.prototype, "category", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_validator_1.IsBoolean)(),
|
|
56
|
+
__metadata("design:type", Boolean)
|
|
57
|
+
], CreateRuleRequest.prototype, "active", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsEnum)(RuleField_1.RuleField),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], CreateRuleRequest.prototype, "conditionField", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_validator_1.IsEnum)(RuleOperator_1.RuleOperator),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], CreateRuleRequest.prototype, "conditionOp", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsNumber)(),
|
|
68
|
+
__metadata("design:type", Number)
|
|
69
|
+
], CreateRuleRequest.prototype, "conditionValue", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_validator_1.IsEnum)(RuleActionType_1.RuleActionType),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], CreateRuleRequest.prototype, "actionType", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
(0, class_validator_1.IsString)(),
|
|
77
|
+
(0, class_validator_1.Length)(1, 100),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], CreateRuleRequest.prototype, "committeeId", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, class_validator_1.IsOptional)(),
|
|
82
|
+
(0, class_validator_1.IsString)(),
|
|
83
|
+
(0, class_validator_1.MaxLength)(300),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], CreateRuleRequest.prototype, "actionMessage", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.ValidateNested)(),
|
|
88
|
+
(0, class_transformer_1.Type)(() => RuleScope),
|
|
89
|
+
__metadata("design:type", RuleScope)
|
|
90
|
+
], CreateRuleRequest.prototype, "scope", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, class_validator_1.IsOptional)(),
|
|
93
|
+
(0, class_validator_1.IsString)(),
|
|
94
|
+
(0, class_validator_1.MaxLength)(500),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], CreateRuleRequest.prototype, "description", void 0);
|
|
97
|
+
/** PUT — reemplazo completo (incluye el toggle `active`). */
|
|
98
|
+
class UpdateRuleRequest extends CreateRuleRequest {
|
|
99
|
+
}
|
|
100
|
+
exports.UpdateRuleRequest = UpdateRuleRequest;
|
|
101
|
+
/** Regla completa (response). */
|
|
102
|
+
class Rule {
|
|
103
|
+
}
|
|
104
|
+
exports.Rule = Rule;
|
|
105
|
+
class RuleListResponse {
|
|
106
|
+
}
|
|
107
|
+
exports.RuleListResponse = RuleListResponse;
|
|
@@ -58,3 +58,5 @@ __exportStar(require("./RemittanceSegment"), exports);
|
|
|
58
58
|
__exportStar(require("./RemittanceCommittee"), exports);
|
|
59
59
|
__exportStar(require("./RemittancePricing"), exports);
|
|
60
60
|
__exportStar(require("./RemittancePromotion"), exports);
|
|
61
|
+
__exportStar(require("./RemittanceRule"), exports);
|
|
62
|
+
__exportStar(require("./RemittancePricingTable"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Acción cuando la condición se rompe. */
|
|
2
|
+
export declare enum RuleActionType {
|
|
3
|
+
/** Fuerza al valor permitido (el valor de la condición) y procede. Solo caps clampeables, per-tx. */
|
|
4
|
+
FORCE_LIMIT = "FORCE_LIMIT",
|
|
5
|
+
/** Bloquea el guardado / rechaza la tx. */
|
|
6
|
+
BLOCK = "BLOCK",
|
|
7
|
+
/** Permite pero notifica a un comité. Exclusivo de ALARM. */
|
|
8
|
+
NOTIFY = "NOTIFY"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuleActionType = void 0;
|
|
4
|
+
/** Acción cuando la condición se rompe. */
|
|
5
|
+
var RuleActionType;
|
|
6
|
+
(function (RuleActionType) {
|
|
7
|
+
/** Fuerza al valor permitido (el valor de la condición) y procede. Solo caps clampeables, per-tx. */
|
|
8
|
+
RuleActionType["FORCE_LIMIT"] = "FORCE_LIMIT";
|
|
9
|
+
/** Bloquea el guardado / rechaza la tx. */
|
|
10
|
+
RuleActionType["BLOCK"] = "BLOCK";
|
|
11
|
+
/** Permite pero notifica a un comité. Exclusivo de ALARM. */
|
|
12
|
+
RuleActionType["NOTIFY"] = "NOTIFY";
|
|
13
|
+
})(RuleActionType || (exports.RuleActionType = RuleActionType = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Categoría de la regla (Variables Operativas › Reglas — mockup). */
|
|
2
|
+
export declare enum RuleCategory {
|
|
3
|
+
/** Límite duro: fuerza al valor permitido (per-tx) o bloquea el save de config. */
|
|
4
|
+
CAP = "CAP",
|
|
5
|
+
/** Bloquea el guardado si la condición se rompe. */
|
|
6
|
+
VALIDATION = "VALIDATION",
|
|
7
|
+
/** Permite pero notifica al comité correspondiente. */
|
|
8
|
+
ALARM = "ALARM"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuleCategory = void 0;
|
|
4
|
+
/** Categoría de la regla (Variables Operativas › Reglas — mockup). */
|
|
5
|
+
var RuleCategory;
|
|
6
|
+
(function (RuleCategory) {
|
|
7
|
+
/** Límite duro: fuerza al valor permitido (per-tx) o bloquea el save de config. */
|
|
8
|
+
RuleCategory["CAP"] = "CAP";
|
|
9
|
+
/** Bloquea el guardado si la condición se rompe. */
|
|
10
|
+
RuleCategory["VALIDATION"] = "VALIDATION";
|
|
11
|
+
/** Permite pero notifica al comité correspondiente. */
|
|
12
|
+
RuleCategory["ALARM"] = "ALARM";
|
|
13
|
+
})(RuleCategory || (exports.RuleCategory = RuleCategory = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Campo de la condición (los 6 del mockup). Todos numéricos. "efectivo" = después
|
|
3
|
+
* de aplicar promos. TAKE_RATE es "Spread efectivo" redefinido (D-RG-1):
|
|
4
|
+
* MU + round(fee/monto × 10000) = cuánto le saca Fiado al cliente EN TOTAL.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum RuleField {
|
|
7
|
+
FEE_EFFECTIVE = "FEE_EFFECTIVE",// USD
|
|
8
|
+
MU_EFFECTIVE = "MU_EFFECTIVE",// bps
|
|
9
|
+
TAKE_RATE = "TAKE_RATE",// bps
|
|
10
|
+
TX_AMOUNT = "TX_AMOUNT",// USD — solo por tx (Fase B)
|
|
11
|
+
MU_CHANGE_24H = "MU_CHANGE_24H",// % — solo alarma, config-save
|
|
12
|
+
PROMO_VOLUME_SHARE = "PROMO_VOLUME_SHARE"
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuleField = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Campo de la condición (los 6 del mockup). Todos numéricos. "efectivo" = después
|
|
6
|
+
* de aplicar promos. TAKE_RATE es "Spread efectivo" redefinido (D-RG-1):
|
|
7
|
+
* MU + round(fee/monto × 10000) = cuánto le saca Fiado al cliente EN TOTAL.
|
|
8
|
+
*/
|
|
9
|
+
var RuleField;
|
|
10
|
+
(function (RuleField) {
|
|
11
|
+
RuleField["FEE_EFFECTIVE"] = "FEE_EFFECTIVE";
|
|
12
|
+
RuleField["MU_EFFECTIVE"] = "MU_EFFECTIVE";
|
|
13
|
+
RuleField["TAKE_RATE"] = "TAKE_RATE";
|
|
14
|
+
RuleField["TX_AMOUNT"] = "TX_AMOUNT";
|
|
15
|
+
RuleField["MU_CHANGE_24H"] = "MU_CHANGE_24H";
|
|
16
|
+
RuleField["PROMO_VOLUME_SHARE"] = "PROMO_VOLUME_SHARE";
|
|
17
|
+
})(RuleField || (exports.RuleField = RuleField = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuleOperator = void 0;
|
|
4
|
+
/** Operadores de la condición: SOLO de orden (con 6 campos numéricos, ==/in no aportan y "forzar al límite" exige orden). */
|
|
5
|
+
var RuleOperator;
|
|
6
|
+
(function (RuleOperator) {
|
|
7
|
+
RuleOperator["GT"] = ">";
|
|
8
|
+
RuleOperator["GTE"] = ">=";
|
|
9
|
+
RuleOperator["LT"] = "<";
|
|
10
|
+
RuleOperator["LTE"] = "<=";
|
|
11
|
+
})(RuleOperator || (exports.RuleOperator = RuleOperator = {}));
|
|
@@ -17,3 +17,7 @@ export * from "./PromotionActivation";
|
|
|
17
17
|
export * from "./PromotionStatus";
|
|
18
18
|
export * from "./FxEffectMode";
|
|
19
19
|
export * from "./FeeEffectMode";
|
|
20
|
+
export * from "./RuleCategory";
|
|
21
|
+
export * from "./RuleField";
|
|
22
|
+
export * from "./RuleOperator";
|
|
23
|
+
export * from "./RuleActionType";
|
|
@@ -33,3 +33,7 @@ __exportStar(require("./PromotionActivation"), exports);
|
|
|
33
33
|
__exportStar(require("./PromotionStatus"), exports);
|
|
34
34
|
__exportStar(require("./FxEffectMode"), exports);
|
|
35
35
|
__exportStar(require("./FeeEffectMode"), exports);
|
|
36
|
+
__exportStar(require("./RuleCategory"), exports);
|
|
37
|
+
__exportStar(require("./RuleField"), exports);
|
|
38
|
+
__exportStar(require("./RuleOperator"), exports);
|
|
39
|
+
__exportStar(require("./RuleActionType"), exports);
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Body para cancelar una referencia de funding ya creada. La referencia/fundingId
|
|
3
|
-
* viaja en la URL (`/funding/{moduleName}/{fundingId}/cancel`); este body aporta
|
|
4
|
-
* el contexto del solicitante + idempotencia.
|
|
5
|
-
*
|
|
6
|
-
* NOTA: shape inferido desde el uso en `@fiado/api-invoker`
|
|
7
|
-
* (benefits-marketplace / equality-connector) — confirmar con el dueño del
|
|
8
|
-
* módulo walletFunding / el lambda equality-connector que implementa el cancel.
|
|
9
|
-
*/
|
|
10
1
|
export declare class CancelFundingReferenceRequest {
|
|
2
|
+
fundingId: string;
|
|
11
3
|
directoryId: string;
|
|
12
|
-
reason?: string;
|
|
13
4
|
idempotencyKey: string;
|
|
14
5
|
}
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CancelFundingReferenceRequest = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
-
/**
|
|
15
|
-
* Body para cancelar una referencia de funding ya creada. La referencia/fundingId
|
|
16
|
-
* viaja en la URL (`/funding/{moduleName}/{fundingId}/cancel`); este body aporta
|
|
17
|
-
* el contexto del solicitante + idempotencia.
|
|
18
|
-
*
|
|
19
|
-
* NOTA: shape inferido desde el uso en `@fiado/api-invoker`
|
|
20
|
-
* (benefits-marketplace / equality-connector) — confirmar con el dueño del
|
|
21
|
-
* módulo walletFunding / el lambda equality-connector que implementa el cancel.
|
|
22
|
-
*/
|
|
23
14
|
class CancelFundingReferenceRequest {
|
|
24
15
|
}
|
|
25
16
|
exports.CancelFundingReferenceRequest = CancelFundingReferenceRequest;
|
|
@@ -27,13 +18,12 @@ __decorate([
|
|
|
27
18
|
(0, class_validator_1.IsString)(),
|
|
28
19
|
(0, class_validator_1.MaxLength)(64),
|
|
29
20
|
__metadata("design:type", String)
|
|
30
|
-
], CancelFundingReferenceRequest.prototype, "
|
|
21
|
+
], CancelFundingReferenceRequest.prototype, "fundingId", void 0);
|
|
31
22
|
__decorate([
|
|
32
|
-
(0, class_validator_1.IsOptional)(),
|
|
33
23
|
(0, class_validator_1.IsString)(),
|
|
34
|
-
(0, class_validator_1.MaxLength)(
|
|
24
|
+
(0, class_validator_1.MaxLength)(64),
|
|
35
25
|
__metadata("design:type", String)
|
|
36
|
-
], CancelFundingReferenceRequest.prototype, "
|
|
26
|
+
], CancelFundingReferenceRequest.prototype, "directoryId", void 0);
|
|
37
27
|
__decorate([
|
|
38
28
|
(0, class_validator_1.IsString)(),
|
|
39
29
|
(0, class_validator_1.MaxLength)(64),
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
2
|
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
-
/**
|
|
4
|
-
* Respuesta de la cancelación de una referencia de funding. Mismo estilo que
|
|
5
|
-
* CreateFundingReferenceResponse.
|
|
6
|
-
*
|
|
7
|
-
* NOTA: shape inferido desde el uso en `@fiado/api-invoker` — confirmar con el
|
|
8
|
-
* dueño del módulo walletFunding / el lambda equality-connector.
|
|
9
|
-
*/
|
|
10
3
|
export declare class CancelFundingReferenceResponse {
|
|
11
|
-
|
|
12
|
-
reference: string;
|
|
4
|
+
fundingId: string;
|
|
13
5
|
status: BenefitPaymentStatusEnum;
|
|
14
6
|
errorCode?: WalletFundingErrorCodeEnum;
|
|
15
7
|
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CancelFundingReferenceResponse = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Respuesta de la cancelación de una referencia de funding. Mismo estilo que
|
|
6
|
-
* CreateFundingReferenceResponse.
|
|
7
|
-
*
|
|
8
|
-
* NOTA: shape inferido desde el uso en `@fiado/api-invoker` — confirmar con el
|
|
9
|
-
* dueño del módulo walletFunding / el lambda equality-connector.
|
|
10
|
-
*/
|
|
11
4
|
class CancelFundingReferenceResponse {
|
|
12
5
|
}
|
|
13
6
|
exports.CancelFundingReferenceResponse = CancelFundingReferenceResponse;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -9,26 +9,25 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
const class_transformer_1 = require("class-transformer");
|
|
12
|
+
exports.CancelFundingRequest = void 0;
|
|
14
13
|
const class_validator_1 = require("class-validator");
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* Request del cancel via Centro de Beneficios (spec 13 v2.0).
|
|
16
|
+
* `fundingId` viaja en el path, `directoryId` se resuelve del JWT.
|
|
17
|
+
* `providerModuleName` permite al marketplace rutear al publisher correcto
|
|
18
|
+
* sin tener que persistir el mapping (el wallet-app sabe el moduleName
|
|
19
|
+
* porque vino en la respuesta del authorize).
|
|
19
20
|
*/
|
|
20
|
-
class
|
|
21
|
+
class CancelFundingRequest {
|
|
21
22
|
}
|
|
22
|
-
exports.
|
|
23
|
+
exports.CancelFundingRequest = CancelFundingRequest;
|
|
23
24
|
__decorate([
|
|
24
|
-
(0, class_transformer_1.Expose)(),
|
|
25
25
|
(0, class_validator_1.IsString)(),
|
|
26
|
-
(0, class_validator_1.
|
|
26
|
+
(0, class_validator_1.MaxLength)(64),
|
|
27
27
|
__metadata("design:type", String)
|
|
28
|
-
],
|
|
28
|
+
], CancelFundingRequest.prototype, "idempotencyKey", void 0);
|
|
29
29
|
__decorate([
|
|
30
|
-
(0,
|
|
31
|
-
(0, class_validator_1.
|
|
32
|
-
(
|
|
33
|
-
|
|
34
|
-
], CompleteMyProfileRequest.prototype, "customFields", void 0);
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.MaxLength)(128),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CancelFundingRequest.prototype, "providerModuleName", void 0);
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
package/package.json
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PromotionKind } from "../enums/PromotionKind";
|
|
2
|
+
import { PromotionStatus } from "../enums/PromotionStatus";
|
|
3
|
+
import { RemittanceCorridor } from "../enums/RemittanceCorridor";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* DTOs de la Tabla completa (Dashboard Ops · Variables Operativas §4). Vista
|
|
7
|
+
* COMPUTADA read-only (sin tabla en DDB): Precio Base × Promociones expandido por
|
|
8
|
+
* tramo. Cada fila de promo = la promo aplicada SOLA sobre la base (escenario
|
|
9
|
+
* unitario, NO el resolver). Dueño del cómputo: remittance-business.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** Fila: (combinación × tramo) × (Base | una promo aplicada sola). */
|
|
13
|
+
export class PricingTableRow {
|
|
14
|
+
corridor!: RemittanceCorridor;
|
|
15
|
+
segmentId!: string;
|
|
16
|
+
segmentName!: string;
|
|
17
|
+
/** null = fila Base. */
|
|
18
|
+
promoId!: string | null;
|
|
19
|
+
/** El front pinta "Base" en cursiva si null. */
|
|
20
|
+
promoName!: string | null;
|
|
21
|
+
/** Columna TIPO (badge); null = Base. */
|
|
22
|
+
kind!: PromotionKind | null;
|
|
23
|
+
/** Columna CÓDIGO. */
|
|
24
|
+
code!: string | null;
|
|
25
|
+
/** Columna AUD. ADICIONAL: la dimensión que restringe MÁS ALLÁ de la combinación (hoy: cohortName). null = sin restricción. */
|
|
26
|
+
additionalAudience!: string | null;
|
|
27
|
+
/** Columna VIGENCIA (badge): ACTIVE | PERMANENT | SCHEDULED; null = Base. */
|
|
28
|
+
promoStatus!: PromotionStatus | null;
|
|
29
|
+
/** "$1 – $49" / "$500+". */
|
|
30
|
+
tierLabel!: string;
|
|
31
|
+
amountMin!: number;
|
|
32
|
+
amountMax!: number | null;
|
|
33
|
+
muEffectiveBps!: number;
|
|
34
|
+
feeEffectiveUsd!: number;
|
|
35
|
+
/** Para pintar en verde SOLO lo que la promo cambió. */
|
|
36
|
+
muChanged!: boolean;
|
|
37
|
+
feeChanged!: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class PricingTableResponse {
|
|
41
|
+
items!: PricingTableRow[];
|
|
42
|
+
/** ISO — "computed at". */
|
|
43
|
+
generatedAt!: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Type } from "class-transformer";
|
|
2
|
+
import {
|
|
3
|
+
IsBoolean,
|
|
4
|
+
IsEnum,
|
|
5
|
+
IsNumber,
|
|
6
|
+
IsOptional,
|
|
7
|
+
IsString,
|
|
8
|
+
Length,
|
|
9
|
+
MaxLength,
|
|
10
|
+
ValidateNested,
|
|
11
|
+
} from "class-validator";
|
|
12
|
+
import { RuleActionType } from "../enums/RuleActionType";
|
|
13
|
+
import { RuleCategory } from "../enums/RuleCategory";
|
|
14
|
+
import { RuleField } from "../enums/RuleField";
|
|
15
|
+
import { RuleOperator } from "../enums/RuleOperator";
|
|
16
|
+
import { RemittanceCorridor } from "../enums/RemittanceCorridor";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* DTOs de Reglas (Dashboard Ops · Variables Operativas §3). Barandas del pricing:
|
|
20
|
+
* CAP (fuerza al límite / bloquea save), VALIDATION (bloquea save), ALARM (notifica
|
|
21
|
+
* a un comité). Dueño de la tabla: remittance-business (RemittanceRules_GT). La
|
|
22
|
+
* coherencia campo×categoría×acción es cross-field → la valida el manager, no
|
|
23
|
+
* class-validator. El enforcement POR TX (clamps) es Fase B; Fase A = al guardar config.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/** Alcance: campo AUSENTE = "aplica a todas" (mockup: "Vacío en una dimensión = aplica a todas"). */
|
|
27
|
+
export class RuleScope {
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsEnum(RemittanceCorridor)
|
|
30
|
+
corridor?: RemittanceCorridor;
|
|
31
|
+
|
|
32
|
+
@IsOptional()
|
|
33
|
+
@IsString()
|
|
34
|
+
@Length(1, 100)
|
|
35
|
+
segmentId?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class CreateRuleRequest {
|
|
39
|
+
@IsString()
|
|
40
|
+
@Length(3, 100)
|
|
41
|
+
name!: string;
|
|
42
|
+
|
|
43
|
+
@IsEnum(RuleCategory)
|
|
44
|
+
category!: RuleCategory;
|
|
45
|
+
|
|
46
|
+
@IsBoolean()
|
|
47
|
+
active!: boolean;
|
|
48
|
+
|
|
49
|
+
@IsEnum(RuleField)
|
|
50
|
+
conditionField!: RuleField;
|
|
51
|
+
|
|
52
|
+
@IsEnum(RuleOperator)
|
|
53
|
+
conditionOp!: RuleOperator;
|
|
54
|
+
|
|
55
|
+
@IsNumber()
|
|
56
|
+
conditionValue!: number;
|
|
57
|
+
|
|
58
|
+
@IsEnum(RuleActionType)
|
|
59
|
+
actionType!: RuleActionType;
|
|
60
|
+
|
|
61
|
+
/** Requerido si actionType=NOTIFY (regla en el manager); id de RemittanceCommittees_GT. */
|
|
62
|
+
@IsOptional()
|
|
63
|
+
@IsString()
|
|
64
|
+
@Length(1, 100)
|
|
65
|
+
committeeId?: string;
|
|
66
|
+
|
|
67
|
+
@IsOptional()
|
|
68
|
+
@IsString()
|
|
69
|
+
@MaxLength(300)
|
|
70
|
+
actionMessage?: string;
|
|
71
|
+
|
|
72
|
+
@ValidateNested()
|
|
73
|
+
@Type(() => RuleScope)
|
|
74
|
+
scope!: RuleScope;
|
|
75
|
+
|
|
76
|
+
@IsOptional()
|
|
77
|
+
@IsString()
|
|
78
|
+
@MaxLength(500)
|
|
79
|
+
description?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** PUT — reemplazo completo (incluye el toggle `active`). */
|
|
83
|
+
export class UpdateRuleRequest extends CreateRuleRequest {
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Regla completa (response). */
|
|
87
|
+
export class Rule {
|
|
88
|
+
id!: string;
|
|
89
|
+
name!: string;
|
|
90
|
+
category!: RuleCategory;
|
|
91
|
+
active!: boolean;
|
|
92
|
+
description!: string | null;
|
|
93
|
+
conditionField!: RuleField;
|
|
94
|
+
conditionOp!: RuleOperator;
|
|
95
|
+
conditionValue!: number;
|
|
96
|
+
actionType!: RuleActionType;
|
|
97
|
+
committeeId!: string | null;
|
|
98
|
+
/** Display resuelto del comité (null si no NOTIFY o no resoluble). */
|
|
99
|
+
committeeName!: string | null;
|
|
100
|
+
actionMessage!: string | null;
|
|
101
|
+
scope!: { corridor: RemittanceCorridor | null; segmentId: string | null };
|
|
102
|
+
/** Display resuelto del segmento del alcance. */
|
|
103
|
+
scopeSegmentName!: string | null;
|
|
104
|
+
/** Disparos del mes corriente (0 si el contador es de un mes anterior). Columna DISP.(MES). */
|
|
105
|
+
triggersMonth!: number;
|
|
106
|
+
createdAt!: string;
|
|
107
|
+
updatedAt!: string;
|
|
108
|
+
createdBy!: string;
|
|
109
|
+
updatedBy!: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export class RuleListResponse {
|
|
113
|
+
items!: Rule[];
|
|
114
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Acción cuando la condición se rompe. */
|
|
2
|
+
export enum RuleActionType {
|
|
3
|
+
/** Fuerza al valor permitido (el valor de la condición) y procede. Solo caps clampeables, per-tx. */
|
|
4
|
+
FORCE_LIMIT = "FORCE_LIMIT",
|
|
5
|
+
/** Bloquea el guardado / rechaza la tx. */
|
|
6
|
+
BLOCK = "BLOCK",
|
|
7
|
+
/** Permite pero notifica a un comité. Exclusivo de ALARM. */
|
|
8
|
+
NOTIFY = "NOTIFY",
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Categoría de la regla (Variables Operativas › Reglas — mockup). */
|
|
2
|
+
export enum RuleCategory {
|
|
3
|
+
/** Límite duro: fuerza al valor permitido (per-tx) o bloquea el save de config. */
|
|
4
|
+
CAP = "CAP",
|
|
5
|
+
/** Bloquea el guardado si la condición se rompe. */
|
|
6
|
+
VALIDATION = "VALIDATION",
|
|
7
|
+
/** Permite pero notifica al comité correspondiente. */
|
|
8
|
+
ALARM = "ALARM",
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Campo de la condición (los 6 del mockup). Todos numéricos. "efectivo" = después
|
|
3
|
+
* de aplicar promos. TAKE_RATE es "Spread efectivo" redefinido (D-RG-1):
|
|
4
|
+
* MU + round(fee/monto × 10000) = cuánto le saca Fiado al cliente EN TOTAL.
|
|
5
|
+
*/
|
|
6
|
+
export enum RuleField {
|
|
7
|
+
FEE_EFFECTIVE = "FEE_EFFECTIVE", // USD
|
|
8
|
+
MU_EFFECTIVE = "MU_EFFECTIVE", // bps
|
|
9
|
+
TAKE_RATE = "TAKE_RATE", // bps
|
|
10
|
+
TX_AMOUNT = "TX_AMOUNT", // USD — solo por tx (Fase B)
|
|
11
|
+
MU_CHANGE_24H = "MU_CHANGE_24H", // % — solo alarma, config-save
|
|
12
|
+
PROMO_VOLUME_SHARE = "PROMO_VOLUME_SHARE", // % — solo alarma, Fase B (cron)
|
|
13
|
+
}
|
|
@@ -17,3 +17,7 @@ export * from "./PromotionActivation";
|
|
|
17
17
|
export * from "./PromotionStatus";
|
|
18
18
|
export * from "./FxEffectMode";
|
|
19
19
|
export * from "./FeeEffectMode";
|
|
20
|
+
export * from "./RuleCategory";
|
|
21
|
+
export * from "./RuleField";
|
|
22
|
+
export * from "./RuleOperator";
|
|
23
|
+
export * from "./RuleActionType";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Body del PUT /me/profile/complete (autenticado, gate post-MFA del autoregistro). DEC-RBAC-034.
|
|
3
|
-
* Opera sobre el propio usuario (cognitoSub del token). Valida nombre + los `userFieldDefs` requeridos
|
|
4
|
-
* del tenant (422 MISSING_REQUIRED_FIELDS si faltan) y flipea `profileComplete=true`.
|
|
5
|
-
*/
|
|
6
|
-
export declare class CompleteMyProfileRequest {
|
|
7
|
-
displayName: string;
|
|
8
|
-
customFields?: Record<string, string>;
|
|
9
|
-
}
|