@fiado/type-kit 3.521.0 → 3.522.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 (82) hide show
  1. package/_test_/unit/loanCredit/regulatoryNoticeDtos.test.ts +39 -0
  2. package/_test_/unit/mdm/dtos/mdmDeviceContract.test.ts +2 -1
  3. package/_test_/unit/messageMoments/MessageMomentCatalog.test.ts +111 -0
  4. package/_test_/unit/messagesConnector/SendMessageRequest.test.ts +33 -0
  5. package/_test_/unit/messagesConnector/TemplateMessageAuthor.test.ts +41 -0
  6. package/_test_/unit/notificationMessages/MomentTemplateContracts.test.ts +59 -0
  7. package/_test_/unit/notificationMessages/NotificationQueueMessageRequest.test.ts +21 -0
  8. package/_test_/unit/retailWizard/storeMixCategory.test.ts +22 -0
  9. package/bin/index.d.ts +1 -0
  10. package/bin/index.js +4 -3
  11. package/bin/loanCredit/constants/RegulatoryCampaign.d.ts +5 -0
  12. package/bin/loanCredit/constants/RegulatoryCampaign.js +11 -0
  13. package/bin/loanCredit/dtos/requests/BackofficeSendRegulatoryNoticeRequest.d.ts +9 -0
  14. package/bin/loanCredit/dtos/requests/BackofficeSendRegulatoryNoticeRequest.js +38 -0
  15. package/bin/loanCredit/dtos/responses/RegulatoryNoticeCampaignPage.d.ts +13 -0
  16. package/bin/loanCredit/dtos/responses/RegulatoryNoticeCampaignPage.js +2 -0
  17. package/bin/loanCredit/index.d.ts +3 -0
  18. package/bin/loanCredit/index.js +3 -0
  19. package/bin/mdm/enums/MdmNoticeTypeEnum.d.ts +2 -0
  20. package/bin/mdm/enums/MdmNoticeTypeEnum.js +2 -0
  21. package/bin/messageMoments/constants/MessageMomentCatalog.d.ts +18 -0
  22. package/bin/messageMoments/constants/MessageMomentCatalog.js +69 -0
  23. package/bin/messageMoments/constants/MessageMomentVariables.d.ts +11 -0
  24. package/bin/messageMoments/constants/MessageMomentVariables.js +40 -0
  25. package/bin/messageMoments/constants/TemplatePlaceholder.d.ts +3 -0
  26. package/bin/messageMoments/constants/TemplatePlaceholder.js +6 -0
  27. package/bin/messageMoments/enums/MessageMomentBlockEnum.d.ts +11 -0
  28. package/bin/messageMoments/enums/MessageMomentBlockEnum.js +15 -0
  29. package/bin/messageMoments/enums/MessageMomentEnum.d.ts +42 -0
  30. package/bin/messageMoments/enums/MessageMomentEnum.js +46 -0
  31. package/bin/messageMoments/index.d.ts +5 -0
  32. package/bin/messageMoments/index.js +21 -0
  33. package/bin/messagesConnector/dtos/SendMessageRequest.d.ts +1 -0
  34. package/bin/messagesConnector/dtos/SendMessageRequest.js +7 -0
  35. package/bin/messagesConnector/dtos/TemplateMessageCreateRequest.d.ts +2 -0
  36. package/bin/messagesConnector/dtos/TemplateMessageCreateRequest.js +6 -0
  37. package/bin/messagesConnector/dtos/TemplateMessageUpdateRequest.d.ts +2 -0
  38. package/bin/messagesConnector/dtos/TemplateMessageUpdateRequest.js +6 -0
  39. package/bin/notificationMessages/constants/MomentTemplateLimits.d.ts +4 -0
  40. package/bin/notificationMessages/constants/MomentTemplateLimits.js +7 -0
  41. package/bin/notificationMessages/dtos/MomentTemplateListResponse.d.ts +5 -0
  42. package/bin/notificationMessages/dtos/MomentTemplateListResponse.js +23 -0
  43. package/bin/notificationMessages/dtos/MomentTemplateResponse.d.ts +15 -0
  44. package/bin/notificationMessages/dtos/MomentTemplateResponse.js +54 -0
  45. package/bin/notificationMessages/dtos/MomentTemplateUpsertRequest.d.ts +6 -0
  46. package/bin/notificationMessages/dtos/MomentTemplateUpsertRequest.js +39 -0
  47. package/bin/notificationMessages/dtos/NotificationQueueMessageRequest.d.ts +2 -0
  48. package/bin/notificationMessages/enums/NotificationTemplateOriginEnum.d.ts +4 -0
  49. package/bin/notificationMessages/enums/NotificationTemplateOriginEnum.js +8 -0
  50. package/bin/notificationMessages/index.d.ts +5 -0
  51. package/bin/notificationMessages/index.js +5 -0
  52. package/bin/retailWizard/dtos/responses/BackofficeStoreDetailResponse.d.ts +3 -1
  53. package/bin/retailWizard/enums/StoreMixCategoryEnum.d.ts +9 -0
  54. package/bin/retailWizard/enums/StoreMixCategoryEnum.js +13 -0
  55. package/bin/retailWizard/index.d.ts +1 -0
  56. package/bin/retailWizard/index.js +1 -0
  57. package/package.json +1 -1
  58. package/src/index.ts +1 -0
  59. package/src/loanCredit/constants/RegulatoryCampaign.ts +10 -0
  60. package/src/loanCredit/dtos/requests/BackofficeSendRegulatoryNoticeRequest.ts +24 -0
  61. package/src/loanCredit/dtos/responses/RegulatoryNoticeCampaignPage.ts +13 -0
  62. package/src/loanCredit/index.ts +3 -0
  63. package/src/mdm/enums/MdmNoticeTypeEnum.ts +2 -0
  64. package/src/messageMoments/constants/MessageMomentCatalog.ts +91 -0
  65. package/src/messageMoments/constants/MessageMomentVariables.ts +42 -0
  66. package/src/messageMoments/constants/TemplatePlaceholder.ts +3 -0
  67. package/src/messageMoments/enums/MessageMomentBlockEnum.ts +11 -0
  68. package/src/messageMoments/enums/MessageMomentEnum.ts +50 -0
  69. package/src/messageMoments/index.ts +5 -0
  70. package/src/messagesConnector/dtos/SendMessageRequest.ts +2 -0
  71. package/src/messagesConnector/dtos/TemplateMessageCreateRequest.ts +6 -0
  72. package/src/messagesConnector/dtos/TemplateMessageUpdateRequest.ts +6 -0
  73. package/src/notificationMessages/constants/MomentTemplateLimits.ts +5 -0
  74. package/src/notificationMessages/dtos/MomentTemplateListResponse.ts +9 -0
  75. package/src/notificationMessages/dtos/MomentTemplateResponse.ts +34 -0
  76. package/src/notificationMessages/dtos/MomentTemplateUpsertRequest.ts +24 -0
  77. package/src/notificationMessages/dtos/NotificationQueueMessageRequest.ts +3 -1
  78. package/src/notificationMessages/enums/NotificationTemplateOriginEnum.ts +4 -0
  79. package/src/notificationMessages/index.ts +6 -2
  80. package/src/retailWizard/dtos/responses/BackofficeStoreDetailResponse.ts +3 -1
  81. package/src/retailWizard/enums/StoreMixCategoryEnum.ts +9 -0
  82. package/src/retailWizard/index.ts +1 -0
