@fiado/type-kit 3.29.0 → 3.31.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 (37) hide show
  1. package/bin/messagesConnector/dtos/TemplateMessageCreateRequest.d.ts +16 -0
  2. package/bin/messagesConnector/dtos/TemplateMessageCreateRequest.js +72 -0
  3. package/bin/messagesConnector/dtos/TemplateMessageListFiltersRequest.d.ts +14 -0
  4. package/bin/messagesConnector/dtos/TemplateMessageListFiltersRequest.js +67 -0
  5. package/bin/messagesConnector/dtos/TemplateMessageListResponse.d.ts +10 -0
  6. package/bin/messagesConnector/dtos/TemplateMessageListResponse.js +31 -0
  7. package/bin/messagesConnector/dtos/TemplateMessageResponse.d.ts +23 -0
  8. package/bin/messagesConnector/dtos/TemplateMessageResponse.js +79 -0
  9. package/bin/messagesConnector/dtos/TemplateMessageUpdateRequest.d.ts +16 -0
  10. package/bin/messagesConnector/dtos/TemplateMessageUpdateRequest.js +56 -0
  11. package/bin/messagesConnector/index.d.ts +6 -0
  12. package/bin/messagesConnector/index.js +6 -0
  13. package/bin/messagesConnector/validators/IsTemplatePlaceholders.d.ts +15 -0
  14. package/bin/messagesConnector/validators/IsTemplatePlaceholders.js +58 -0
  15. package/bin/remittance/dtos/RemittancePayerAdditionalFieldDto.d.ts +30 -0
  16. package/bin/remittance/dtos/RemittancePayerAdditionalFieldDto.js +2 -0
  17. package/bin/remittance/dtos/RemittancePayerBranchDto.d.ts +28 -0
  18. package/bin/remittance/dtos/RemittancePayerBranchDto.js +2 -0
  19. package/bin/remittance/dtos/RemittancePayerDto.d.ts +34 -0
  20. package/bin/remittance/dtos/RemittancePayerDto.js +2 -0
  21. package/bin/remittance/dtos/RemittanceStateDto.d.ts +11 -0
  22. package/bin/remittance/dtos/RemittanceStateDto.js +2 -0
  23. package/bin/remittance/dtos/index.d.ts +4 -0
  24. package/bin/remittance/dtos/index.js +4 -0
  25. package/package.json +1 -1
  26. package/src/messagesConnector/dtos/TemplateMessageCreateRequest.ts +51 -0
  27. package/src/messagesConnector/dtos/TemplateMessageListFiltersRequest.ts +47 -0
  28. package/src/messagesConnector/dtos/TemplateMessageListResponse.ts +16 -0
  29. package/src/messagesConnector/dtos/TemplateMessageResponse.ts +52 -0
  30. package/src/messagesConnector/dtos/TemplateMessageUpdateRequest.ts +39 -0
  31. package/src/messagesConnector/index.ts +6 -0
  32. package/src/messagesConnector/validators/IsTemplatePlaceholders.ts +45 -0
  33. package/src/remittance/dtos/RemittancePayerAdditionalFieldDto.ts +27 -0
  34. package/src/remittance/dtos/RemittancePayerBranchDto.ts +29 -0
  35. package/src/remittance/dtos/RemittancePayerDto.ts +35 -0
  36. package/src/remittance/dtos/RemittanceStateDto.ts +11 -0
  37. package/src/remittance/dtos/index.ts +4 -0
