@fiado/type-kit 3.152.0 → 3.154.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/RemittancePricing.d.ts +93 -0
- package/bin/remittance/dtos/RemittancePricing.js +165 -0
- package/bin/remittance/dtos/RemittancePromotion.d.ts +90 -0
- package/bin/remittance/dtos/RemittancePromotion.js +150 -0
- package/bin/remittance/dtos/index.d.ts +2 -0
- package/bin/remittance/dtos/index.js +2 -0
- package/bin/remittance/dtos/internal/RemittancePricingBridge.d.ts +26 -0
- package/bin/remittance/dtos/internal/RemittancePricingBridge.js +47 -0
- package/bin/remittance/dtos/internal/RemittancePromotionReach.d.ts +17 -0
- package/bin/remittance/dtos/internal/RemittancePromotionReach.js +44 -0
- package/bin/remittance/enums/FeeEffectMode.d.ts +7 -0
- package/bin/remittance/enums/FeeEffectMode.js +11 -0
- package/bin/remittance/enums/FxEffectMode.d.ts +6 -0
- package/bin/remittance/enums/FxEffectMode.js +10 -0
- package/bin/remittance/enums/PromotionActivation.d.ts +7 -0
- package/bin/remittance/enums/PromotionActivation.js +11 -0
- package/bin/remittance/enums/PromotionKind.d.ts +9 -0
- package/bin/remittance/enums/PromotionKind.js +13 -0
- package/bin/remittance/enums/PromotionStatus.d.ts +7 -0
- package/bin/remittance/enums/PromotionStatus.js +11 -0
- package/bin/remittance/enums/RemittanceCorridor.d.ts +19 -0
- package/bin/remittance/enums/RemittanceCorridor.js +25 -0
- package/bin/remittance/enums/index.d.ts +6 -0
- package/bin/remittance/enums/index.js +6 -0
- package/bin/remittance/index.d.ts +2 -0
- package/bin/remittance/index.js +2 -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/RemittancePricing.ts +184 -0
- package/src/remittance/dtos/RemittancePromotion.ts +162 -0
- package/src/remittance/dtos/index.ts +2 -0
- package/src/remittance/dtos/internal/RemittancePricingBridge.ts +36 -0
- package/src/remittance/dtos/internal/RemittancePromotionReach.ts +31 -0
- package/src/remittance/enums/FeeEffectMode.ts +7 -0
- package/src/remittance/enums/FxEffectMode.ts +6 -0
- package/src/remittance/enums/PromotionActivation.ts +7 -0
- package/src/remittance/enums/PromotionKind.ts +9 -0
- package/src/remittance/enums/PromotionStatus.ts +7 -0
- package/src/remittance/enums/RemittanceCorridor.ts +22 -0
- package/src/remittance/enums/index.ts +6 -0
- package/src/remittance/index.ts +2 -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,93 @@
|
|
|
1
|
+
import { RemittanceCorridor } from "../enums/RemittanceCorridor";
|
|
2
|
+
/**
|
|
3
|
+
* DTOs de Precio Base (Dashboard Ops · Variables Operativas §1).
|
|
4
|
+
*
|
|
5
|
+
* Una combinación (corridor × segmento) define el markup FX (bps CON SIGNO:
|
|
6
|
+
* + Fiado gana spread; − Fiado subsidia, retail > wholesale) y los service fees
|
|
7
|
+
* escalonados por tramo de monto. Dueño de la tabla: remittance-business
|
|
8
|
+
* (RemittancePricing_GT). Cambios inmediatos al guardar; lo temporal vive en
|
|
9
|
+
* Promociones. retail = wholesale × (1 − markupBps/10000), SIN clampear
|
|
10
|
+
* (el tope ≤ base de UNIR es transitorio).
|
|
11
|
+
*/
|
|
12
|
+
/** Tramo de service fee. Matching = MAYOR amountMin ≤ monto (amountMax es SOLO display). */
|
|
13
|
+
export declare class PricingTier {
|
|
14
|
+
amountMin: number;
|
|
15
|
+
/** Display ("$1–$49"); null/ausente = sin tope (último tramo). El matching NO lo usa. */
|
|
16
|
+
amountMax?: number | null;
|
|
17
|
+
serviceFee: number;
|
|
18
|
+
/** ISO date (YYYY-MM-DD) "FEE DESDE" — informativo. */
|
|
19
|
+
effectiveFrom: string;
|
|
20
|
+
}
|
|
21
|
+
/** Body de POST /backoffice/pricing/base. */
|
|
22
|
+
export declare class CreatePricingRequest {
|
|
23
|
+
corridor: RemittanceCorridor;
|
|
24
|
+
segmentId: string;
|
|
25
|
+
/** CON SIGNO: + Fiado gana spread; − Fiado subsidia (retail > wholesale). */
|
|
26
|
+
markupBps: number;
|
|
27
|
+
tramos: PricingTier[];
|
|
28
|
+
name?: string;
|
|
29
|
+
notes?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Body de PUT /backoffice/pricing/base/{id} (reemplazo completo; corridor/segmentId inmutables). */
|
|
32
|
+
export declare class UpdatePricingRequest {
|
|
33
|
+
markupBps: number;
|
|
34
|
+
tramos: PricingTier[];
|
|
35
|
+
name?: string;
|
|
36
|
+
notes?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Combinación completa (response de list/create/update). */
|
|
39
|
+
export declare class PricingCombination {
|
|
40
|
+
id: string;
|
|
41
|
+
corridor: RemittanceCorridor;
|
|
42
|
+
segmentId: string;
|
|
43
|
+
/** Display resuelto contra RemittanceSegments_GT ("Premium"); segmentId si no resoluble. */
|
|
44
|
+
segmentName: string;
|
|
45
|
+
markupBps: number;
|
|
46
|
+
tramos: PricingTier[];
|
|
47
|
+
/** # promos activas que aplican a la combinación. 0 hasta que exista Promociones. */
|
|
48
|
+
promosCount: number;
|
|
49
|
+
name: string | null;
|
|
50
|
+
notes: string | null;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
createdBy: string;
|
|
54
|
+
updatedBy: string;
|
|
55
|
+
}
|
|
56
|
+
/** Response de GET /backoffice/pricing/base. */
|
|
57
|
+
export declare class PricingListResponse {
|
|
58
|
+
items: PricingCombination[];
|
|
59
|
+
}
|
|
60
|
+
/** Response de GET /backoffice/pricing/base/{id}/metrics. */
|
|
61
|
+
export declare class PricingCombinationMetrics {
|
|
62
|
+
/** Miembros del segmento con ≥1 tx no-cancelada al corredor (histórica). */
|
|
63
|
+
clientCount: number;
|
|
64
|
+
/** Σ amountUSD del mes calendario (UTC) de esas tx al corredor, sin CANCELLED/REFUND. */
|
|
65
|
+
volMonthUSD: number;
|
|
66
|
+
}
|
|
67
|
+
/** Body de POST /backoffice/pricing/simulate (valores del panel — pueden NO estar guardados). */
|
|
68
|
+
export declare class SimulatePricingRequest {
|
|
69
|
+
corridor: RemittanceCorridor;
|
|
70
|
+
amountUSD: number;
|
|
71
|
+
markupBps: number;
|
|
72
|
+
tramos: PricingTier[];
|
|
73
|
+
}
|
|
74
|
+
export declare class SimulatePricingResponse {
|
|
75
|
+
/** ExternalQuickQuotes (vivo). */
|
|
76
|
+
wholesale: number;
|
|
77
|
+
/** round4(wholesale × (1 − markupBps/10000)) — SIN clampear (markup negativo ⇒ retail > wholesale). */
|
|
78
|
+
retail: number;
|
|
79
|
+
/** Del tramo matcheado (mayor amountMin ≤ amountUSD). */
|
|
80
|
+
serviceFee: number;
|
|
81
|
+
/** round2(amountUSD × retail), en moneda destino. */
|
|
82
|
+
receives: number;
|
|
83
|
+
/** amountUSD + serviceFee (el stateFee lo calcula UNIR; prod US = 0). */
|
|
84
|
+
totalToPay: number;
|
|
85
|
+
/** ISO del quote. */
|
|
86
|
+
asOf: string;
|
|
87
|
+
}
|
|
88
|
+
/** Response de GET /backoffice/pricing/wholesale?corridor= (rb passthrough del connector). */
|
|
89
|
+
export declare class WholesaleRateResponse {
|
|
90
|
+
corridor: RemittanceCorridor;
|
|
91
|
+
wholesale: number;
|
|
92
|
+
asOf: string;
|
|
93
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
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.WholesaleRateResponse = exports.SimulatePricingResponse = exports.SimulatePricingRequest = exports.PricingCombinationMetrics = exports.PricingListResponse = exports.PricingCombination = exports.UpdatePricingRequest = exports.CreatePricingRequest = exports.PricingTier = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const RemittanceCorridor_1 = require("../enums/RemittanceCorridor");
|
|
16
|
+
/**
|
|
17
|
+
* DTOs de Precio Base (Dashboard Ops · Variables Operativas §1).
|
|
18
|
+
*
|
|
19
|
+
* Una combinación (corridor × segmento) define el markup FX (bps CON SIGNO:
|
|
20
|
+
* + Fiado gana spread; − Fiado subsidia, retail > wholesale) y los service fees
|
|
21
|
+
* escalonados por tramo de monto. Dueño de la tabla: remittance-business
|
|
22
|
+
* (RemittancePricing_GT). Cambios inmediatos al guardar; lo temporal vive en
|
|
23
|
+
* Promociones. retail = wholesale × (1 − markupBps/10000), SIN clampear
|
|
24
|
+
* (el tope ≤ base de UNIR es transitorio).
|
|
25
|
+
*/
|
|
26
|
+
/** Tramo de service fee. Matching = MAYOR amountMin ≤ monto (amountMax es SOLO display). */
|
|
27
|
+
class PricingTier {
|
|
28
|
+
}
|
|
29
|
+
exports.PricingTier = PricingTier;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsNumber)(),
|
|
32
|
+
(0, class_validator_1.Min)(1),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], PricingTier.prototype, "amountMin", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.IsNumber)(),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], PricingTier.prototype, "amountMax", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsNumber)(),
|
|
42
|
+
(0, class_validator_1.Min)(0),
|
|
43
|
+
(0, class_validator_1.Max)(100),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], PricingTier.prototype, "serviceFee", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsString)(),
|
|
48
|
+
(0, class_validator_1.Length)(10, 10),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], PricingTier.prototype, "effectiveFrom", void 0);
|
|
51
|
+
/** Body de POST /backoffice/pricing/base. */
|
|
52
|
+
class CreatePricingRequest {
|
|
53
|
+
}
|
|
54
|
+
exports.CreatePricingRequest = CreatePricingRequest;
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.IsEnum)(RemittanceCorridor_1.RemittanceCorridor),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], CreatePricingRequest.prototype, "corridor", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
(0, class_validator_1.Length)(1, 100),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], CreatePricingRequest.prototype, "segmentId", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, class_validator_1.IsInt)(),
|
|
66
|
+
(0, class_validator_1.Min)(-500),
|
|
67
|
+
(0, class_validator_1.Max)(500),
|
|
68
|
+
__metadata("design:type", Number)
|
|
69
|
+
], CreatePricingRequest.prototype, "markupBps", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_validator_1.IsArray)(),
|
|
72
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
73
|
+
(0, class_validator_1.ArrayMaxSize)(20),
|
|
74
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
75
|
+
(0, class_transformer_1.Type)(() => PricingTier),
|
|
76
|
+
__metadata("design:type", Array)
|
|
77
|
+
], CreatePricingRequest.prototype, "tramos", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsOptional)(),
|
|
80
|
+
(0, class_validator_1.IsString)(),
|
|
81
|
+
(0, class_validator_1.MaxLength)(100),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], CreatePricingRequest.prototype, "name", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, class_validator_1.IsOptional)(),
|
|
86
|
+
(0, class_validator_1.IsString)(),
|
|
87
|
+
(0, class_validator_1.MaxLength)(500),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], CreatePricingRequest.prototype, "notes", void 0);
|
|
90
|
+
/** Body de PUT /backoffice/pricing/base/{id} (reemplazo completo; corridor/segmentId inmutables). */
|
|
91
|
+
class UpdatePricingRequest {
|
|
92
|
+
}
|
|
93
|
+
exports.UpdatePricingRequest = UpdatePricingRequest;
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, class_validator_1.IsInt)(),
|
|
96
|
+
(0, class_validator_1.Min)(-500),
|
|
97
|
+
(0, class_validator_1.Max)(500),
|
|
98
|
+
__metadata("design:type", Number)
|
|
99
|
+
], UpdatePricingRequest.prototype, "markupBps", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, class_validator_1.IsArray)(),
|
|
102
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
103
|
+
(0, class_validator_1.ArrayMaxSize)(20),
|
|
104
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
105
|
+
(0, class_transformer_1.Type)(() => PricingTier),
|
|
106
|
+
__metadata("design:type", Array)
|
|
107
|
+
], UpdatePricingRequest.prototype, "tramos", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, class_validator_1.IsOptional)(),
|
|
110
|
+
(0, class_validator_1.IsString)(),
|
|
111
|
+
(0, class_validator_1.MaxLength)(100),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], UpdatePricingRequest.prototype, "name", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, class_validator_1.IsOptional)(),
|
|
116
|
+
(0, class_validator_1.IsString)(),
|
|
117
|
+
(0, class_validator_1.MaxLength)(500),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], UpdatePricingRequest.prototype, "notes", void 0);
|
|
120
|
+
/** Combinación completa (response de list/create/update). */
|
|
121
|
+
class PricingCombination {
|
|
122
|
+
}
|
|
123
|
+
exports.PricingCombination = PricingCombination;
|
|
124
|
+
/** Response de GET /backoffice/pricing/base. */
|
|
125
|
+
class PricingListResponse {
|
|
126
|
+
}
|
|
127
|
+
exports.PricingListResponse = PricingListResponse;
|
|
128
|
+
/** Response de GET /backoffice/pricing/base/{id}/metrics. */
|
|
129
|
+
class PricingCombinationMetrics {
|
|
130
|
+
}
|
|
131
|
+
exports.PricingCombinationMetrics = PricingCombinationMetrics;
|
|
132
|
+
/** Body de POST /backoffice/pricing/simulate (valores del panel — pueden NO estar guardados). */
|
|
133
|
+
class SimulatePricingRequest {
|
|
134
|
+
}
|
|
135
|
+
exports.SimulatePricingRequest = SimulatePricingRequest;
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, class_validator_1.IsEnum)(RemittanceCorridor_1.RemittanceCorridor),
|
|
138
|
+
__metadata("design:type", String)
|
|
139
|
+
], SimulatePricingRequest.prototype, "corridor", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, class_validator_1.IsNumber)(),
|
|
142
|
+
(0, class_validator_1.Min)(1),
|
|
143
|
+
__metadata("design:type", Number)
|
|
144
|
+
], SimulatePricingRequest.prototype, "amountUSD", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, class_validator_1.IsInt)(),
|
|
147
|
+
(0, class_validator_1.Min)(-500),
|
|
148
|
+
(0, class_validator_1.Max)(500),
|
|
149
|
+
__metadata("design:type", Number)
|
|
150
|
+
], SimulatePricingRequest.prototype, "markupBps", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, class_validator_1.IsArray)(),
|
|
153
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
154
|
+
(0, class_validator_1.ArrayMaxSize)(20),
|
|
155
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
156
|
+
(0, class_transformer_1.Type)(() => PricingTier),
|
|
157
|
+
__metadata("design:type", Array)
|
|
158
|
+
], SimulatePricingRequest.prototype, "tramos", void 0);
|
|
159
|
+
class SimulatePricingResponse {
|
|
160
|
+
}
|
|
161
|
+
exports.SimulatePricingResponse = SimulatePricingResponse;
|
|
162
|
+
/** Response de GET /backoffice/pricing/wholesale?corridor= (rb passthrough del connector). */
|
|
163
|
+
class WholesaleRateResponse {
|
|
164
|
+
}
|
|
165
|
+
exports.WholesaleRateResponse = WholesaleRateResponse;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { FeeEffectMode } from "../enums/FeeEffectMode";
|
|
2
|
+
import { FxEffectMode } from "../enums/FxEffectMode";
|
|
3
|
+
import { PromotionActivation } from "../enums/PromotionActivation";
|
|
4
|
+
import { PromotionKind } from "../enums/PromotionKind";
|
|
5
|
+
import { PromotionStatus } from "../enums/PromotionStatus";
|
|
6
|
+
import { RemittanceCorridor } from "../enums/RemittanceCorridor";
|
|
7
|
+
/** Audiencia: null en una dimensión = "Cualquiera". */
|
|
8
|
+
export declare class PromotionAudience {
|
|
9
|
+
corridor?: RemittanceCorridor | null;
|
|
10
|
+
segmentId?: string | null;
|
|
11
|
+
cohortId?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/** Efecto FX (spread): DELTA suma bps CON SIGNO al markup base; ABSOLUTE lo reemplaza. */
|
|
14
|
+
export declare class FxEffect {
|
|
15
|
+
mode: FxEffectMode;
|
|
16
|
+
/** bps con signo. Ignorado si mode=NONE (mandar 0). */
|
|
17
|
+
valueBps: number;
|
|
18
|
+
}
|
|
19
|
+
/** Efecto fee: ABSOLUTE = $; DELTA = ±$; PERCENTAGE = −% del fee (0-100). */
|
|
20
|
+
export declare class FeeEffect {
|
|
21
|
+
mode: FeeEffectMode;
|
|
22
|
+
value: number;
|
|
23
|
+
}
|
|
24
|
+
export declare class CreatePromotionRequest {
|
|
25
|
+
name: string;
|
|
26
|
+
kind: PromotionKind;
|
|
27
|
+
activation: PromotionActivation;
|
|
28
|
+
/** Requerido si activation=CODE (regla en manager); único case-insensitive. */
|
|
29
|
+
code?: string | null;
|
|
30
|
+
audience: PromotionAudience;
|
|
31
|
+
/** ISO date (YYYY-MM-DD). */
|
|
32
|
+
effectiveFrom: string;
|
|
33
|
+
/** ISO date; null/ausente = permanente (∞). */
|
|
34
|
+
effectiveTo?: string | null;
|
|
35
|
+
fxEffect: FxEffect;
|
|
36
|
+
feeEffect: FeeEffect;
|
|
37
|
+
notes?: string | null;
|
|
38
|
+
}
|
|
39
|
+
/** PUT — reemplazo completo (mismos campos que create). */
|
|
40
|
+
export declare class UpdatePromotionRequest extends CreatePromotionRequest {
|
|
41
|
+
}
|
|
42
|
+
/** Promoción completa (response de list/create/update). */
|
|
43
|
+
export declare class Promotion {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
kind: PromotionKind;
|
|
47
|
+
activation: PromotionActivation;
|
|
48
|
+
code: string | null;
|
|
49
|
+
audience: {
|
|
50
|
+
corridor: RemittanceCorridor | null;
|
|
51
|
+
segmentId: string | null;
|
|
52
|
+
cohortId: string | null;
|
|
53
|
+
};
|
|
54
|
+
/** Display: nombres resueltos de segmento/cohort (null = "Cualquiera" o no resoluble). */
|
|
55
|
+
audienceDisplay: {
|
|
56
|
+
corridor: string | null;
|
|
57
|
+
segmentName: string | null;
|
|
58
|
+
cohortName: string | null;
|
|
59
|
+
};
|
|
60
|
+
effectiveFrom: string;
|
|
61
|
+
effectiveTo: string | null;
|
|
62
|
+
fxEffect: {
|
|
63
|
+
mode: FxEffectMode;
|
|
64
|
+
valueBps: number;
|
|
65
|
+
};
|
|
66
|
+
feeEffect: {
|
|
67
|
+
mode: FeeEffectMode;
|
|
68
|
+
value: number;
|
|
69
|
+
};
|
|
70
|
+
/** Derivado de la vigencia vs hoy (UTC). */
|
|
71
|
+
status: PromotionStatus;
|
|
72
|
+
/** Legible para la columna EFECTO: "MU −30 bps + Fee = $0". */
|
|
73
|
+
effectSummary: string;
|
|
74
|
+
notes: string | null;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
createdBy: string;
|
|
78
|
+
updatedBy: string;
|
|
79
|
+
}
|
|
80
|
+
/** Response de GET /backoffice/pricing/promotions. */
|
|
81
|
+
export declare class PromotionListResponse {
|
|
82
|
+
items: Promotion[];
|
|
83
|
+
}
|
|
84
|
+
/** Response de GET /backoffice/pricing/promotions/reach. */
|
|
85
|
+
export declare class PromotionReachResponse {
|
|
86
|
+
/** Clientes en la intersección corridor × segmento × cohort. */
|
|
87
|
+
reach: number;
|
|
88
|
+
/** Universo (todos los RemittanceUsers) — para el % del picker. */
|
|
89
|
+
total: number;
|
|
90
|
+
}
|