@fiado/type-kit 3.152.0 → 3.153.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/index.d.ts +1 -0
- package/bin/remittance/dtos/index.js +1 -0
- package/bin/remittance/dtos/internal/RemittancePricingBridge.d.ts +26 -0
- package/bin/remittance/dtos/internal/RemittancePricingBridge.js +47 -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 +1 -0
- package/bin/remittance/enums/index.js +1 -0
- package/bin/remittance/index.d.ts +1 -0
- package/bin/remittance/index.js +1 -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/index.ts +1 -0
- package/src/remittance/dtos/internal/RemittancePricingBridge.ts +36 -0
- package/src/remittance/enums/RemittanceCorridor.ts +22 -0
- package/src/remittance/enums/index.ts +1 -0
- package/src/remittance/index.ts +1 -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;
|
|
@@ -56,3 +56,4 @@ __exportStar(require("./RemittanceCohort"), exports);
|
|
|
56
56
|
__exportStar(require("./RemittanceAuditLog"), exports);
|
|
57
57
|
__exportStar(require("./RemittanceSegment"), exports);
|
|
58
58
|
__exportStar(require("./RemittanceCommittee"), exports);
|
|
59
|
+
__exportStar(require("./RemittancePricing"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RemittanceCorridor } from "../../enums/RemittanceCorridor";
|
|
2
|
+
/**
|
|
3
|
+
* Contratos internos del puente de Precio Base (Opción A, como
|
|
4
|
+
* RemittanceSegmentMetrics): remittance-business resuelve la membresía del
|
|
5
|
+
* segmento y el uniteller-connector (dueño de RemittanceUsers_GT /
|
|
6
|
+
* RemittanceTransactions_GT y de la integración UNIR) computa.
|
|
7
|
+
*/
|
|
8
|
+
/** POST /backoffice/pricing/wholesale (privado connector): wholesale vivo de ExternalQuickQuotes. */
|
|
9
|
+
export declare class WholesaleRateRequest {
|
|
10
|
+
corridor: RemittanceCorridor;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* POST /backoffice/config/pricing/metrics (privado connector). El filtro de
|
|
14
|
+
* corredor se hace por countryISO (CORRIDOR_INFO — no ambiguo con USD-SVC).
|
|
15
|
+
*/
|
|
16
|
+
export declare class PricingMetricsRequest {
|
|
17
|
+
/** Miembros del segmento ya resueltos por rb. `[]` → { clientCount: 0, volMonthUSD: 0 }. */
|
|
18
|
+
directoryIds: string[];
|
|
19
|
+
corridor: RemittanceCorridor;
|
|
20
|
+
}
|
|
21
|
+
export declare class PricingMetricsResponse {
|
|
22
|
+
/** ids del request con ≥1 tx no-cancelada al corredor (histórica). */
|
|
23
|
+
clientCount: number;
|
|
24
|
+
/** Σ amountUSD del mes calendario corriente (UTC) de esas tx al corredor, sin CANCELLED/REFUND. */
|
|
25
|
+
volMonthUSD: number;
|
|
26
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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.PricingMetricsResponse = exports.PricingMetricsRequest = exports.WholesaleRateRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const RemittanceCorridor_1 = require("../../enums/RemittanceCorridor");
|
|
15
|
+
/**
|
|
16
|
+
* Contratos internos del puente de Precio Base (Opción A, como
|
|
17
|
+
* RemittanceSegmentMetrics): remittance-business resuelve la membresía del
|
|
18
|
+
* segmento y el uniteller-connector (dueño de RemittanceUsers_GT /
|
|
19
|
+
* RemittanceTransactions_GT y de la integración UNIR) computa.
|
|
20
|
+
*/
|
|
21
|
+
/** POST /backoffice/pricing/wholesale (privado connector): wholesale vivo de ExternalQuickQuotes. */
|
|
22
|
+
class WholesaleRateRequest {
|
|
23
|
+
}
|
|
24
|
+
exports.WholesaleRateRequest = WholesaleRateRequest;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsEnum)(RemittanceCorridor_1.RemittanceCorridor),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], WholesaleRateRequest.prototype, "corridor", void 0);
|
|
29
|
+
/**
|
|
30
|
+
* POST /backoffice/config/pricing/metrics (privado connector). El filtro de
|
|
31
|
+
* corredor se hace por countryISO (CORRIDOR_INFO — no ambiguo con USD-SVC).
|
|
32
|
+
*/
|
|
33
|
+
class PricingMetricsRequest {
|
|
34
|
+
}
|
|
35
|
+
exports.PricingMetricsRequest = PricingMetricsRequest;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsArray)(),
|
|
38
|
+
(0, class_validator_1.IsUUID)("4", { each: true }),
|
|
39
|
+
__metadata("design:type", Array)
|
|
40
|
+
], PricingMetricsRequest.prototype, "directoryIds", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsEnum)(RemittanceCorridor_1.RemittanceCorridor),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], PricingMetricsRequest.prototype, "corridor", void 0);
|
|
45
|
+
class PricingMetricsResponse {
|
|
46
|
+
}
|
|
47
|
+
exports.PricingMetricsResponse = PricingMetricsResponse;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Corredores de remesa soportados (Dashboard Ops · Variables Operativas).
|
|
3
|
+
*
|
|
4
|
+
* D-PB-3: nomenclatura por MONEDA ISO-4217 (`USD-<destino>`). `USD_SVC` es un
|
|
5
|
+
* símbolo para El Salvador (su payout real es USD; usar la moneda colisionaría
|
|
6
|
+
* como "USD-USD"). Por eso el destino real vive en CORRIDOR_INFO y el filtro de
|
|
7
|
+
* transacciones usa countryISO (no ambiguo).
|
|
8
|
+
*/
|
|
9
|
+
export declare enum RemittanceCorridor {
|
|
10
|
+
USD_GTQ = "USD-GTQ",
|
|
11
|
+
USD_MXN = "USD-MXN",
|
|
12
|
+
USD_HNL = "USD-HNL",
|
|
13
|
+
USD_SVC = "USD-SVC"
|
|
14
|
+
}
|
|
15
|
+
/** Destino real del corredor. El filtro de tx usa countryISO; currencyISO es el payout. */
|
|
16
|
+
export declare const CORRIDOR_INFO: Record<RemittanceCorridor, {
|
|
17
|
+
countryISO: string;
|
|
18
|
+
currencyISO: string;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CORRIDOR_INFO = exports.RemittanceCorridor = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Corredores de remesa soportados (Dashboard Ops · Variables Operativas).
|
|
6
|
+
*
|
|
7
|
+
* D-PB-3: nomenclatura por MONEDA ISO-4217 (`USD-<destino>`). `USD_SVC` es un
|
|
8
|
+
* símbolo para El Salvador (su payout real es USD; usar la moneda colisionaría
|
|
9
|
+
* como "USD-USD"). Por eso el destino real vive en CORRIDOR_INFO y el filtro de
|
|
10
|
+
* transacciones usa countryISO (no ambiguo).
|
|
11
|
+
*/
|
|
12
|
+
var RemittanceCorridor;
|
|
13
|
+
(function (RemittanceCorridor) {
|
|
14
|
+
RemittanceCorridor["USD_GTQ"] = "USD-GTQ";
|
|
15
|
+
RemittanceCorridor["USD_MXN"] = "USD-MXN";
|
|
16
|
+
RemittanceCorridor["USD_HNL"] = "USD-HNL";
|
|
17
|
+
RemittanceCorridor["USD_SVC"] = "USD-SVC";
|
|
18
|
+
})(RemittanceCorridor || (exports.RemittanceCorridor = RemittanceCorridor = {}));
|
|
19
|
+
/** Destino real del corredor. El filtro de tx usa countryISO; currencyISO es el payout. */
|
|
20
|
+
exports.CORRIDOR_INFO = {
|
|
21
|
+
[RemittanceCorridor.USD_GTQ]: { countryISO: "GT", currencyISO: "GTQ" },
|
|
22
|
+
[RemittanceCorridor.USD_MXN]: { countryISO: "MX", currencyISO: "MXN" },
|
|
23
|
+
[RemittanceCorridor.USD_HNL]: { countryISO: "HN", currencyISO: "HNL" },
|
|
24
|
+
[RemittanceCorridor.USD_SVC]: { countryISO: "SV", currencyISO: "USD" },
|
|
25
|
+
};
|
|
@@ -27,3 +27,4 @@ __exportStar(require("./CohortRefresh"), exports);
|
|
|
27
27
|
__exportStar(require("./AuditAction"), exports);
|
|
28
28
|
__exportStar(require("./AuditEntityType"), exports);
|
|
29
29
|
__exportStar(require("./SegmentMemberType"), exports);
|
|
30
|
+
__exportStar(require("./RemittanceCorridor"), exports);
|
|
@@ -4,3 +4,4 @@ export * from "./dtos/internal/RemittanceCreditBackRequest";
|
|
|
4
4
|
export * from "./dtos/internal/RemittanceCreditBackResponse";
|
|
5
5
|
export * from "./dtos/internal/RemittanceCohortCount";
|
|
6
6
|
export * from "./dtos/internal/RemittanceSegmentMetrics";
|
|
7
|
+
export * from "./dtos/internal/RemittancePricingBridge";
|
package/bin/remittance/index.js
CHANGED
|
@@ -22,3 +22,4 @@ __exportStar(require("./dtos/internal/RemittanceCreditBackRequest"), exports);
|
|
|
22
22
|
__exportStar(require("./dtos/internal/RemittanceCreditBackResponse"), exports);
|
|
23
23
|
__exportStar(require("./dtos/internal/RemittanceCohortCount"), exports);
|
|
24
24
|
__exportStar(require("./dtos/internal/RemittanceSegmentMetrics"), exports);
|
|
25
|
+
__exportStar(require("./dtos/internal/RemittancePricingBridge"), 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,184 @@
|
|
|
1
|
+
import { Type } from "class-transformer";
|
|
2
|
+
import {
|
|
3
|
+
ArrayMaxSize,
|
|
4
|
+
ArrayMinSize,
|
|
5
|
+
IsArray,
|
|
6
|
+
IsEnum,
|
|
7
|
+
IsInt,
|
|
8
|
+
IsNumber,
|
|
9
|
+
IsOptional,
|
|
10
|
+
IsString,
|
|
11
|
+
Length,
|
|
12
|
+
Max,
|
|
13
|
+
MaxLength,
|
|
14
|
+
Min,
|
|
15
|
+
ValidateNested,
|
|
16
|
+
} from "class-validator";
|
|
17
|
+
import { RemittanceCorridor } from "../enums/RemittanceCorridor";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* DTOs de Precio Base (Dashboard Ops · Variables Operativas §1).
|
|
21
|
+
*
|
|
22
|
+
* Una combinación (corridor × segmento) define el markup FX (bps CON SIGNO:
|
|
23
|
+
* + Fiado gana spread; − Fiado subsidia, retail > wholesale) y los service fees
|
|
24
|
+
* escalonados por tramo de monto. Dueño de la tabla: remittance-business
|
|
25
|
+
* (RemittancePricing_GT). Cambios inmediatos al guardar; lo temporal vive en
|
|
26
|
+
* Promociones. retail = wholesale × (1 − markupBps/10000), SIN clampear
|
|
27
|
+
* (el tope ≤ base de UNIR es transitorio).
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** Tramo de service fee. Matching = MAYOR amountMin ≤ monto (amountMax es SOLO display). */
|
|
31
|
+
export class PricingTier {
|
|
32
|
+
@IsNumber()
|
|
33
|
+
@Min(1)
|
|
34
|
+
amountMin!: number;
|
|
35
|
+
|
|
36
|
+
/** Display ("$1–$49"); null/ausente = sin tope (último tramo). El matching NO lo usa. */
|
|
37
|
+
@IsOptional()
|
|
38
|
+
@IsNumber()
|
|
39
|
+
amountMax?: number | null;
|
|
40
|
+
|
|
41
|
+
@IsNumber()
|
|
42
|
+
@Min(0)
|
|
43
|
+
@Max(100)
|
|
44
|
+
serviceFee!: number;
|
|
45
|
+
|
|
46
|
+
/** ISO date (YYYY-MM-DD) "FEE DESDE" — informativo. */
|
|
47
|
+
@IsString()
|
|
48
|
+
@Length(10, 10)
|
|
49
|
+
effectiveFrom!: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Body de POST /backoffice/pricing/base. */
|
|
53
|
+
export class CreatePricingRequest {
|
|
54
|
+
@IsEnum(RemittanceCorridor)
|
|
55
|
+
corridor!: RemittanceCorridor;
|
|
56
|
+
|
|
57
|
+
@IsString()
|
|
58
|
+
@Length(1, 100)
|
|
59
|
+
segmentId!: string;
|
|
60
|
+
|
|
61
|
+
/** CON SIGNO: + Fiado gana spread; − Fiado subsidia (retail > wholesale). */
|
|
62
|
+
@IsInt()
|
|
63
|
+
@Min(-500)
|
|
64
|
+
@Max(500)
|
|
65
|
+
markupBps!: number;
|
|
66
|
+
|
|
67
|
+
@IsArray()
|
|
68
|
+
@ArrayMinSize(1)
|
|
69
|
+
@ArrayMaxSize(20)
|
|
70
|
+
@ValidateNested({ each: true })
|
|
71
|
+
@Type(() => PricingTier)
|
|
72
|
+
tramos!: PricingTier[];
|
|
73
|
+
|
|
74
|
+
@IsOptional()
|
|
75
|
+
@IsString()
|
|
76
|
+
@MaxLength(100)
|
|
77
|
+
name?: string;
|
|
78
|
+
|
|
79
|
+
@IsOptional()
|
|
80
|
+
@IsString()
|
|
81
|
+
@MaxLength(500)
|
|
82
|
+
notes?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Body de PUT /backoffice/pricing/base/{id} (reemplazo completo; corridor/segmentId inmutables). */
|
|
86
|
+
export class UpdatePricingRequest {
|
|
87
|
+
@IsInt()
|
|
88
|
+
@Min(-500)
|
|
89
|
+
@Max(500)
|
|
90
|
+
markupBps!: number;
|
|
91
|
+
|
|
92
|
+
@IsArray()
|
|
93
|
+
@ArrayMinSize(1)
|
|
94
|
+
@ArrayMaxSize(20)
|
|
95
|
+
@ValidateNested({ each: true })
|
|
96
|
+
@Type(() => PricingTier)
|
|
97
|
+
tramos!: PricingTier[];
|
|
98
|
+
|
|
99
|
+
@IsOptional()
|
|
100
|
+
@IsString()
|
|
101
|
+
@MaxLength(100)
|
|
102
|
+
name?: string;
|
|
103
|
+
|
|
104
|
+
@IsOptional()
|
|
105
|
+
@IsString()
|
|
106
|
+
@MaxLength(500)
|
|
107
|
+
notes?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Combinación completa (response de list/create/update). */
|
|
111
|
+
export class PricingCombination {
|
|
112
|
+
id!: string;
|
|
113
|
+
corridor!: RemittanceCorridor;
|
|
114
|
+
segmentId!: string;
|
|
115
|
+
/** Display resuelto contra RemittanceSegments_GT ("Premium"); segmentId si no resoluble. */
|
|
116
|
+
segmentName!: string;
|
|
117
|
+
markupBps!: number;
|
|
118
|
+
tramos!: PricingTier[];
|
|
119
|
+
/** # promos activas que aplican a la combinación. 0 hasta que exista Promociones. */
|
|
120
|
+
promosCount!: number;
|
|
121
|
+
name!: string | null;
|
|
122
|
+
notes!: string | null;
|
|
123
|
+
createdAt!: string;
|
|
124
|
+
updatedAt!: string;
|
|
125
|
+
createdBy!: string;
|
|
126
|
+
updatedBy!: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Response de GET /backoffice/pricing/base. */
|
|
130
|
+
export class PricingListResponse {
|
|
131
|
+
items!: PricingCombination[];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** Response de GET /backoffice/pricing/base/{id}/metrics. */
|
|
135
|
+
export class PricingCombinationMetrics {
|
|
136
|
+
/** Miembros del segmento con ≥1 tx no-cancelada al corredor (histórica). */
|
|
137
|
+
clientCount!: number;
|
|
138
|
+
/** Σ amountUSD del mes calendario (UTC) de esas tx al corredor, sin CANCELLED/REFUND. */
|
|
139
|
+
volMonthUSD!: number;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Body de POST /backoffice/pricing/simulate (valores del panel — pueden NO estar guardados). */
|
|
143
|
+
export class SimulatePricingRequest {
|
|
144
|
+
@IsEnum(RemittanceCorridor)
|
|
145
|
+
corridor!: RemittanceCorridor;
|
|
146
|
+
|
|
147
|
+
@IsNumber()
|
|
148
|
+
@Min(1)
|
|
149
|
+
amountUSD!: number;
|
|
150
|
+
|
|
151
|
+
@IsInt()
|
|
152
|
+
@Min(-500)
|
|
153
|
+
@Max(500)
|
|
154
|
+
markupBps!: number;
|
|
155
|
+
|
|
156
|
+
@IsArray()
|
|
157
|
+
@ArrayMinSize(1)
|
|
158
|
+
@ArrayMaxSize(20)
|
|
159
|
+
@ValidateNested({ each: true })
|
|
160
|
+
@Type(() => PricingTier)
|
|
161
|
+
tramos!: PricingTier[];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export class SimulatePricingResponse {
|
|
165
|
+
/** ExternalQuickQuotes (vivo). */
|
|
166
|
+
wholesale!: number;
|
|
167
|
+
/** round4(wholesale × (1 − markupBps/10000)) — SIN clampear (markup negativo ⇒ retail > wholesale). */
|
|
168
|
+
retail!: number;
|
|
169
|
+
/** Del tramo matcheado (mayor amountMin ≤ amountUSD). */
|
|
170
|
+
serviceFee!: number;
|
|
171
|
+
/** round2(amountUSD × retail), en moneda destino. */
|
|
172
|
+
receives!: number;
|
|
173
|
+
/** amountUSD + serviceFee (el stateFee lo calcula UNIR; prod US = 0). */
|
|
174
|
+
totalToPay!: number;
|
|
175
|
+
/** ISO del quote. */
|
|
176
|
+
asOf!: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Response de GET /backoffice/pricing/wholesale?corridor= (rb passthrough del connector). */
|
|
180
|
+
export class WholesaleRateResponse {
|
|
181
|
+
corridor!: RemittanceCorridor;
|
|
182
|
+
wholesale!: number;
|
|
183
|
+
asOf!: string;
|
|
184
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IsArray, IsEnum, IsUUID } from "class-validator";
|
|
2
|
+
import { RemittanceCorridor } from "../../enums/RemittanceCorridor";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Contratos internos del puente de Precio Base (Opción A, como
|
|
6
|
+
* RemittanceSegmentMetrics): remittance-business resuelve la membresía del
|
|
7
|
+
* segmento y el uniteller-connector (dueño de RemittanceUsers_GT /
|
|
8
|
+
* RemittanceTransactions_GT y de la integración UNIR) computa.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** POST /backoffice/pricing/wholesale (privado connector): wholesale vivo de ExternalQuickQuotes. */
|
|
12
|
+
export class WholesaleRateRequest {
|
|
13
|
+
@IsEnum(RemittanceCorridor)
|
|
14
|
+
corridor!: RemittanceCorridor;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* POST /backoffice/config/pricing/metrics (privado connector). El filtro de
|
|
19
|
+
* corredor se hace por countryISO (CORRIDOR_INFO — no ambiguo con USD-SVC).
|
|
20
|
+
*/
|
|
21
|
+
export class PricingMetricsRequest {
|
|
22
|
+
/** Miembros del segmento ya resueltos por rb. `[]` → { clientCount: 0, volMonthUSD: 0 }. */
|
|
23
|
+
@IsArray()
|
|
24
|
+
@IsUUID("4", { each: true })
|
|
25
|
+
directoryIds!: string[];
|
|
26
|
+
|
|
27
|
+
@IsEnum(RemittanceCorridor)
|
|
28
|
+
corridor!: RemittanceCorridor;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class PricingMetricsResponse {
|
|
32
|
+
/** ids del request con ≥1 tx no-cancelada al corredor (histórica). */
|
|
33
|
+
clientCount!: number;
|
|
34
|
+
/** Σ amountUSD del mes calendario corriente (UTC) de esas tx al corredor, sin CANCELLED/REFUND. */
|
|
35
|
+
volMonthUSD!: number;
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Corredores de remesa soportados (Dashboard Ops · Variables Operativas).
|
|
3
|
+
*
|
|
4
|
+
* D-PB-3: nomenclatura por MONEDA ISO-4217 (`USD-<destino>`). `USD_SVC` es un
|
|
5
|
+
* símbolo para El Salvador (su payout real es USD; usar la moneda colisionaría
|
|
6
|
+
* como "USD-USD"). Por eso el destino real vive en CORRIDOR_INFO y el filtro de
|
|
7
|
+
* transacciones usa countryISO (no ambiguo).
|
|
8
|
+
*/
|
|
9
|
+
export enum RemittanceCorridor {
|
|
10
|
+
USD_GTQ = "USD-GTQ",
|
|
11
|
+
USD_MXN = "USD-MXN",
|
|
12
|
+
USD_HNL = "USD-HNL",
|
|
13
|
+
USD_SVC = "USD-SVC",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Destino real del corredor. El filtro de tx usa countryISO; currencyISO es el payout. */
|
|
17
|
+
export const CORRIDOR_INFO: Record<RemittanceCorridor, { countryISO: string; currencyISO: string }> = {
|
|
18
|
+
[RemittanceCorridor.USD_GTQ]: { countryISO: "GT", currencyISO: "GTQ" },
|
|
19
|
+
[RemittanceCorridor.USD_MXN]: { countryISO: "MX", currencyISO: "MXN" },
|
|
20
|
+
[RemittanceCorridor.USD_HNL]: { countryISO: "HN", currencyISO: "HNL" },
|
|
21
|
+
[RemittanceCorridor.USD_SVC]: { countryISO: "SV", currencyISO: "USD" },
|
|
22
|
+
};
|
package/src/remittance/index.ts
CHANGED
|
@@ -6,3 +6,4 @@ export * from "./dtos/internal/RemittanceCreditBackRequest";
|
|
|
6
6
|
export * from "./dtos/internal/RemittanceCreditBackResponse";
|
|
7
7
|
export * from "./dtos/internal/RemittanceCohortCount";
|
|
8
8
|
export * from "./dtos/internal/RemittanceSegmentMetrics";
|
|
9
|
+
export * from "./dtos/internal/RemittancePricingBridge";
|
|
@@ -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
|
-
}
|