@@ -0,0 +1,16 @@
1
+ import { ContentTypeEnum, DeliveryChannelEnum } from '../../messaging';
2
+ /**
3
+ * Body para POST /templates (backoffice). Identifica un template por sus 4
4
+ * componentes de PK (messageType, channelType, language, country) + campos
5
+ * de contenido. `typeOfDirectoryId` es campo no-key del Row (ver TD pendiente).
6
+ */
7
+ export declare class TemplateMessageCreateRequest {
8
+ messageType: string;
9
+ channelType: DeliveryChannelEnum;
10
+ language: string;
11
+ country: string;
12
+ typeOfDirectoryId: string;
13
+ template: string;
14
+ contentType: ContentTypeEnum;
15
+ subject?: string;
16
+ }
@@ -0,0 +1,72 @@
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.TemplateMessageCreateRequest = 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
+ const IsTemplatePlaceholders_1 = require("../validators/IsTemplatePlaceholders");
17
+ /**
18
+ * Body para POST /templates (backoffice). Identifica un template por sus 4
19
+ * componentes de PK (messageType, channelType, language, country) + campos
20
+ * de contenido. `typeOfDirectoryId` es campo no-key del Row (ver TD pendiente).
21
+ */
22
+ class TemplateMessageCreateRequest {
23
+ }
24
+ exports.TemplateMessageCreateRequest = TemplateMessageCreateRequest;
25
+ __decorate([
26
+ (0, class_transformer_1.Expose)(),
27
+ (0, class_validator_1.IsString)(),
28
+ (0, class_validator_1.IsNotEmpty)(),
29
+ __metadata("design:type", String)
30
+ ], TemplateMessageCreateRequest.prototype, "messageType", void 0);
31
+ __decorate([
32
+ (0, class_transformer_1.Expose)(),
33
+ (0, class_validator_1.IsEnum)(messaging_1.DeliveryChannelEnum),
34
+ __metadata("design:type", String)
35
+ ], TemplateMessageCreateRequest.prototype, "channelType", void 0);
36
+ __decorate([
37
+ (0, class_transformer_1.Expose)(),
38
+ (0, class_validator_1.IsString)(),
39
+ (0, class_validator_1.IsNotEmpty)(),
40
+ __metadata("design:type", String)
41
+ ], TemplateMessageCreateRequest.prototype, "language", 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
+ ], TemplateMessageCreateRequest.prototype, "country", 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
+ ], TemplateMessageCreateRequest.prototype, "typeOfDirectoryId", void 0);
54
+ __decorate([
55
+ (0, class_transformer_1.Expose)(),
56
+ (0, class_validator_1.IsString)(),
57
+ (0, class_validator_1.IsNotEmpty)(),
58
+ (0, class_validator_1.Validate)(IsTemplatePlaceholders_1.IsTemplatePlaceholders),
59
+ __metadata("design:type", String)
60
+ ], TemplateMessageCreateRequest.prototype, "template", void 0);
61
+ __decorate([
62
+ (0, class_transformer_1.Expose)(),
63
+ (0, class_validator_1.IsEnum)(messaging_1.ContentTypeEnum),
64
+ __metadata("design:type", String)
65
+ ], TemplateMessageCreateRequest.prototype, "contentType", void 0);
66
+ __decorate([
67
+ (0, class_transformer_1.Expose)(),
68
+ (0, class_validator_1.IsOptional)(),
69
+ (0, class_validator_1.IsString)(),
70
+ (0, class_validator_1.Validate)(IsTemplatePlaceholders_1.IsTemplatePlaceholders),
71
+ __metadata("design:type", String)
72
+ ], TemplateMessageCreateRequest.prototype, "subject", void 0);
@@ -0,0 +1,14 @@
1
+ import { DeliveryChannelEnum } from '../../messaging';
2
+ /**
3
+ * Query string de GET /templates. Todos los filtros son opcionales; si todos
4
+ * estan vacios, lista todo (scan paginado). `limit` default 20, max 100.
5
+ */
6
+ export declare class TemplateMessageListFiltersRequest {
7
+ messageType?: string;
8
+ channelType?: DeliveryChannelEnum;
9
+ language?: string;
10
+ country?: string;
11
+ typeOfDirectoryId?: string;
12
+ limit?: number;
13
+ cursor?: string;
14
+ }
@@ -0,0 +1,67 @@
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.TemplateMessageListFiltersRequest = 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
+ * Query string de GET /templates. Todos los filtros son opcionales; si todos
18
+ * estan vacios, lista todo (scan paginado). `limit` default 20, max 100.
19
+ */
20
+ class TemplateMessageListFiltersRequest {
21
+ }
22
+ exports.TemplateMessageListFiltersRequest = TemplateMessageListFiltersRequest;
23
+ __decorate([
24
+ (0, class_transformer_1.Expose)(),
25
+ (0, class_validator_1.IsOptional)(),
26
+ (0, class_validator_1.IsString)(),
27
+ __metadata("design:type", String)
28
+ ], TemplateMessageListFiltersRequest.prototype, "messageType", void 0);
29
+ __decorate([
30
+ (0, class_transformer_1.Expose)(),
31
+ (0, class_validator_1.IsOptional)(),
32
+ (0, class_validator_1.IsEnum)(messaging_1.DeliveryChannelEnum),
33
+ __metadata("design:type", String)
34
+ ], TemplateMessageListFiltersRequest.prototype, "channelType", void 0);
35
+ __decorate([
36
+ (0, class_transformer_1.Expose)(),
37
+ (0, class_validator_1.IsOptional)(),
38
+ (0, class_validator_1.IsString)(),
39
+ __metadata("design:type", String)
40
+ ], TemplateMessageListFiltersRequest.prototype, "language", void 0);
41
+ __decorate([
42
+ (0, class_transformer_1.Expose)(),
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_validator_1.IsString)(),
45
+ __metadata("design:type", String)
46
+ ], TemplateMessageListFiltersRequest.prototype, "country", void 0);
47
+ __decorate([
48
+ (0, class_transformer_1.Expose)(),
49
+ (0, class_validator_1.IsOptional)(),
50
+ (0, class_validator_1.IsString)(),
51
+ __metadata("design:type", String)
52
+ ], TemplateMessageListFiltersRequest.prototype, "typeOfDirectoryId", void 0);
53
+ __decorate([
54
+ (0, class_transformer_1.Expose)(),
55
+ (0, class_validator_1.IsOptional)(),
56
+ (0, class_transformer_1.Type)(() => Number),
57
+ (0, class_validator_1.IsInt)(),
58
+ (0, class_validator_1.Min)(1),
59
+ (0, class_validator_1.Max)(100),
60
+ __metadata("design:type", Number)
61
+ ], TemplateMessageListFiltersRequest.prototype, "limit", void 0);
62
+ __decorate([
63
+ (0, class_transformer_1.Expose)(),
64
+ (0, class_validator_1.IsOptional)(),
65
+ (0, class_validator_1.IsString)(),
66
+ __metadata("design:type", String)
67
+ ], TemplateMessageListFiltersRequest.prototype, "cursor", void 0);
@@ -0,0 +1,10 @@
1
+ import { TemplateMessageResponse } from './TemplateMessageResponse';
2
+ /**
3
+ * Forma del response de GET /templates (list con filtros + paginacion cursor).
4
+ * `cursor` es opaco (base64 del LastEvaluatedKey de DDB) y el cliente lo pasa
5
+ * tal cual al siguiente GET. Si no hay mas paginas, se omite.
6
+ */
7
+ export declare class TemplateMessageListResponse {
8
+ items: TemplateMessageResponse[];
9
+ cursor?: string;
10
+ }
@@ -0,0 +1,31 @@
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.TemplateMessageListResponse = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const TemplateMessageResponse_1 = require("./TemplateMessageResponse");
15
+ /**
16
+ * Forma del response de GET /templates (list con filtros + paginacion cursor).
17
+ * `cursor` es opaco (base64 del LastEvaluatedKey de DDB) y el cliente lo pasa
18
+ * tal cual al siguiente GET. Si no hay mas paginas, se omite.
19
+ */
20
+ class TemplateMessageListResponse {
21
+ }
22
+ exports.TemplateMessageListResponse = TemplateMessageListResponse;
23
+ __decorate([
24
+ (0, class_transformer_1.Expose)(),
25
+ (0, class_transformer_1.Type)(() => TemplateMessageResponse_1.TemplateMessageResponse),
26
+ __metadata("design:type", Array)
27
+ ], TemplateMessageListResponse.prototype, "items", void 0);
28
+ __decorate([
29
+ (0, class_transformer_1.Expose)(),
30
+ __metadata("design:type", String)
31
+ ], TemplateMessageListResponse.prototype, "cursor", void 0);
@@ -0,0 +1,23 @@
1
+ import { ContentTypeEnum, DeliveryChannelEnum } from '../../messaging';
2
+ /**
3
+ * Forma del template retornada por GET /templates/{id}, POST, PUT.
4
+ * El `id` es opaco (base64url de la PK compuesta) y el cliente lo trata como
5
+ * string sin parsear. El `pk` se incluye para auditoria/debug pero NO se usa
6
+ * como identificador del recurso en otras llamadas.
7
+ */
8
+ export declare class TemplateMessageResponse {
9
+ id: string;
10
+ pk: string;
11
+ messageType: string;
12
+ channelType: DeliveryChannelEnum;
13
+ language: string;
14
+ country: string;
15
+ typeOfDirectoryId: string;
16
+ template: string;
17
+ contentType: ContentTypeEnum;
18
+ subject?: string;
19
+ createdAt: number;
20
+ updatedAt: number;
21
+ createdBy?: string;
22
+ updatedBy?: string;
23
+ }
@@ -0,0 +1,79 @@
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.TemplateMessageResponse = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const messaging_1 = require("../../messaging");
15
+ /**
16
+ * Forma del template retornada por GET /templates/{id}, POST, PUT.
17
+ * El `id` es opaco (base64url de la PK compuesta) y el cliente lo trata como
18
+ * string sin parsear. El `pk` se incluye para auditoria/debug pero NO se usa
19
+ * como identificador del recurso en otras llamadas.
20
+ */
21
+ class TemplateMessageResponse {
22
+ }
23
+ exports.TemplateMessageResponse = TemplateMessageResponse;
24
+ __decorate([
25
+ (0, class_transformer_1.Expose)(),
26
+ __metadata("design:type", String)
27
+ ], TemplateMessageResponse.prototype, "id", void 0);
28
+ __decorate([
29
+ (0, class_transformer_1.Expose)(),
30
+ __metadata("design:type", String)
31
+ ], TemplateMessageResponse.prototype, "pk", void 0);
32
+ __decorate([
33
+ (0, class_transformer_1.Expose)(),
34
+ __metadata("design:type", String)
35
+ ], TemplateMessageResponse.prototype, "messageType", void 0);
36
+ __decorate([
37
+ (0, class_transformer_1.Expose)(),
38
+ __metadata("design:type", String)
39
+ ], TemplateMessageResponse.prototype, "channelType", void 0);
40
+ __decorate([
41
+ (0, class_transformer_1.Expose)(),
42
+ __metadata("design:type", String)
43
+ ], TemplateMessageResponse.prototype, "language", void 0);
44
+ __decorate([
45
+ (0, class_transformer_1.Expose)(),
46
+ __metadata("design:type", String)
47
+ ], TemplateMessageResponse.prototype, "country", void 0);
48
+ __decorate([
49
+ (0, class_transformer_1.Expose)(),
50
+ __metadata("design:type", String)
51
+ ], TemplateMessageResponse.prototype, "typeOfDirectoryId", void 0);
52
+ __decorate([
53
+ (0, class_transformer_1.Expose)(),
54
+ __metadata("design:type", String)
55
+ ], TemplateMessageResponse.prototype, "template", void 0);
56
+ __decorate([
57
+ (0, class_transformer_1.Expose)(),
58
+ __metadata("design:type", String)
59
+ ], TemplateMessageResponse.prototype, "contentType", void 0);
60
+ __decorate([
61
+ (0, class_transformer_1.Expose)(),
62
+ __metadata("design:type", String)
63
+ ], TemplateMessageResponse.prototype, "subject", void 0);
64
+ __decorate([
65
+ (0, class_transformer_1.Expose)(),
66
+ __metadata("design:type", Number)
67
+ ], TemplateMessageResponse.prototype, "createdAt", void 0);
68
+ __decorate([
69
+ (0, class_transformer_1.Expose)(),
70
+ __metadata("design:type", Number)
71
+ ], TemplateMessageResponse.prototype, "updatedAt", void 0);
72
+ __decorate([
73
+ (0, class_transformer_1.Expose)(),
74
+ __metadata("design:type", String)
75
+ ], TemplateMessageResponse.prototype, "createdBy", void 0);
76
+ __decorate([
77
+ (0, class_transformer_1.Expose)(),
78
+ __metadata("design:type", String)
79
+ ], TemplateMessageResponse.prototype, "updatedBy", void 0);
@@ -0,0 +1,16 @@
1
+ import { ContentTypeEnum } from '../../messaging';
2
+ /**
3
+ * Body para PUT /templates/{id} (backoffice). Solo campos no-key son mutables.
4
+ * Los componentes del PK (messageType, channelType, language, country) viven
5
+ * en el `{id}` opaco del path y NO se aceptan en el body (PK structurally
6
+ * immutable - ver spec seccion "Mutabilidad PK").
7
+ *
8
+ * La validacion cross-field (subject required ⇔ MAIL, HTML solo en MAIL) se
9
+ * hace en el manager con el channelType decodificado del path, no aca.
10
+ */
11
+ export declare class TemplateMessageUpdateRequest {
12
+ typeOfDirectoryId?: string;
13
+ template?: string;
14
+ contentType?: ContentTypeEnum;
15
+ subject?: string;
16
+ }
@@ -0,0 +1,56 @@
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.TemplateMessageUpdateRequest = 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
+ const IsTemplatePlaceholders_1 = require("../validators/IsTemplatePlaceholders");
17
+ /**
18
+ * Body para PUT /templates/{id} (backoffice). Solo campos no-key son mutables.
19
+ * Los componentes del PK (messageType, channelType, language, country) viven
20
+ * en el `{id}` opaco del path y NO se aceptan en el body (PK structurally
21
+ * immutable - ver spec seccion "Mutabilidad PK").
22
+ *
23
+ * La validacion cross-field (subject required ⇔ MAIL, HTML solo en MAIL) se
24
+ * hace en el manager con el channelType decodificado del path, no aca.
25
+ */
26
+ class TemplateMessageUpdateRequest {
27
+ }
28
+ exports.TemplateMessageUpdateRequest = TemplateMessageUpdateRequest;
29
+ __decorate([
30
+ (0, class_transformer_1.Expose)(),
31
+ (0, class_validator_1.IsOptional)(),
32
+ (0, class_validator_1.IsString)(),
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ __metadata("design:type", String)
35
+ ], TemplateMessageUpdateRequest.prototype, "typeOfDirectoryId", void 0);
36
+ __decorate([
37
+ (0, class_transformer_1.Expose)(),
38
+ (0, class_validator_1.IsOptional)(),
39
+ (0, class_validator_1.IsString)(),
40
+ (0, class_validator_1.IsNotEmpty)(),
41
+ (0, class_validator_1.Validate)(IsTemplatePlaceholders_1.IsTemplatePlaceholders),
42
+ __metadata("design:type", String)
43
+ ], TemplateMessageUpdateRequest.prototype, "template", void 0);
44
+ __decorate([
45
+ (0, class_transformer_1.Expose)(),
46
+ (0, class_validator_1.IsOptional)(),
47
+ (0, class_validator_1.IsEnum)(messaging_1.ContentTypeEnum),
48
+ __metadata("design:type", String)
49
+ ], TemplateMessageUpdateRequest.prototype, "contentType", void 0);
50
+ __decorate([
51
+ (0, class_transformer_1.Expose)(),
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.IsString)(),
54
+ (0, class_validator_1.Validate)(IsTemplatePlaceholders_1.IsTemplatePlaceholders),
55
+ __metadata("design:type", String)
56
+ ], TemplateMessageUpdateRequest.prototype, "subject", void 0);
@@ -9,3 +9,9 @@ export * from './dtos/NotificationsPageResponse';
9
9
  export * from './dtos/NotificationsCursorResponse';
