@fiado/type-kit 3.153.0 → 3.155.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.
Files changed (65) hide show
  1. package/_test_/unit/platformRbac/auth/PrepareChallengeRequest.test.ts +1 -1
  2. package/bin/messagesConnector/dtos/AgentSendNotificationRequest.d.ts +26 -0
  3. package/bin/messagesConnector/dtos/AgentSendNotificationRequest.js +125 -0
  4. package/bin/messagesConnector/index.d.ts +1 -0
  5. package/bin/messagesConnector/index.js +1 -0
  6. package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +22 -0
  7. package/bin/{walletFunding/dtos/CancelFundingRequest.js → platformRbac/dtos/ResendOtpRequest.js} +16 -13
  8. package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
  9. package/bin/{cognitoBackofficeConnector/dtos/MfaPoolConfig.js → platformRbac/dtos/ResendSelfRegisterOtpRequest.js} +18 -18
  10. package/bin/remittance/dtos/RemittancePromotion.d.ts +90 -0
  11. package/bin/remittance/dtos/RemittancePromotion.js +150 -0
  12. package/bin/remittance/dtos/index.d.ts +1 -0
  13. package/bin/remittance/dtos/index.js +1 -0
  14. package/bin/remittance/dtos/internal/RemittancePromotionReach.d.ts +17 -0
  15. package/bin/remittance/dtos/internal/RemittancePromotionReach.js +44 -0
  16. package/bin/remittance/enums/FeeEffectMode.d.ts +7 -0
  17. package/bin/remittance/enums/FeeEffectMode.js +11 -0
  18. package/bin/remittance/enums/FxEffectMode.d.ts +6 -0
  19. package/bin/remittance/enums/FxEffectMode.js +10 -0
  20. package/bin/remittance/enums/PromotionActivation.d.ts +7 -0
  21. package/bin/remittance/enums/PromotionActivation.js +11 -0
  22. package/bin/remittance/enums/PromotionKind.d.ts +9 -0
  23. package/bin/remittance/enums/PromotionKind.js +13 -0
  24. package/bin/remittance/enums/PromotionStatus.d.ts +7 -0
  25. package/bin/remittance/enums/PromotionStatus.js +11 -0
  26. package/bin/remittance/enums/index.d.ts +5 -0
  27. package/bin/remittance/enums/index.js +5 -0
  28. package/bin/remittance/index.d.ts +1 -0
  29. package/bin/remittance/index.js +1 -0
  30. package/package.json +1 -1
  31. package/src/messagesConnector/dtos/AgentSendNotificationRequest.ts +29 -0
  32. package/src/messagesConnector/index.ts +1 -0
  33. package/src/platformRbac/auth/PrepareChallengeRequest.ts +1 -1
  34. package/src/remittance/dtos/RemittancePromotion.ts +162 -0
  35. package/src/remittance/dtos/index.ts +1 -0
  36. package/src/remittance/dtos/internal/RemittancePromotionReach.ts +31 -0
  37. package/src/remittance/enums/FeeEffectMode.ts +7 -0
  38. package/src/remittance/enums/FxEffectMode.ts +6 -0
  39. package/src/remittance/enums/PromotionActivation.ts +7 -0
  40. package/src/remittance/enums/PromotionKind.ts +9 -0
  41. package/src/remittance/enums/PromotionStatus.ts +7 -0
  42. package/src/remittance/enums/index.ts +5 -0
  43. package/src/remittance/index.ts +1 -0
  44. package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.d.ts +0 -7
  45. package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +0 -20
  46. package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +0 -11
  47. package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +0 -4
  48. package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +0 -6
  49. package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.d.ts +0 -17
  50. package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.js +0 -39
  51. package/bin/rbac/enums/PoolKind.d.ts +0 -16
  52. package/bin/rbac/enums/PoolKind.js +0 -20
  53. package/bin/rbac/index.d.ts +0 -1
  54. package/bin/rbac/index.js +0 -17
  55. package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +0 -5
  56. package/bin/walletFunding/dtos/CancelFundingReferenceRequest.js +0 -31
  57. package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +0 -7
  58. package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +0 -6
  59. package/bin/walletFunding/dtos/CancelFundingRequest.d.ts +0 -11
  60. package/bin/walletFunding/dtos/CancelFundingResponse.d.ts +0 -14
  61. package/bin/walletFunding/dtos/CancelFundingResponse.js +0 -12
  62. package/bin/walletFunding/dtos/CancelWalletFundingRequest.d.ts +0 -3
  63. package/bin/walletFunding/dtos/CancelWalletFundingRequest.js +0 -21
  64. package/bin/walletFunding/dtos/CancelWalletFundingResponse.d.ts +0 -7
  65. package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +0 -6