@@ -0,0 +1,91 @@
1
+ import { MessageMomentEnum } from '../enums/MessageMomentEnum';
2
+ import { MessageMomentBlockEnum } from '../enums/MessageMomentBlockEnum';
3
+ import {
4
+ CREDIT_MOMENT_ALWAYS_VARIABLES,
5
+ CREDIT_MOMENT_CONDITIONAL_VARIABLES,
6
+ MOMENT_SPECIFIC_VARIABLES,
7
+ OTP_MOMENT_VARIABLES,
8
+ } from './MessageMomentVariables';
9
+
10
+ /** Quién es un momento: su id de ficha, su plantilla, su bloque y las variables que emite. */
11
+ export interface MessageMomentIdentity {
12
+ /** Id del momento (`PM-001`); en minúsculas es el prefijo de sus keys en la ficha. */
13
+ templateId: string;
14
+ messageType: MessageMomentEnum;
15
+ /** Bloque del árbol. La ficha lo puede pisar; este es el respaldo cuando su key falta. */
16
+ blockId: MessageMomentBlockEnum;
17
+ alwaysVariables: readonly string[];
18
+ conditionalVariables: readonly string[];
19
+ }
20
+
21
+ /** Un momento del crédito: las variables del crédito más las que solo emite él. */
22
+ function creditMoment(templateId: string, messageType: MessageMomentEnum, blockId: MessageMomentBlockEnum): MessageMomentIdentity {
23
+ return {
24
+ templateId,
25
+ messageType,
26
+ blockId,
27
+ alwaysVariables: [...CREDIT_MOMENT_ALWAYS_VARIABLES, ...(MOMENT_SPECIFIC_VARIABLES[messageType] ?? [])],
28
+ conditionalVariables: CREDIT_MOMENT_CONDITIONAL_VARIABLES,
29
+ };
30
+ }
31
+
32
+ const B = MessageMomentBlockEnum;
33
+ const M = MessageMomentEnum;
34
+
35
+ /** Los 38 momentos EN ORDEN de recorrido del crédito. `PM-071` apunta al OTP de plataforma. */
36
+ export const MESSAGE_MOMENT_CATALOG: readonly MessageMomentIdentity[] = [
37
+ creditMoment('PM-001', M.APPLICATION_APPROVED, B.ORIGINATION),
38
+ creditMoment('PM-002', M.APPLICATION_REJECTED, B.ORIGINATION),
39
+ creditMoment('PM-003', M.DOWN_PAYMENT_RECEIVED, B.ORIGINATION),
40
+ creditMoment('PM-004', M.CONTRACT_SIGNED, B.ORIGINATION),
41
+ creditMoment('PM-005', M.MDM_ACTIVATED, B.ORIGINATION),
42
+ creditMoment('PM-010', M.REMINDER_T_MINUS_3, B.REMINDERS),
43
+ creditMoment('PM-011', M.REMINDER_T_MINUS_2, B.REMINDERS),
44
+ creditMoment('PM-012', M.REMINDER_T_MINUS_1, B.REMINDERS),
45
+ creditMoment('PM-020', M.PAYMENT_APPLIED, B.PAYMENTS),
46
+ creditMoment('PM-021', M.PAYMENT_PARTIAL, B.PAYMENTS),
47
+ creditMoment('PM-022', M.PAYMENT_REJECTED, B.PAYMENTS),
48
+ creditMoment('PM-023', M.PAYMENT_EARLY, B.PAYMENTS),
49
+ creditMoment('PM-030', M.COLLECTION_T_PLUS_1, B.COLLECTIONS),
50
+ creditMoment('PM-031', M.COLLECTION_T_PLUS_3, B.COLLECTIONS),
51
+ creditMoment('PM-032', M.COLLECTION_T_PLUS_5, B.COLLECTIONS),
52
+ creditMoment('PM-033', M.COLLECTION_T_PLUS_15, B.COLLECTIONS),
53
+ creditMoment('PM-034', M.COLLECTION_T_PLUS_60_BUREAU, B.COLLECTIONS),
54
+ creditMoment('PM-040', M.MDM_LOCK_APPLIED, B.DEVICE_LOCK),
55
+ creditMoment('PM-041', M.MDM_UNLOCKED, B.DEVICE_LOCK),
56
+ creditMoment('PM-050', M.F1_RESTRUCTURE_PROPOSED, B.EXCEPTIONS),
57
+ creditMoment('PM-051', M.F1_RESTRUCTURE_APPROVED, B.EXCEPTIONS),
58
+ creditMoment('PM-052', M.F2_CANCELLATION_PROCESSED, B.EXCEPTIONS),
59
+ creditMoment('PM-053', M.F3_DISCOUNT_APPLIED, B.EXCEPTIONS),
60
+ creditMoment('PM-054', M.F4_CORRECTION_APPLIED, B.EXCEPTIONS),
61
+ creditMoment('PM-055', M.F5_FRAUD_CONFIRMED, B.EXCEPTIONS),
62
+ creditMoment('PM-056', M.PAYMENT_PROMISE_REGISTERED, B.EXCEPTIONS),
63
+ creditMoment('PM-057', M.PAYMENT_PROMISE_BROKEN, B.EXCEPTIONS),
64
+ creditMoment('PM-060', M.LAST_INSTALLMENT, B.CLOSURE),
65
+ creditMoment('PM-061', M.SETTLEMENT_COMPLETED, B.CLOSURE),
66
+ creditMoment('PM-062', M.SETTLEMENT_BUREAU_NOTICE, B.CLOSURE),
67
+ creditMoment('PM-063', M.REENTRY_INVITATION, B.CLOSURE),
68
+ creditMoment('PM-070', M.APP_WELCOME, B.SERVICE),
69
+ {
70
+ templateId: 'PM-071',
71
+ messageType: M.OTP_CODE,
72
+ blockId: B.SERVICE,
73
+ alwaysVariables: OTP_MOMENT_VARIABLES,
74
+ conditionalVariables: [],
75
+ },
76
+ creditMoment('PM-072', M.SECURITY_ALERT, B.SERVICE),
77
+ creditMoment('PM-073', M.PROFILE_CHANGE_CONFIRMED, B.SERVICE),
78
+ creditMoment('PM-074', M.MONTHLY_STATEMENT, B.SERVICE),
79
+ creditMoment('PM-075', M.CAT_TERMS_NOTICE, B.SERVICE),
80
+ creditMoment('PM-076', M.PRIVACY_ARCO_NOTICE, B.SERVICE),
81
+ ];
82
+
83
+ /** La identidad por id de ficha (`PM-030`). */
84
+ export const momentByTemplateId: ReadonlyMap<string, MessageMomentIdentity> = new Map(
85
+ MESSAGE_MOMENT_CATALOG.map((moment) => [moment.templateId, moment]),
86
+ );
87
+
88
+ /** La identidad por messageType de la plantilla. */
89
+ export const momentByMessageType: ReadonlyMap<string, MessageMomentIdentity> = new Map(
90
+ MESSAGE_MOMENT_CATALOG.map((moment) => [moment.messageType, moment]),
91
+ );
@@ -0,0 +1,42 @@
1
+ import { MessageMomentEnum } from '../enums/MessageMomentEnum';
2
+
3
+ /** Variables del crédito que el emisor manda siempre con valor. */
4
+ export const CREDIT_MOMENT_ALWAYS_VARIABLES: readonly string[] = [
5
+ 'cliente_nombre',
6
+ 'credito_id',
7
+ 'monto_credito',
8
+ 'monto_enganche',
9
+ 'cuota_total',
10
+ 'saldo_actual',
11
+ ];
12
+
13
+ /** Variables que dependen del dato: viajan siempre, con `""` cuando no aplican. */
14
+ export const CREDIT_MOMENT_CONDITIONAL_VARIABLES: readonly string[] = [
15
+ 'tienda',
16
+ 'equipo',
17
+ 'cat',
18
+ 'fecha_primer_venc',
19
+ 'fecha_liquidacion',
20
+ 'dias_atraso',
21
+ 'cuota_n',
22
+ 'monto',
23
+ 'saldo_pendiente',
24
+ 'fecha_venc',
25
+ 'proxima_venc',
26
+ 'folio',
27
+ 'forma_pago',
28
+ ];
29
+
30
+ /** El OTP lo arma messages-business: llena `code` y su alias posicional `var1`. */
31
+ export const OTP_MOMENT_VARIABLES: readonly string[] = ['code', 'var1'];
32
+
33
+ /** Lo que el plan nuevo de una reestructura le dice al cliente. */
34
+ export const RESTRUCTURE_MOMENT_VARIABLES: readonly string[] = ['plazo_nuevo', 'cuota_nueva', 'saldo_nuevo'];
35
+
36
+ /** Variables que solo emite su momento, siempre con valor. */
37
+ export const MOMENT_SPECIFIC_VARIABLES: Readonly<Partial<Record<MessageMomentEnum, readonly string[]>>> = {
38
+ [MessageMomentEnum.F1_RESTRUCTURE_PROPOSED]: RESTRUCTURE_MOMENT_VARIABLES,
39
+ [MessageMomentEnum.F1_RESTRUCTURE_APPROVED]: RESTRUCTURE_MOMENT_VARIABLES,
40
+ [MessageMomentEnum.PROFILE_CHANGE_CONFIRMED]: ['campo_cambiado'],
41
+ [MessageMomentEnum.MONTHLY_STATEMENT]: ['fecha_corte'],
42
+ };
@@ -0,0 +1,3 @@
1
+ /** Un placeholder doble `{{monto}}` o simple `{monto}`, igual que `applyVariables` de messages-business. La doble va primero.
2
+ * Es global y compartido: úsalo solo con `matchAll`/`replace`; para `.test()` o `.exec()` crea `new RegExp(TEMPLATE_PLACEHOLDER_PATTERN.source)`. */
3
+ export const TEMPLATE_PLACEHOLDER_PATTERN = /\{\{(\w+)\}\}|\{(\w+)\}/g;
@@ -0,0 +1,11 @@
1
+ /** Bloques del árbol de la pantalla; el mismo vocabulario que la key `pm-xxx.block` de la ficha. */
2
+ export enum MessageMomentBlockEnum {
3
+ ORIGINATION = 'origination',
4
+ REMINDERS = 'reminders',
5
+ PAYMENTS = 'payments',
6
+ COLLECTIONS = 'collections',
7
+ DEVICE_LOCK = 'deviceLock',
8
+ EXCEPTIONS = 'exceptions',
9
+ CLOSURE = 'closure',
10
+ SERVICE = 'service',
11
+ }
@@ -0,0 +1,50 @@
1
+ /** Los momentos de mensaje que el emisor sabe entregar. Es el messageType de la plantilla. */
2
+ export enum MessageMomentEnum {
3
+ OTP_CODE = 'OTP_CODE',
4
+ ISSUED_CARD_SMS = 'ISSUED_CARD_SMS',
5
+
6
+ APPLICATION_APPROVED = 'APPLICATION_APPROVED',
7
+ APPLICATION_REJECTED = 'APPLICATION_REJECTED',
8
+ DOWN_PAYMENT_RECEIVED = 'DOWN_PAYMENT_RECEIVED',
9
+ CONTRACT_SIGNED = 'CONTRACT_SIGNED',
10
+ MDM_ACTIVATED = 'MDM_ACTIVATED',
11
+
12
+ REMINDER_T_MINUS_3 = 'REMINDER_T_MINUS_3',
13
+ REMINDER_T_MINUS_2 = 'REMINDER_T_MINUS_2',
14
+ REMINDER_T_MINUS_1 = 'REMINDER_T_MINUS_1',
15
+
16
+ PAYMENT_APPLIED = 'PAYMENT_APPLIED',
17
+ PAYMENT_PARTIAL = 'PAYMENT_PARTIAL',
18
+ PAYMENT_REJECTED = 'PAYMENT_REJECTED',
19
+ PAYMENT_EARLY = 'PAYMENT_EARLY',
20
+
21
+ COLLECTION_T_PLUS_1 = 'COLLECTION_T_PLUS_1',
22
+ COLLECTION_T_PLUS_3 = 'COLLECTION_T_PLUS_3',
23
+ COLLECTION_T_PLUS_5 = 'COLLECTION_T_PLUS_5',
24
+ COLLECTION_T_PLUS_15 = 'COLLECTION_T_PLUS_15',
25
+ COLLECTION_T_PLUS_60_BUREAU = 'COLLECTION_T_PLUS_60_BUREAU',
26
+
27
+ MDM_LOCK_APPLIED = 'MDM_LOCK_APPLIED',
28
+ MDM_UNLOCKED = 'MDM_UNLOCKED',
29
+
30
+ F1_RESTRUCTURE_PROPOSED = 'F1_RESTRUCTURE_PROPOSED',
31
+ F1_RESTRUCTURE_APPROVED = 'F1_RESTRUCTURE_APPROVED',
32
+ F2_CANCELLATION_PROCESSED = 'F2_CANCELLATION_PROCESSED',
33
+ F3_DISCOUNT_APPLIED = 'F3_DISCOUNT_APPLIED',
34
+ F4_CORRECTION_APPLIED = 'F4_CORRECTION_APPLIED',
35
+ F5_FRAUD_CONFIRMED = 'F5_FRAUD_CONFIRMED',
36
+ PAYMENT_PROMISE_REGISTERED = 'PAYMENT_PROMISE_REGISTERED',
37
+ PAYMENT_PROMISE_BROKEN = 'PAYMENT_PROMISE_BROKEN',
38
+
39
+ LAST_INSTALLMENT = 'LAST_INSTALLMENT',
40
+ SETTLEMENT_COMPLETED = 'SETTLEMENT_COMPLETED',
41
+ SETTLEMENT_BUREAU_NOTICE = 'SETTLEMENT_BUREAU_NOTICE',
42
+ REENTRY_INVITATION = 'REENTRY_INVITATION',
43
+
44
+ APP_WELCOME = 'APP_WELCOME',
45
+ SECURITY_ALERT = 'SECURITY_ALERT',
46
+ PROFILE_CHANGE_CONFIRMED = 'PROFILE_CHANGE_CONFIRMED',
47
+ MONTHLY_STATEMENT = 'MONTHLY_STATEMENT',
48
+ CAT_TERMS_NOTICE = 'CAT_TERMS_NOTICE',
49
+ PRIVACY_ARCO_NOTICE = 'PRIVACY_ARCO_NOTICE',
50
+ }
@@ -0,0 +1,5 @@
1
+ export * from './enums/MessageMomentEnum';
2
+ export * from './enums/MessageMomentBlockEnum';
3
+ export * from './constants/MessageMomentVariables';
4
+ export * from './constants/MessageMomentCatalog';
5
+ export * from './constants/TemplatePlaceholder';
@@ -29,4 +29,6 @@ export class SendMessageRequest {
29
29
  @Expose() @IsOptional() @IsUUID() referenceMessageId?: string;
30
30
  @Expose() @IsOptional() @IsString() transactionNumber?: string;
31
31
  @Expose() @IsOptional() @IsEnum(OtpMessagePurposeEnum) purpose?: OtpMessagePurposeEnum;
32
+ // Tenant emisor: decide plantilla e identidad de envío. Sin él messages-business cae a FIADO.
33
+ @Expose() @IsOptional() @IsString() @IsNotEmpty() tenantId?: string;
32
34
  }