10
10
  export * from './dtos/NotificationsV3Response';
11
11
  export * from './dtos/MessagesByDestinationResponse';
12
+ export * from './validators/IsTemplatePlaceholders';
13
+ export * from './dtos/TemplateMessageCreateRequest';
14
+ export * from './dtos/TemplateMessageUpdateRequest';
15
+ export * from './dtos/TemplateMessageResponse';
16
+ export * from './dtos/TemplateMessageListResponse';
17
+ export * from './dtos/TemplateMessageListFiltersRequest';
@@ -25,3 +25,9 @@ __exportStar(require("./dtos/NotificationsPageResponse"), exports);
25
25
  __exportStar(require("./dtos/NotificationsCursorResponse"), exports);
26
26
  __exportStar(require("./dtos/NotificationsV3Response"), exports);
27
27
  __exportStar(require("./dtos/MessagesByDestinationResponse"), exports);
28
+ __exportStar(require("./validators/IsTemplatePlaceholders"), exports);
29
+ __exportStar(require("./dtos/TemplateMessageCreateRequest"), exports);
30
+ __exportStar(require("./dtos/TemplateMessageUpdateRequest"), exports);
31
+ __exportStar(require("./dtos/TemplateMessageResponse"), exports);
32
+ __exportStar(require("./dtos/TemplateMessageListResponse"), exports);
33
+ __exportStar(require("./dtos/TemplateMessageListFiltersRequest"), exports);
@@ -0,0 +1,15 @@
1
+ import { ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
2
+ /**
3
+ * Valida que un string solo contenga placeholders bien formados `{varName}` donde
4
+ * `varName` matchea `^[a-zA-Z][a-zA-Z0-9_]*$`. Rechaza:
5
+ * - Placeholders con espacios o caracteres invalidos (`{var name}`, `{var-1}`).
6
+ * - Llaves sin balancear (`abc {def`, `abc } def`, `{ {nested}` ).
7
+ * - Placeholders vacios (`{}`).
8
+ * Acepta texto sin placeholders en absoluto.
9
+ *
10
+ * Uso en DTOs: `@Validate(IsTemplatePlaceholders)` sobre un campo string.
11
+ */
12
+ export declare class IsTemplatePlaceholders implements ValidatorConstraintInterface {
13
+ validate(value: unknown): boolean;
14
+ defaultMessage(args: ValidationArguments): string;
15
+ }
@@ -0,0 +1,58 @@
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.IsTemplatePlaceholders = void 0;
10
+ const class_validator_1 = require("class-validator");
11
+ const VALID_PLACEHOLDER = /^[a-zA-Z][a-zA-Z0-9_]*$/;
12
+ /**
13
+ * Valida que un string solo contenga placeholders bien formados `{varName}` donde
14
+ * `varName` matchea `^[a-zA-Z][a-zA-Z0-9_]*$`. Rechaza:
15
+ * - Placeholders con espacios o caracteres invalidos (`{var name}`, `{var-1}`).
16
+ * - Llaves sin balancear (`abc {def`, `abc } def`, `{ {nested}` ).
17
+ * - Placeholders vacios (`{}`).
18
+ * Acepta texto sin placeholders en absoluto.
19
+ *
20
+ * Uso en DTOs: `@Validate(IsTemplatePlaceholders)` sobre un campo string.
21
+ */
22
+ let IsTemplatePlaceholders = class IsTemplatePlaceholders {
23
+ validate(value) {
24
+ if (typeof value !== 'string')
25
+ return false;
26
+ // Detectar llaves desbalanceadas con un single-pass.
27
+ let depth = 0;
28
+ for (const ch of value) {
29
+ if (ch === '{') {
30
+ if (depth > 0)
31
+ return false; // anidado no permitido
32
+ depth = 1;
33
+ }
34
+ else if (ch === '}') {
35
+ if (depth === 0)
36
+ return false; // cierre sin apertura
37
+ depth = 0;
38
+ }
39
+ }
40
+ if (depth !== 0)
41
+ return false; // apertura sin cierre
42
+ // Validar que cada `{...}` matchea el regex.
43
+ const matches = value.match(/\{([^}]*)\}/g) ?? [];
44
+ for (const raw of matches) {
45
+ const inner = raw.slice(1, -1);
46
+ if (!VALID_PLACEHOLDER.test(inner))
47
+ return false;
48
+ }
49
+ return true;
50
+ }
51
+ defaultMessage(args) {
52
+ return `${args.property} contiene placeholders mal formados; debe seguir el patron {nombre} con nombre = [a-zA-Z][a-zA-Z0-9_]*`;
53
+ }
54
+ };
55
+ exports.IsTemplatePlaceholders = IsTemplatePlaceholders;
56
+ exports.IsTemplatePlaceholders = IsTemplatePlaceholders = __decorate([
57
+ (0, class_validator_1.ValidatorConstraint)({ name: 'IsTemplatePlaceholders', async: false })
58
+ ], IsTemplatePlaceholders);
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Campo adicional requerido por un payer/receptionMethod, devuelto por el
3
+ * endpoint público `GET /remittance/payers/{code}/fields?...`.
4
+ *
5
+ * El frontend renderiza un control según `fieldType` y valida con `regex` /
6
+ * `minLen`/`maxLen` antes de submit. El valor capturado se envía al backend
7
+ * como `additionalFieldInfo: [{ name, value }, ...]` en la request de
8
+ * AddBeneficiary o SendMoneyPreview.
9
+ *
10
+ * Ejemplo real (Banco Industrial GTQ Account Credit): 1 field `accountType`
11
+ * dropdown con opciones { key:"01", value:"Checking" }, { key:"02", value:"Savings" }.
12
+ */
13
+ export interface RemittancePayerAdditionalFieldDto {
14
+ fieldName: string;
15
+ fieldLabel: string;
16
+ /** "dropdown" | "text" | "number" | etc. — UI elige control según este valor. */
17
+ fieldType: string;
18
+ required: boolean;
19
+ /** Solo si `fieldType === "dropdown"`. */
20
+ fieldOptions?: Array<{
21
+ key: string;
22
+ value: string;
23
+ }>;
24
+ regex?: string;
25
+ minLen?: number;
26
+ maxLen?: number;
27
+ errorMsg?: string;
28
+ /** Mensaje informativo (no de error) que la UI puede mostrar como helper text. */
29
+ fieldMsg?: string;
30
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Sucursal de un payer (para método Cash Pickup), devuelta por el endpoint
3
+ * público `GET /remittance/payers/{code}/branches?...`.
4
+ *
5
+ * El frontend la consume en el flow de "Enviar dinero" cuando el beneficiario
6
+ * tiene `receptionMethod === "CASH_PICKUP"` y el payer marca `requiresBranch = true`.
7
+ *
8
+ * Nota de tamaño: un payer puede tener cientos de sucursales (ej. Gyt Continental
9
+ * GT ~300). Diseñar el UI con un buscador local sobre `name`/`address.city`.
10
+ */
11
+ export interface RemittancePayerBranchDto {
12
+ branchCode: string;
13
+ name: string;
14
+ /** Horario de atención en formato libre (ej. "0900AM-0500PM"). */
15
+ branchHours?: string;
16
+ phoneNumber?: string;
17
+ address?: RemittancePayerBranchAddressDto;
18
+ }
19
+ export interface RemittancePayerBranchAddressDto {
20
+ address1?: string;
21
+ city?: string;
22
+ /** Código ISO 3166-2 (ej. "GT-GU"). */
23
+ state?: string;
24
+ stateName?: string;
25
+ country?: string;
26
+ countryISOCode?: string;
27
+ zipCode?: string;
28
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ import { ReceptionMethod } from "../enums/ReceptionMethod";
2
+ /**
3
+ * Payer disponible para un país+currency, devuelto por el endpoint público
4
+ * `GET /remittance/countries/{iso}/payers?currencyISO=XXX`.
5
+ *
6
+ * Lo consume el frontend en Pantalla 9 (Método + Payer) del wizard de agregar
7
+ * beneficiario. Provee toda la metadata necesaria para que la app:
8
+ * 1. Muestre los métodos de recepción soportados por el payer.
9
+ * 2. Decida si el wizard debe mostrar el paso de "selección de sucursal"
10
+ * (`requiresBranch === true`) o el de "campos adicionales"
11
+ * (`requiresAdditionalFields === true`).
12
+ * 3. Valide el `accNumber` del lado del cliente con `accNumberRegex` antes
13
+ * de hacer submit (mejor UX que esperar 400 del backend).
14
+ */
15
+ export interface RemittancePayerDto {
16
+ /** Código UNIR del payer (ej. "GCA10" Banrural). Usado como `payerCode` en AddBeneficiary. */
17
+ payerCode: string;
18
+ /** Nombre legible (ej. "Banrural", "B. Industrial"). */
19
+ name: string;
20
+ /** Métodos de recepción soportados por este payer en este país+currency. */
21
+ receptionMethods: ReceptionMethod[];
22
+ /** Si true, hay que llamar a `/remittance/payers/{code}/branches` cuando el usuario elige Cash Pickup. */
23
+ requiresBranch: boolean;
24
+ /** Si true, hay que llamar a `/remittance/payers/{code}/fields` para conocer campos extra requeridos. */
25
+ requiresAdditionalFields: boolean;
26
+ /** Regex de validación del `accNumber` (solo si `receptionMethod` = ACCOUNT_CREDIT). */
27
+ accNumberRegex?: string;
28
+ /** Mensaje legible para mostrar al usuario cuando el `accNumber` no pasa el regex. */
29
+ accNumberHelperText?: string;
30
+ /** URL absoluta del logo del payer (puede no venir). */
31
+ logoUrl?: string;
32
+ /** Orden de aparición sugerido por UNIR (asc). */
33
+ sortOrder?: number;
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Estado / departamento del país destino de una remesa.
3
+ * Devuelto por el endpoint público `GET /remittance/countries/{iso}/states`.
4
+ *
5
+ * `stateISO` viene en formato ISO 3166-2 (ej. "GT-GU" Guatemala, "SV-SS" San Salvador,
6
+ * "HN-AT" Atlántida, "NI-MN" Managua).
7
+ */
8
+ export interface RemittanceStateDto {
9
+ stateISO: string;
10
+ name: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,3 +13,7 @@ export * from "./RemittanceSendPreviewResponse";
13
13
  export * from "./RemittanceTransaction";
14
14
  export * from "./RemittanceLimitsInfo";
15
15
  export * from "./RemittanceHomeResponse";
16
+ export * from "./RemittanceStateDto";
17
+ export * from "./RemittancePayerDto";
18
+ export * from "./RemittancePayerBranchDto";
19
+ export * from "./RemittancePayerAdditionalFieldDto";
@@ -29,3 +29,7 @@ __exportStar(require("./RemittanceSendPreviewResponse"), exports);
29
29
  __exportStar(require("./RemittanceTransaction"), exports);
30
30
  __exportStar(require("./RemittanceLimitsInfo"), exports);
31
31
  __exportStar(require("./RemittanceHomeResponse"), exports);
32
+ __exportStar(require("./RemittanceStateDto"), exports);
33
+ __exportStar(require("./RemittancePayerDto"), exports);
34
+ __exportStar(require("./RemittancePayerBranchDto"), exports);
35
+ __exportStar(require("./RemittancePayerAdditionalFieldDto"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.29.0",
3
+ "version": "3.31.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,51 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEnum, IsNotEmpty, IsOptional, IsString, Validate } from 'class-validator';
3
+ import { ContentTypeEnum, DeliveryChannelEnum } from '../../messaging';
4
+ import { IsTemplatePlaceholders } from '../validators/IsTemplatePlaceholders';
5
+
6
+ /**
7
+ * Body para POST /templates (backoffice). Identifica un template por sus 4
8
+ * componentes de PK (messageType, channelType, language, country) + campos
9
+ * de contenido. `typeOfDirectoryId` es campo no-key del Row (ver TD pendiente).
10
+ */
11
+ export class TemplateMessageCreateRequest {
12
+ @Expose()
13
+ @IsString()
14
+ @IsNotEmpty()
15
+ messageType!: string;
16
+
17
+ @Expose()
18
+ @IsEnum(DeliveryChannelEnum)
19
+ channelType!: DeliveryChannelEnum;
20
+
21
+ @Expose()
22
+ @IsString()
23
+ @IsNotEmpty()
24
+ language!: string;
25
+
26
+ @Expose()
27
+ @IsString()
28
+ @IsNotEmpty()
29
+ country!: string;
30
+
31
+ @Expose()
32
+ @IsString()
33
+ @IsNotEmpty()
34
+ typeOfDirectoryId!: string;
35
+
36
+ @Expose()
37
+ @IsString()
38
+ @IsNotEmpty()
39
+ @Validate(IsTemplatePlaceholders)
40
+ template!: string;
41
+
42
+ @Expose()
43
+ @IsEnum(ContentTypeEnum)
44
+ contentType!: ContentTypeEnum;
45
+
46
+ @Expose()
47
+ @IsOptional()
48
+ @IsString()
49
+ @Validate(IsTemplatePlaceholders)
50
+ subject?: string;
51
+ }
@@ -0,0 +1,47 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
3
+ import { DeliveryChannelEnum } from '../../messaging';
4
+
5
+ /**
6
+ * Query string de GET /templates. Todos los filtros son opcionales; si todos
7
+ * estan vacios, lista todo (scan paginado). `limit` default 20, max 100.
8
+ */
9
+ export class TemplateMessageListFiltersRequest {
10
+ @Expose()
11
+ @IsOptional()
12
+ @IsString()
13
+ messageType?: string;
14
+
15
+ @Expose()
16
+ @IsOptional()
17
+ @IsEnum(DeliveryChannelEnum)
18
+ channelType?: DeliveryChannelEnum;
19
+
20
+ @Expose()
21
+ @IsOptional()
22
+ @IsString()
23
+ language?: string;
24
+
25
+ @Expose()
26
+ @IsOptional()
27
+ @IsString()
28
+ country?: string;
29
+
30
+ @Expose()
31
+ @IsOptional()
32
+ @IsString()
33
+ typeOfDirectoryId?: string;
34
+
35
+ @Expose()
36
+ @IsOptional()
37
+ @Type(() => Number)
38
+ @IsInt()
39
+ @Min(1)
40
+ @Max(100)
41
+ limit?: number;
42
+
43
+ @Expose()
44
+ @IsOptional()
45
+ @IsString()
46
+ cursor?: string;
47
+ }
@@ -0,0 +1,16 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { TemplateMessageResponse } from './TemplateMessageResponse';
3
+
4
+ /**
5
+ * Forma del response de GET /templates (list con filtros + paginacion cursor).
6
+ * `cursor` es opaco (base64 del LastEvaluatedKey de DDB) y el cliente lo pasa
7
+ * tal cual al siguiente GET. Si no hay mas paginas, se omite.
8
+ */
9
+ export class TemplateMessageListResponse {
10
+ @Expose()
11
+ @Type(() => TemplateMessageResponse)
12
+ items!: TemplateMessageResponse[];
13
+
14
+ @Expose()
15
+ cursor?: string;
16
+ }
@@ -0,0 +1,52 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { ContentTypeEnum, DeliveryChannelEnum } from '../../messaging';
3
+
4
+ /**
5
+ * Forma del template retornada por GET /templates/{id}, POST, PUT.
6
+ * El `id` es opaco (base64url de la PK compuesta) y el cliente lo trata como
7
+ * string sin parsear. El `pk` se incluye para auditoria/debug pero NO se usa
8
+ * como identificador del recurso en otras llamadas.
9
+ */
10
+ export class TemplateMessageResponse {
11
+ @Expose()
12
+ id!: string;
13
+
14
+ @Expose()
15
+ pk!: string;
16
+
17
+ @Expose()
18
+ messageType!: string;
19
+
20
+ @Expose()
21
+ channelType!: DeliveryChannelEnum;
22
+
23
+ @Expose()
24
+ language!: string;
25
+
26
+ @Expose()
27
+ country!: string;
28
+
29
+ @Expose()
30
+ typeOfDirectoryId!: string;
31
+
32
+ @Expose()
33
+ template!: string;
34
+
35
+ @Expose()
36
+ contentType!: ContentTypeEnum;
37
+
38
+ @Expose()
39
+ subject?: string;
40
+
41
+ @Expose()
42
+ createdAt!: number;
43
+
44
+ @Expose()
45
+ updatedAt!: number;
46
+
47
+ @Expose()
48
+ createdBy?: string;
49
+
50
+ @Expose()
51
+ updatedBy?: string;
52
+ }
@@ -0,0 +1,39 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEnum, IsNotEmpty, IsOptional, IsString, Validate } from 'class-validator';
3
+ import { ContentTypeEnum } from '../../messaging';
4
+ import { IsTemplatePlaceholders } from '../validators/IsTemplatePlaceholders';
5
+
6
+ /**
7
+ * Body para PUT /templates/{id} (backoffice). Solo campos no-key son mutables.
8
+ * Los componentes del PK (messageType, channelType, language, country) viven
9
+ * en el `{id}` opaco del path y NO se aceptan en el body (PK structurally
10
+ * immutable - ver spec seccion "Mutabilidad PK").
11
+ *
12
+ * La validacion cross-field (subject required ⇔ MAIL, HTML solo en MAIL) se
13
+ * hace en el manager con el channelType decodificado del path, no aca.
14
+ */
15
+ export class TemplateMessageUpdateRequest {
16
+ @Expose()
17
+ @IsOptional()
18
+ @IsString()
19
+ @IsNotEmpty()
20
+ typeOfDirectoryId?: string;
21
+
22
+ @Expose()
23
+ @IsOptional()
24
+ @IsString()
25
+ @IsNotEmpty()
26
+ @Validate(IsTemplatePlaceholders)
27
+ template?: string;
28
+
29
+ @Expose()
30
+ @IsOptional()
31
+ @IsEnum(ContentTypeEnum)
32
+ contentType?: ContentTypeEnum;
33
+
34
+ @Expose()
35
+ @IsOptional()
36
+ @IsString()
37
+ @Validate(IsTemplatePlaceholders)
38
+ subject?: string;
39
+ }
@@ -9,3 +9,9 @@ export * from './dtos/NotificationsPageResponse';
9
9
  export * from './dtos/NotificationsCursorResponse';
10
10
  export * from './dtos/NotificationsV3Response';
11
11
  export * from './dtos/MessagesByDestinationResponse';
12
+ export * from './validators/IsTemplatePlaceholders';
13
+ export * from './dtos/TemplateMessageCreateRequest';
14
+ export * from './dtos/TemplateMessageUpdateRequest';
15
+ export * from './dtos/TemplateMessageResponse';
16
+ export * from './dtos/TemplateMessageListResponse';
17
+ export * from './dtos/TemplateMessageListFiltersRequest';
@@ -0,0 +1,45 @@
1
+ import { ValidatorConstraint, ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
2
+
3
+ const VALID_PLACEHOLDER = /^[a-zA-Z][a-zA-Z0-9_]*$/;
4
+
5
+ /**
6
+ * Valida que un string solo contenga placeholders bien formados `{varName}` donde
7
+ * `varName` matchea `^[a-zA-Z][a-zA-Z0-9_]*$`. Rechaza:
8
+ * - Placeholders con espacios o caracteres invalidos (`{var name}`, `{var-1}`).
9
+ * - Llaves sin balancear (`abc {def`, `abc } def`, `{ {nested}` ).
10
+ * - Placeholders vacios (`{}`).
11
+ * Acepta texto sin placeholders en absoluto.
12
+ *
13
+ * Uso en DTOs: `@Validate(IsTemplatePlaceholders)` sobre un campo string.
14
+ */
15
+ @ValidatorConstraint({ name: 'IsTemplatePlaceholders', async: false })
16
+ export class IsTemplatePlaceholders implements ValidatorConstraintInterface {
17
+ validate(value: unknown): boolean {
18
+ if (typeof value !== 'string') return false;
19
+
20
+ // Detectar llaves desbalanceadas con un single-pass.
21
+ let depth = 0;
22
+ for (const ch of value) {
23
+ if (ch === '{') {
24
+ if (depth > 0) return false; // anidado no permitido
25
+ depth = 1;
26
+ } else if (ch === '}') {
27
+ if (depth === 0) return false; // cierre sin apertura
28
+ depth = 0;
29
+ }
30
+ }
31
+ if (depth !== 0) return false; // apertura sin cierre
32
+
33
+ // Validar que cada `{...}` matchea el regex.
34
+ const matches = value.match(/\{([^}]*)\}/g) ?? [];
35
+ for (const raw of matches) {
36
+ const inner = raw.slice(1, -1);
37
+ if (!VALID_PLACEHOLDER.test(inner)) return false;
38
+ }
39
+ return true;
40
+ }
41
+
42
+ defaultMessage(args: ValidationArguments): string {
43
+ return `${args.property} contiene placeholders mal formados; debe seguir el patron {nombre} con nombre = [a-zA-Z][a-zA-Z0-9_]*`;
44
+ }
45
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Campo adicional requerido por un payer/receptionMethod, devuelto por el
3
+ * endpoint público `GET /remittance/payers/{code}/fields?...`.
4
+ *
5
+ * El frontend renderiza un control según `fieldType` y valida con `regex` /
6
+ * `minLen`/`maxLen` antes de submit. El valor capturado se envía al backend
7
+ * como `additionalFieldInfo: [{ name, value }, ...]` en la request de
8
+ * AddBeneficiary o SendMoneyPreview.
9
+ *
10
+ * Ejemplo real (Banco Industrial GTQ Account Credit): 1 field `accountType`
11
+ * dropdown con opciones { key:"01", value:"Checking" }, { key:"02", value:"Savings" }.
12
+ */
13
+ export interface RemittancePayerAdditionalFieldDto {
14
+ fieldName: string;
15
+ fieldLabel: string;
16
+ /** "dropdown" | "text" | "number" | etc. — UI elige control según este valor. */
17
+ fieldType: string;
18
+ required: boolean;
19
+ /** Solo si `fieldType === "dropdown"`. */
20
+ fieldOptions?: Array<{ key: string; value: string }>;
21
+ regex?: string;
22
+ minLen?: number;
23
+ maxLen?: number;
24
+ errorMsg?: string;
25
+ /** Mensaje informativo (no de error) que la UI puede mostrar como helper text. */
26
+ fieldMsg?: string;
27
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Sucursal de un payer (para método Cash Pickup), devuelta por el endpoint
3
+ * público `GET /remittance/payers/{code}/branches?...`.
4
+ *
5
+ * El frontend la consume en el flow de "Enviar dinero" cuando el beneficiario
6
+ * tiene `receptionMethod === "CASH_PICKUP"` y el payer marca `requiresBranch = true`.
7
+ *
8
+ * Nota de tamaño: un payer puede tener cientos de sucursales (ej. Gyt Continental
9
+ * GT ~300). Diseñar el UI con un buscador local sobre `name`/`address.city`.
10
+ */
11
+ export interface RemittancePayerBranchDto {
12
+ branchCode: string;
13
+ name: string;
14
+ /** Horario de atención en formato libre (ej. "0900AM-0500PM"). */
15
+ branchHours?: string;
16
+ phoneNumber?: string;
17
+ address?: RemittancePayerBranchAddressDto;
18
+ }
19
+
20
+ export interface RemittancePayerBranchAddressDto {
21
+ address1?: string;
22
+ city?: string;
23
+ /** Código ISO 3166-2 (ej. "GT-GU"). */
24
+ state?: string;
25
+ stateName?: string;
26
+ country?: string;
27
+ countryISOCode?: string;
28
+ zipCode?: string;
29
+ }
@@ -0,0 +1,35 @@
1
+ import { ReceptionMethod } from "../enums/ReceptionMethod";
2
+
3
+ /**
4
+ * Payer disponible para un país+currency, devuelto por el endpoint público
5
+ * `GET /remittance/countries/{iso}/payers?currencyISO=XXX`.
6
+ *
7
+ * Lo consume el frontend en Pantalla 9 (Método + Payer) del wizard de agregar
8
+ * beneficiario. Provee toda la metadata necesaria para que la app:
9
+ * 1. Muestre los métodos de recepción soportados por el payer.
10
+ * 2. Decida si el wizard debe mostrar el paso de "selección de sucursal"
11
+ * (`requiresBranch === true`) o el de "campos adicionales"
12
+ * (`requiresAdditionalFields === true`).
13
+ * 3. Valide el `accNumber` del lado del cliente con `accNumberRegex` antes
14
+ * de hacer submit (mejor UX que esperar 400 del backend).
15
+ */
16
+ export interface RemittancePayerDto {
17
+ /** Código UNIR del payer (ej. "GCA10" Banrural). Usado como `payerCode` en AddBeneficiary. */
18
+ payerCode: string;
19
+ /** Nombre legible (ej. "Banrural", "B. Industrial"). */
20
+ name: string;
21
+ /** Métodos de recepción soportados por este payer en este país+currency. */
22
+ receptionMethods: ReceptionMethod[];
23
+ /** Si true, hay que llamar a `/remittance/payers/{code}/branches` cuando el usuario elige Cash Pickup. */
24
+ requiresBranch: boolean;
25
+ /** Si true, hay que llamar a `/remittance/payers/{code}/fields` para conocer campos extra requeridos. */
26
+ requiresAdditionalFields: boolean;
27
+ /** Regex de validación del `accNumber` (solo si `receptionMethod` = ACCOUNT_CREDIT). */
28
+ accNumberRegex?: string;
29
+ /** Mensaje legible para mostrar al usuario cuando el `accNumber` no pasa el regex. */
30
+ accNumberHelperText?: string;
31
+ /** URL absoluta del logo del payer (puede no venir). */
32
+ logoUrl?: string;
33
+ /** Orden de aparición sugerido por UNIR (asc). */
34
+ sortOrder?: number;
35
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Estado / departamento del país destino de una remesa.
3
+ * Devuelto por el endpoint público `GET /remittance/countries/{iso}/states`.
4
+ *
5
+ * `stateISO` viene en formato ISO 3166-2 (ej. "GT-GU" Guatemala, "SV-SS" San Salvador,
6
+ * "HN-AT" Atlántida, "NI-MN" Managua).
7
+ */
8
+ export interface RemittanceStateDto {
9
+ stateISO: string;
10
+ name: string;
11
+ }
@@ -13,3 +13,7 @@ export * from "./RemittanceSendPreviewResponse";
13
13
  export * from "./RemittanceTransaction";
14
14
  export * from "./RemittanceLimitsInfo";
15
15
  export * from "./RemittanceHomeResponse";
16
+ export * from "./RemittanceStateDto";
17
+ export * from "./RemittancePayerDto";
18
+ export * from "./RemittancePayerBranchDto";
19
+ export * from "./RemittancePayerAdditionalFieldDto";