@@ -5,7 +5,7 @@ import { PrepareChallengeRequest } from '../../../../src/platformRbac/auth/Prepa
5
5
  import { ChallengeNameEnum } from '../../../../src/platformRbac/enums/ChallengeNameEnum';
6
6
 
7
7
  /**
8
- * DEC-RBAC-093: `email` es opcional y robusto a string vacío. Un usuario phone-primario
8
+ * DEC-RBAC-094: `email` es opcional y robusto a string vacío. Un usuario phone-primario
9
9
  * (sin email) hace login MFA (SMS_OTP / TOTP) sin email — el trigger CreateAuthChallenge
10
10
  * ya no manda `''`. `@ValidateIf` saltea undefined/null/'' (`@IsOptional` NO saltea `''`).
11
11
  * La rama EMAIL_OTP del preparer sigue necesitando email en runtime — eso NO lo valida el DTO.
@@ -0,0 +1,26 @@
1
+ import { DeliveryChannelEnum } from '../../messaging';
2
+ /**
3
+ * DTO del endpoint agent `POST /v2/agents/notifications` (messages-business).
4
+ * Espejo de SendMessageRequest, pero `directoryId` es opcional/string (NO @IsUUID):
5
+ * el flujo agent (shortlink SMS pre-onboarding) manda el literal "NONE" cuando aún
6
+ * no hay una persona con UUID.
7
+ */
8
+ export declare class AgentSendNotificationRequest {
9
+ channelType: DeliveryChannelEnum;
10
+ messageType: string;
11
+ directoryId?: string;
12
+ typeOfDirectory: string;
13
+ language: string;
14
+ country: string;
15
+ destination?: string;
16
+ var1?: string;
17
+ var2?: string;
18
+ var3?: string;
19
+ var4?: string;
20
+ var5?: string;
21
+ beneficiaryDirectoryId?: string;
22
+ beneficiaryTypeOfDirectoryId?: string;
23
+ options?: Record<string, unknown>;
24
+ referenceMessageId?: string;
25
+ transactionNumber?: string;
26
+ }
@@ -0,0 +1,125 @@
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.AgentSendNotificationRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const messaging_1 = require("../../messaging");
16
+ /**
17
+ * DTO del endpoint agent `POST /v2/agents/notifications` (messages-business).
18
+ * Espejo de SendMessageRequest, pero `directoryId` es opcional/string (NO @IsUUID):
19
+ * el flujo agent (shortlink SMS pre-onboarding) manda el literal "NONE" cuando aún
20
+ * no hay una persona con UUID.
21
+ */
22
+ class AgentSendNotificationRequest {
23
+ }
24
+ exports.AgentSendNotificationRequest = AgentSendNotificationRequest;
25
+ __decorate([
26
+ (0, class_transformer_1.Expose)(),
27
+ (0, class_validator_1.IsEnum)(messaging_1.DeliveryChannelEnum),
28
+ __metadata("design:type", String)
29
+ ], AgentSendNotificationRequest.prototype, "channelType", void 0);
30
+ __decorate([
31
+ (0, class_transformer_1.Expose)(),
32
+ (0, class_validator_1.IsString)(),
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ __metadata("design:type", String)
35
+ ], AgentSendNotificationRequest.prototype, "messageType", void 0);
36
+ __decorate([
37
+ (0, class_transformer_1.Expose)(),
38
+ (0, class_validator_1.IsOptional)(),
39
+ (0, class_validator_1.IsString)(),
40
+ __metadata("design:type", String)
41
+ ], AgentSendNotificationRequest.prototype, "directoryId", void 0);
42
+ __decorate([
43
+ (0, class_transformer_1.Expose)(),
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.IsNotEmpty)(),
46
+ __metadata("design:type", String)
47
+ ], AgentSendNotificationRequest.prototype, "typeOfDirectory", void 0);
48
+ __decorate([
49
+ (0, class_transformer_1.Expose)(),
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.IsNotEmpty)(),
52
+ __metadata("design:type", String)
53
+ ], AgentSendNotificationRequest.prototype, "language", void 0);
54
+ __decorate([
55
+ (0, class_transformer_1.Expose)(),
56
+ (0, class_validator_1.IsString)(),
57
+ (0, class_validator_1.IsNotEmpty)(),
58
+ __metadata("design:type", String)
59
+ ], AgentSendNotificationRequest.prototype, "country", void 0);
60
+ __decorate([
61
+ (0, class_transformer_1.Expose)(),
62
+ (0, class_validator_1.IsOptional)(),
63
+ (0, class_validator_1.IsString)(),
64
+ __metadata("design:type", String)
65
+ ], AgentSendNotificationRequest.prototype, "destination", void 0);
66
+ __decorate([
67
+ (0, class_transformer_1.Expose)(),
68
+ (0, class_validator_1.IsOptional)(),
69
+ (0, class_validator_1.IsString)(),
70
+ __metadata("design:type", String)
71
+ ], AgentSendNotificationRequest.prototype, "var1", void 0);
72
+ __decorate([
73
+ (0, class_transformer_1.Expose)(),
74
+ (0, class_validator_1.IsOptional)(),
75
+ (0, class_validator_1.IsString)(),
76
+ __metadata("design:type", String)
77
+ ], AgentSendNotificationRequest.prototype, "var2", void 0);
78
+ __decorate([
79
+ (0, class_transformer_1.Expose)(),
80
+ (0, class_validator_1.IsOptional)(),
81
+ (0, class_validator_1.IsString)(),
82
+ __metadata("design:type", String)
83
+ ], AgentSendNotificationRequest.prototype, "var3", void 0);
84
+ __decorate([
85
+ (0, class_transformer_1.Expose)(),
86
+ (0, class_validator_1.IsOptional)(),
87
+ (0, class_validator_1.IsString)(),
88
+ __metadata("design:type", String)
89
+ ], AgentSendNotificationRequest.prototype, "var4", void 0);
90
+ __decorate([
91
+ (0, class_transformer_1.Expose)(),
92
+ (0, class_validator_1.IsOptional)(),
93
+ (0, class_validator_1.IsString)(),
94
+ __metadata("design:type", String)
95
+ ], AgentSendNotificationRequest.prototype, "var5", void 0);
96
+ __decorate([
97
+ (0, class_transformer_1.Expose)(),
98
+ (0, class_validator_1.IsOptional)(),
99
+ (0, class_validator_1.IsUUID)(),
100
+ __metadata("design:type", String)
101
+ ], AgentSendNotificationRequest.prototype, "beneficiaryDirectoryId", void 0);
102
+ __decorate([
103
+ (0, class_transformer_1.Expose)(),
104
+ (0, class_validator_1.IsOptional)(),
105
+ (0, class_validator_1.IsString)(),
106
+ __metadata("design:type", String)
107
+ ], AgentSendNotificationRequest.prototype, "beneficiaryTypeOfDirectoryId", void 0);
108
+ __decorate([
109
+ (0, class_transformer_1.Expose)(),
110
+ (0, class_validator_1.IsOptional)(),
111
+ (0, class_validator_1.IsObject)(),
112
+ __metadata("design:type", Object)
113
+ ], AgentSendNotificationRequest.prototype, "options", void 0);
114
+ __decorate([
115
+ (0, class_transformer_1.Expose)(),
116
+ (0, class_validator_1.IsOptional)(),
117
+ (0, class_validator_1.IsUUID)(),
118
+ __metadata("design:type", String)
119
+ ], AgentSendNotificationRequest.prototype, "referenceMessageId", void 0);
120
+ __decorate([
121
+ (0, class_transformer_1.Expose)(),
122
+ (0, class_validator_1.IsOptional)(),
123
+ (0, class_validator_1.IsString)(),
124
+ __metadata("design:type", String)
125
+ ], AgentSendNotificationRequest.prototype, "transactionNumber", void 0);
@@ -2,6 +2,7 @@ export * from './enums/DeliveryChannelExtendedEnum';
2
2
  export * from './validators/IsStringValueRecord';