@@ -68,4 +68,10 @@ export class TemplateMessageCreateRequest {
68
68
  @IsArray()
69
69
  @IsString({ each: true })
70
70
  slotVariables?: string[];
71
+
72
+ /** Quién hizo el cambio. Lo pone el proxy de loan-config con el operador autenticado. */
73
+ @Expose()
74
+ @IsOptional()
75
+ @IsString()
76
+ updatedBy?: string;
71
77
  }
@@ -49,4 +49,10 @@ export class TemplateMessageUpdateRequest {
49
49
  @IsArray()
50
50
  @IsString({ each: true })
51
51
  slotVariables?: string[];
52
+
53
+ /** Quién hizo el cambio. Lo pone el proxy de loan-config con el operador autenticado. */
54
+ @Expose()
55
+ @IsOptional()
56
+ @IsString()
57
+ updatedBy?: string;
52
58
  }
@@ -0,0 +1,5 @@
1
+ /** Tope de momentos por lectura en lote: el de BatchGetItem de DynamoDB. */
2
+ export const MOMENT_TEMPLATE_LIST_MAX = 100;
3
+
4
+ /** Forma de un messageType de momento: mayúsculas, dígitos y guion bajo. */
5
+ export const MOMENT_MESSAGE_TYPE_PATTERN = /^[A-Z0-9_]+$/;
@@ -0,0 +1,9 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { MomentTemplateResponse } from './MomentTemplateResponse';
3
+
4
+ /** Respuesta del listado en lote: solo vienen las plantillas que existen. */
5
+ export class MomentTemplateListResponse {
6
+ @Expose()
7
+ @Type(() => MomentTemplateResponse)
8
+ items!: MomentTemplateResponse[];
9
+ }
@@ -0,0 +1,34 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { NotificationTemplateOriginEnum } from '../enums/NotificationTemplateOriginEnum';
3
+
4
+ /** Una plantilla push de momento tal como la devuelve notification-messages-business. */
5
+ export class MomentTemplateResponse {
6
+ @Expose()
7
+ messageType!: string;
8
+
9
+ /** Id de la fila: `ES_<messageType>`. */
10
+ @Expose()
11
+ templateId!: string;
12
+
13
+ @Expose()
14
+ title!: string;
15
+
16
+ @Expose()
17
+ body!: string;
18
+
19
+ @Expose()
20
+ templateVariables!: string[];
21
+
22
+ /** Ausente cuando la fila existe pero es del wallet. */
23
+ @Expose()
24
+ origin?: NotificationTemplateOriginEnum;
25
+
26
+ @Expose()
27
+ updatedAt?: number;
28
+
29
+ @Expose()
30
+ createdBy?: string;
31
+
32
+ @Expose()
33
+ updatedBy?: string;
34
+ }
@@ -0,0 +1,24 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString, Matches } from 'class-validator';
3
+
4
+ const NOT_BLANK = /\S/;
5
+
6
+ /** Body de PUT /private/moment-templates/{messageType}: el texto de la push y quién lo escribió. */
7
+ export class MomentTemplateUpsertRequest {
8
+ @Expose()
9
+ @IsString()
10
+ @IsNotEmpty()
11
+ @Matches(NOT_BLANK)
12
+ title!: string;
13
+
14
+ @Expose()
15
+ @IsString()
16
+ @IsNotEmpty()
17
+ @Matches(NOT_BLANK)
18
+ body!: string;
19
+
20
+ @Expose()
21
+ @IsString()
22
+ @IsNotEmpty()
23
+ updatedBy!: string;
24
+ }
@@ -5,4 +5,6 @@ export class NotificationQueueMessageRequest {
5
5
  broadcast?: boolean; // Si el mensaje es masivo o no (a todos los dispositivos registrados)
6
6
  destinations: QueueMessageDestination[]; // Grupo de destinos (directory y variables)
7
7
  data?: any; // Informacion adicional a enviar al destino
8
- }
8
+ /** Llave de idempotencia del productor; con ella el consumidor no repite la push por destino. */
9
+ eventId?: string;
10
+ }
@@ -0,0 +1,4 @@
1
+ /** Quién es dueño de una fila de NotificationTemplates_GT. Sin origen, la fila es del wallet. */
2
+ export enum NotificationTemplateOriginEnum {
3
+ MESSAGING_MOMENT = 'MESSAGING_MOMENT',
4
+ }
@@ -2,7 +2,11 @@ export * from './dtos/NotificationQueueMessageRequest';
2
2
  export * from './dtos/QueueMessageDestination';
