@fiado/type-kit 3.150.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.
@@ -0,0 +1,7 @@
1
+ import { AccountLevelEnum } from "../enums/AccountLevelEnum";
2
+ export declare class GetAccountLevelStatusResponse {
3
+ accountLevel: AccountLevelEnum;
4
+ availableBalance: number;
5
+ monthlyIncomingAccumulated?: number;
6
+ monthlyIncomingCount?: number;
7
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetAccountLevelStatusResponse = void 0;
4
+ class GetAccountLevelStatusResponse {
5
+ }
6
+ exports.GetAccountLevelStatusResponse = GetAccountLevelStatusResponse;
@@ -16,6 +16,7 @@ export * from './dtos/GetBankAccountSensitiveInformationResponse';
16
16
  export * from './dtos/AccountInfo';
17
17
  export * from './dtos/ExchangeInfo';
18
18
  export * from './dtos/GetAccountBalanceResponse';
19
+ export * from './dtos/GetAccountLevelStatusResponse';
19
20
  export * from './dtos/GetPocketBalanceResponse';
20
21
  export * from './dtos/GetPocketResponse';
21
22
  export * from './dtos/PocketItem';
@@ -33,6 +33,7 @@ __exportStar(require("./dtos/GetBankAccountSensitiveInformationResponse"), expor
33
33
  __exportStar(require("./dtos/AccountInfo"), exports);
34
34
  __exportStar(require("./dtos/ExchangeInfo"), exports);
35
35
  __exportStar(require("./dtos/GetAccountBalanceResponse"), exports);
36
+ __exportStar(require("./dtos/GetAccountLevelStatusResponse"), exports);
36
37
  __exportStar(require("./dtos/GetPocketBalanceResponse"), exports);
37
38
  __exportStar(require("./dtos/GetPocketResponse"), exports);
38
39
  __exportStar(require("./dtos/PocketItem"), 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;
@@ -40,3 +40,4 @@ export * from "./RemittanceCohort";
40
40
  export * from "./RemittanceAuditLog";
41
41
  export * from "./RemittanceSegment";
42
42
  export * from "./RemittanceCommittee";
43
+ export * from "./RemittancePricing";
@@ -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
+ };
@@ -11,3 +11,4 @@ export * from "./CohortRefresh";
11
11
  export * from "./AuditAction";
12
12
  export * from "./AuditEntityType";
13
13
  export * from "./SegmentMemberType";
14
+ export * from "./RemittanceCorridor";
@@ -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";
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.150.0",
3
+ "version": "3.153.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,9 @@
1
+ import { AccountLevelEnum } from "../enums/AccountLevelEnum";
2
+
3
+ export class GetAccountLevelStatusResponse {
4
+ accountLevel!: AccountLevelEnum;
5
+ availableBalance!: number;
6
+ // Fase 2 — abonos que afectan nivel acumulados en el mes calendario
7
+ monthlyIncomingAccumulated?: number; // monthTotalAmount del activityType PAGOCONFIADO_ENTRADAS_NIVEL_CUENTA
8
+ monthlyIncomingCount?: number; // monthCount (nº de entradas del mes)
9
+ }
@@ -18,6 +18,7 @@ export * from './dtos/GetBankAccountSensitiveInformationResponse';
18
18
  export * from './dtos/AccountInfo';
19
19
  export * from './dtos/ExchangeInfo';
20
20
  export * from './dtos/GetAccountBalanceResponse';
21
+ export * from './dtos/GetAccountLevelStatusResponse';
21
22
  export * from './dtos/GetPocketBalanceResponse';
22
23
  export * from './dtos/GetPocketResponse';
23
24
  export * from './dtos/PocketItem';
@@ -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
+ }
@@ -40,3 +40,4 @@ export * from "./RemittanceCohort";
40
40
  export * from "./RemittanceAuditLog";
41
41
  export * from "./RemittanceSegment";
42
42
  export * from "./RemittanceCommittee";
43
+ export * from "./RemittancePricing";
@@ -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
+ };
@@ -11,3 +11,4 @@ export * from "./CohortRefresh";
11
11
  export * from "./AuditAction";
12
12
  export * from "./AuditEntityType";
13
13
  export * from "./SegmentMemberType";
14
+ export * from "./RemittanceCorridor";
@@ -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";