3
3
  export * from './dtos/NotificationQueueMessageRequestV2';
4
4
  export * from './dtos/SendMessageRequest';
5
+ export * from './dtos/AgentSendNotificationRequest';
5
6
  export * from './dtos/SendMessageResponse';
6
7
  export * from './dtos/VerifyOtpRequest';
7
8
  export * from './dtos/VerifyOtpResponse';
@@ -18,6 +18,7 @@ __exportStar(require("./enums/DeliveryChannelExtendedEnum"), exports);
18
18
  __exportStar(require("./validators/IsStringValueRecord"), exports);
19
19
  __exportStar(require("./dtos/NotificationQueueMessageRequestV2"), exports);
20
20
  __exportStar(require("./dtos/SendMessageRequest"), exports);
21
+ __exportStar(require("./dtos/AgentSendNotificationRequest"), exports);
21
22
  __exportStar(require("./dtos/SendMessageResponse"), exports);
22
23
  __exportStar(require("./dtos/VerifyOtpRequest"), exports);
23
24
  __exportStar(require("./dtos/VerifyOtpResponse"), exports);
@@ -0,0 +1,22 @@
1
+ import { MfaMethodEnum } from '../enums/MfaMethodEnum';
2
+ /**
3
+ * Body del POST /auth/resend-otp (público, anónimo). DEC-RBAC-054.
4
+ * Reenvía el OTP del login re-disparando el challenge real CUSTOM_AUTH (EMAIL_OTP) para la
5
+ * identidad SIN password. `tenantId` obligatorio (DEC-064 — el picker ya lo resolvió, NO "solo email").
6
+ * El email se normaliza lowercase server-side. Postura anti-enumeración: respuesta 200 genérica
7
+ * siempre, sin filtrar existencia (ver AuthLoginManager.resendChallengeOtp).
8
+ */
9
+ export declare class ResendOtpRequest {
10
+ email: string;
11
+ tenantId: string;
12
+ }
13
+ /**
14
+ * Respuesta del resend-otp. `session`/`mfaMethod` frescos del nuevo challenge CUSTOM_AUTH.
15
+ * Plain sin validators (no validamos lo que mandamos al cliente — fiado-validation-and-dtos § 7).
16
+ * Ambos opcionales: en los caminos de rechazo silencioso (anti-enumeración) o ramas sin CUSTOM_AUTH
17
+ * el server responde 200 genérico sin session ni método.
18
+ */
19
+ export interface ResendOtpResponse {
20
+ session?: string;
21
+ mfaMethod?: MfaMethodEnum;
22
+ }
@@ -9,25 +9,28 @@ 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.CancelFundingRequest = void 0;
12
+ exports.ResendOtpRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
13
14
  const class_validator_1 = require("class-validator");