3
3
  export * from './dtos/QueueMessageVariableValues';
4
4
  export * from './dtos/NotificationTemplate';
5
-
5
+ export * from './dtos/MomentTemplateUpsertRequest';
6
+ export * from './dtos/MomentTemplateResponse';
7
+ export * from './dtos/MomentTemplateListResponse';
8
+ export * from './constants/MomentTemplateLimits';
6
9
 
7
10
  export * from "./enums/NotificationId";
8
- export * from "./enums/NotificationType";
11
+ export * from "./enums/NotificationType";
12
+ export * from './enums/NotificationTemplateOriginEnum';
@@ -1,4 +1,5 @@
1
1
  import type { ProductCategoryEnum } from '../../../retailCatalog/enums/ProductCategoryEnum';
2
+ import type { StoreMixCategoryEnum } from '../../enums/StoreMixCategoryEnum';
2
3
 
3
4
  /** Colocación de una semana de 7 días; ISO, ambos extremos incluidos. */
4
5
  export interface StoreWeeklyPlacement {
@@ -10,7 +11,8 @@ export interface StoreWeeklyPlacement {
10
11
 
11
12
  /** Lo vendido de una categoría en la ventana. `category: null` = venta sin líneas de producto. */
12
13
  export interface StoreCategoryMixEntry {
13
- category: ProductCategoryEnum | null;
14
+ /** Acepta ProductCategoryEnum para no romper a quien ya lo asigna; SERVICE solo existe en StoreMixCategoryEnum. */
15
+ category: StoreMixCategoryEnum | ProductCategoryEnum | null;
14
16
  units: number;
15
17
  placedCents: number;
16
18
  }
@@ -0,0 +1,9 @@
1
+ /** Categoría del mix de una tienda: las de producto (mismos strings que ProductCategoryEnum) más SERVICE. */
2
+ export enum StoreMixCategoryEnum {
3
+ PHONE = 'PHONE',
4
+ SIM = 'SIM',
5
+ MODEM = 'MODEM',
6
+ ACCESSORY = 'ACCESSORY',
7
+ BUNDLE = 'BUNDLE',
8
+ SERVICE = 'SERVICE',
9
+ }
@@ -165,6 +165,7 @@ export * from './dtos/responses/BackofficeSellerTableResponse';
165
165
  export * from './dtos/responses/BackofficeCustomerTableResponse';
166
166
  export * from './enums/StoreKindEnum';
167
167
  export * from './dtos/responses/BackofficeStoreTableResponse';
168
+ export * from './enums/StoreMixCategoryEnum';
168
169
  export * from './dtos/responses/BackofficeStoreDetailResponse';
169
170
 
170
171
  // Contratos de eventos (PascalCase + sufijo V1)