14
15
  /**
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).
16
+ * Body del POST /auth/resend-otp (público, anónimo). DEC-RBAC-054.
17
+ * Reenvía el OTP del login re-disparando el challenge real CUSTOM_AUTH (EMAIL_OTP) para la
18
+ * identidad SIN password. `tenantId` obligatorio (DEC-064 el picker ya lo resolvió, NO "solo email").
19
+ * El email se normaliza lowercase server-side. Postura anti-enumeración: respuesta 200 genérica
20
+ * siempre, sin filtrar existencia (ver AuthLoginManager.resendChallengeOtp).
20
21
  */
21
- class CancelFundingRequest {
22
+ class ResendOtpRequest {
22
23
  }
23
- exports.CancelFundingRequest = CancelFundingRequest;
24
+ exports.ResendOtpRequest = ResendOtpRequest;
24
25
  __decorate([
25
- (0, class_validator_1.IsString)(),
26
- (0, class_validator_1.MaxLength)(64),
26
+ (0, class_transformer_1.Expose)(),
27
+ (0, class_validator_1.IsEmail)(),
28
+ (0, class_validator_1.IsNotEmpty)(),
27
29
  __metadata("design:type", String)
28
- ], CancelFundingRequest.prototype, "idempotencyKey", void 0);
30
+ ], ResendOtpRequest.prototype, "email", void 0);
29
31
  __decorate([
32
+ (0, class_transformer_1.Expose)(),
30
33
  (0, class_validator_1.IsString)(),
31
- (0, class_validator_1.MaxLength)(128),
34
+ (0, class_validator_1.IsNotEmpty)(),
32
35
  __metadata("design:type", String)
33
- ], CancelFundingRequest.prototype, "providerModuleName", void 0);
36
+ ], ResendOtpRequest.prototype, "tenantId", void 0);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
3
+ * Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
4
+ * `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
5
+ * server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
6
+ * scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
7
+ */
8
+ export declare class ResendSelfRegisterOtpRequest {
9
+ tenantId: string;
10
+ email: string;
11
+ }
@@ -9,28 +9,28 @@ 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.MfaPoolConfig = void 0;
12
+ exports.ResendSelfRegisterOtpRequest = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
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 {
15
+ /**
16
+ * Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
17
+ * Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
18
+ * `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
19
+ * server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
20
+ * scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
21
+ */
22
+ class ResendSelfRegisterOtpRequest {
23
23
  }
24
- exports.MfaPoolConfig = MfaPoolConfig;
24
+ exports.ResendSelfRegisterOtpRequest = ResendSelfRegisterOtpRequest;
25
25
  __decorate([
26
26
  (0, class_transformer_1.Expose)(),
27
- (0, class_validator_1.IsBoolean)(),
28
- __metadata("design:type", Boolean)
29
- ], MfaPoolConfig.prototype, "requireMfa", void 0);
27
+ (0, class_validator_1.IsString)(),
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ __metadata("design:type", String)
30
+ ], ResendSelfRegisterOtpRequest.prototype, "tenantId", void 0);
30
31
  __decorate([
31
32
  (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);
33
+ (0, class_validator_1.IsEmail)(),
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ __metadata("design:type", String)
36
+ ], ResendSelfRegisterOtpRequest.prototype, "email", void 0);
@@ -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
+ }
@@ -0,0 +1,150 @@
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.PromotionReachResponse = exports.PromotionListResponse = exports.Promotion = exports.UpdatePromotionRequest = exports.CreatePromotionRequest = exports.FeeEffect = exports.FxEffect = exports.PromotionAudience = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const FeeEffectMode_1 = require("../enums/FeeEffectMode");
16
+ const FxEffectMode_1 = require("../enums/FxEffectMode");
17
+ const PromotionActivation_1 = require("../enums/PromotionActivation");
18
+ const PromotionKind_1 = require("../enums/PromotionKind");
19
+ const RemittanceCorridor_1 = require("../enums/RemittanceCorridor");
20
+ /**
21
+ * DTOs de Promociones (Dashboard Ops · Variables Operativas §2).
22
+ *
23
+ * UniTeller NO participa (no hay motor de promos en API Lite): toda la lógica
24
+ * vive en Fiado. Una promo es un OVERRIDE de Precio Base (markup y/o fee) para
25
+ * una audiencia (corridor × segmento × cohort, null = Cualquiera) y vigencia.
26
+ * Dueño de la tabla: remittance-business (RemittancePromotions_GT). La
27
+ * resolución en send-time (capas: base → PRICE_CHANGE → mejor-para-el-cliente)
28
+ * es Fase B — estos DTOs cubren la config.
29
+ */
30
+ const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
31
+ /** Audiencia: null en una dimensión = "Cualquiera". */
32
+ class PromotionAudience {
33
+ }
34
+ exports.PromotionAudience = PromotionAudience;
35
+ __decorate([
36
+ (0, class_validator_1.IsOptional)(),
37
+ (0, class_validator_1.IsEnum)(RemittanceCorridor_1.RemittanceCorridor),
38
+ __metadata("design:type", String)
39
+ ], PromotionAudience.prototype, "corridor", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsOptional)(),
42
+ (0, class_validator_1.IsString)(),
43
+ (0, class_validator_1.Length)(1, 100),
44
+ __metadata("design:type", String)
45
+ ], PromotionAudience.prototype, "segmentId", void 0);
46
+ __decorate([
47
+ (0, class_validator_1.IsOptional)(),
48
+ (0, class_validator_1.IsString)(),
49
+ (0, class_validator_1.Length)(1, 100),
50
+ __metadata("design:type", String)
51
+ ], PromotionAudience.prototype, "cohortId", void 0);
52
+ /** Efecto FX (spread): DELTA suma bps CON SIGNO al markup base; ABSOLUTE lo reemplaza. */
53
+ class FxEffect {
54
+ }
55
+ exports.FxEffect = FxEffect;
56
+ __decorate([
57
+ (0, class_validator_1.IsEnum)(FxEffectMode_1.FxEffectMode),
58
+ __metadata("design:type", String)
59
+ ], FxEffect.prototype, "mode", void 0);
60
+ __decorate([
61
+ (0, class_validator_1.IsInt)(),
62
+ (0, class_validator_1.Min)(-500),
63
+ (0, class_validator_1.Max)(500),
64
+ __metadata("design:type", Number)
65
+ ], FxEffect.prototype, "valueBps", void 0);
66
+ /** Efecto fee: ABSOLUTE = $; DELTA = ±$; PERCENTAGE = −% del fee (0-100). */
67
+ class FeeEffect {
68
+ }
69
+ exports.FeeEffect = FeeEffect;
70
+ __decorate([
71
+ (0, class_validator_1.IsEnum)(FeeEffectMode_1.FeeEffectMode),
72
+ __metadata("design:type", String)
73
+ ], FeeEffect.prototype, "mode", void 0);
74
+ __decorate([
75
+ (0, class_validator_1.IsNumber)(),
76
+ (0, class_validator_1.Min)(-100),
77
+ (0, class_validator_1.Max)(100),
78
+ __metadata("design:type", Number)
79
+ ], FeeEffect.prototype, "value", void 0);
80
+ class CreatePromotionRequest {
81
+ }
82
+ exports.CreatePromotionRequest = CreatePromotionRequest;
83
+ __decorate([
84
+ (0, class_validator_1.IsString)(),
85
+ (0, class_validator_1.Length)(3, 100),
86
+ __metadata("design:type", String)
87
+ ], CreatePromotionRequest.prototype, "name", void 0);
88
+ __decorate([
89
+ (0, class_validator_1.IsEnum)(PromotionKind_1.PromotionKind),
90
+ __metadata("design:type", String)
91
+ ], CreatePromotionRequest.prototype, "kind", void 0);
92
+ __decorate([
93
+ (0, class_validator_1.IsEnum)(PromotionActivation_1.PromotionActivation),
94
+ __metadata("design:type", String)
95
+ ], CreatePromotionRequest.prototype, "activation", void 0);
96
+ __decorate([
97
+ (0, class_validator_1.IsOptional)(),
98
+ (0, class_validator_1.IsString)(),
99
+ (0, class_validator_1.Length)(3, 30),
100
+ (0, class_validator_1.Matches)(/^[A-Z0-9_-]+$/i),
101
+ __metadata("design:type", String)
102
+ ], CreatePromotionRequest.prototype, "code", void 0);
103
+ __decorate([
104
+ (0, class_validator_1.ValidateNested)(),
105
+ (0, class_transformer_1.Type)(() => PromotionAudience),
106
+ __metadata("design:type", PromotionAudience)
107
+ ], CreatePromotionRequest.prototype, "audience", void 0);
108
+ __decorate([
109
+ (0, class_validator_1.IsString)(),
110
+ (0, class_validator_1.Matches)(ISO_DATE),
111
+ __metadata("design:type", String)
112
+ ], CreatePromotionRequest.prototype, "effectiveFrom", void 0);
113
+ __decorate([
114
+ (0, class_validator_1.IsOptional)(),
115
+ (0, class_validator_1.IsString)(),
116
+ (0, class_validator_1.Matches)(ISO_DATE),
117
+ __metadata("design:type", String)
118
+ ], CreatePromotionRequest.prototype, "effectiveTo", void 0);
119
+ __decorate([
120
+ (0, class_validator_1.ValidateNested)(),
121
+ (0, class_transformer_1.Type)(() => FxEffect),
122
+ __metadata("design:type", FxEffect)
123
+ ], CreatePromotionRequest.prototype, "fxEffect", void 0);
124
+ __decorate([
125
+ (0, class_validator_1.ValidateNested)(),
126
+ (0, class_transformer_1.Type)(() => FeeEffect),
127
+ __metadata("design:type", FeeEffect)
128
+ ], CreatePromotionRequest.prototype, "feeEffect", void 0);
129
+ __decorate([
130
+ (0, class_validator_1.IsOptional)(),
131
+ (0, class_validator_1.IsString)(),
132
+ (0, class_validator_1.MaxLength)(500),
133
+ __metadata("design:type", String)
134
+ ], CreatePromotionRequest.prototype, "notes", void 0);
135
+ /** PUT — reemplazo completo (mismos campos que create). */
136
+ class UpdatePromotionRequest extends CreatePromotionRequest {
137
+ }
138
+ exports.UpdatePromotionRequest = UpdatePromotionRequest;
139
+ /** Promoción completa (response de list/create/update). */
140
+ class Promotion {
141
+ }
142
+ exports.Promotion = Promotion;
143
+ /** Response de GET /backoffice/pricing/promotions. */
144
+ class PromotionListResponse {
145
+ }
146
+ exports.PromotionListResponse = PromotionListResponse;
147
+ /** Response de GET /backoffice/pricing/promotions/reach. */
148
+ class PromotionReachResponse {
149
+ }
150
+ exports.PromotionReachResponse = PromotionReachResponse;
@@ -41,3 +41,4 @@ export * from "./RemittanceAuditLog";
41
41
  export * from "./RemittanceSegment";
42
42
  export * from "./RemittanceCommittee";
43
43
  export * from "./RemittancePricing";
44
+ export * from "./RemittancePromotion";
@@ -57,3 +57,4 @@ __exportStar(require("./RemittanceAuditLog"), exports);
57
57
  __exportStar(require("./RemittanceSegment"), exports);
58
58
  __exportStar(require("./RemittanceCommittee"), exports);
59
59
  __exportStar(require("./RemittancePricing"), exports);
60
+ __exportStar(require("./RemittancePromotion"), exports);
@@ -0,0 +1,17 @@
1
+ import { CohortCondition } from "../RemittanceCohort";
2
+ import { RemittanceCorridor } from "../../enums/RemittanceCorridor";
3
+ /**
4
+ * Contrato interno del reach de Promociones (puente Opción A):
5
+ * POST /backoffice/config/promotions/reach (privado connector). rb resuelve las
6
+ * dimensiones a datos crudos — segmento → directoryIds; cohort → conditions;
7
+ * corredor → corridor — y el connector computa la intersección sobre el universo
8
+ * de RemittanceUsers. Toda dimensión AUSENTE = no filtra ("Cualquiera").
9
+ */
10
+ export declare class PromotionReachRequest {
11
+ /** Miembros del segmento (resueltos por rb). Ausente = todos los usuarios. */
12
+ directoryIds?: string[];
13
+ /** Condiciones del cohort (AND, evaluadas como en cohortCount). Ausente = sin filtro. */
14
+ conditions?: CohortCondition[];
15
+ /** Filtro por corredor (countryISO de CORRIDOR_INFO, ≥1 tx no-cancelada histórica). Ausente = sin filtro. */
16
+ corridor?: RemittanceCorridor;
17
+ }
@@ -0,0 +1,44 @@
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.PromotionReachRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const RemittanceCohort_1 = require("../RemittanceCohort");
16
+ const RemittanceCorridor_1 = require("../../enums/RemittanceCorridor");
17
+ /**
18
+ * Contrato interno del reach de Promociones (puente Opción A):
19
+ * POST /backoffice/config/promotions/reach (privado connector). rb resuelve las
20
+ * dimensiones a datos crudos — segmento → directoryIds; cohort → conditions;
21
+ * corredor → corridor — y el connector computa la intersección sobre el universo
22
+ * de RemittanceUsers. Toda dimensión AUSENTE = no filtra ("Cualquiera").
23
+ */
24
+ class PromotionReachRequest {
25
+ }
26
+ exports.PromotionReachRequest = PromotionReachRequest;
27
+ __decorate([
28
+ (0, class_validator_1.IsOptional)(),
29
+ (0, class_validator_1.IsArray)(),
30
+ (0, class_validator_1.IsUUID)("4", { each: true }),
31
+ __metadata("design:type", Array)
32
+ ], PromotionReachRequest.prototype, "directoryIds", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsOptional)(),
35
+ (0, class_validator_1.IsArray)(),
36
+ (0, class_validator_1.ValidateNested)({ each: true }),
37
+ (0, class_transformer_1.Type)(() => RemittanceCohort_1.CohortCondition),
38
+ __metadata("design:type", Array)
39
+ ], PromotionReachRequest.prototype, "conditions", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsOptional)(),
42
+ (0, class_validator_1.IsEnum)(RemittanceCorridor_1.RemittanceCorridor),
43
+ __metadata("design:type", String)
44
+ ], PromotionReachRequest.prototype, "corridor", void 0);
@@ -0,0 +1,7 @@
1
+ /** Efecto de la promo sobre el service fee (relativo a la base efectiva). */
2
+ export declare enum FeeEffectMode {
3
+ NONE = "NONE",// sin cambio
4
+ ABSOLUTE = "ABSOLUTE",// fee = value (USD)
5
+ DELTA = "DELTA",// baseFee + value (CON SIGNO)
6
+ PERCENTAGE = "PERCENTAGE"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FeeEffectMode = void 0;
4
+ /** Efecto de la promo sobre el service fee (relativo a la base efectiva). */
5
+ var FeeEffectMode;
6
+ (function (FeeEffectMode) {
7
+ FeeEffectMode["NONE"] = "NONE";
8
+ FeeEffectMode["ABSOLUTE"] = "ABSOLUTE";
9
+ FeeEffectMode["DELTA"] = "DELTA";
10
+ FeeEffectMode["PERCENTAGE"] = "PERCENTAGE";
11
+ })(FeeEffectMode || (exports.FeeEffectMode = FeeEffectMode = {}));
@@ -0,0 +1,6 @@
1
+ /** Efecto de la promo sobre el spread FX (relativo a la base efectiva). */
2
+ export declare enum FxEffectMode {
3
+ NONE = "NONE",// sin cambio
4
+ DELTA = "DELTA",// baseMarkup + valueBps (CON SIGNO)
5
+ ABSOLUTE = "ABSOLUTE"
6
+ }