@fiado/type-kit 3.520.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.
- package/_test_/unit/loanCredit/regulatoryNoticeDtos.test.ts +39 -0
- package/_test_/unit/mdm/dtos/mdmDeviceContract.test.ts +24 -1
- package/_test_/unit/messageMoments/MessageMomentCatalog.test.ts +111 -0
- package/_test_/unit/messagesConnector/SendMessageRequest.test.ts +33 -0
- package/_test_/unit/messagesConnector/TemplateMessageAuthor.test.ts +41 -0
- package/_test_/unit/notificationMessages/MomentTemplateContracts.test.ts +59 -0
- package/_test_/unit/notificationMessages/NotificationQueueMessageRequest.test.ts +21 -0
- package/_test_/unit/retailWizard/storeMixCategory.test.ts +22 -0
- package/_test_/unit/rewardsEligibility/metricsDtos.test.ts +8 -2
- package/bin/index.d.ts +1 -0
- package/bin/index.js +4 -3
- package/bin/loanCredit/constants/RegulatoryCampaign.d.ts +5 -0
- package/bin/loanCredit/constants/RegulatoryCampaign.js +11 -0
- package/bin/loanCredit/dtos/requests/BackofficeSendRegulatoryNoticeRequest.d.ts +9 -0
- package/bin/loanCredit/dtos/requests/BackofficeSendRegulatoryNoticeRequest.js +38 -0
- package/bin/loanCredit/dtos/responses/RegulatoryNoticeCampaignPage.d.ts +13 -0
- package/bin/loanCredit/dtos/responses/RegulatoryNoticeCampaignPage.js +2 -0
- package/bin/loanCredit/index.d.ts +3 -0
- package/bin/loanCredit/index.js +3 -0
- package/bin/mdm/dtos/DeviceEnrollRequest.d.ts +2 -0
- package/bin/mdm/dtos/DeviceEnrollRequest.js +6 -0
- package/bin/mdm/enums/MdmNoticeTypeEnum.d.ts +2 -0
- package/bin/mdm/enums/MdmNoticeTypeEnum.js +2 -0
- package/bin/messageMoments/constants/MessageMomentCatalog.d.ts +18 -0
- package/bin/messageMoments/constants/MessageMomentCatalog.js +69 -0
- package/bin/messageMoments/constants/MessageMomentVariables.d.ts +11 -0
- package/bin/messageMoments/constants/MessageMomentVariables.js +40 -0
- package/bin/messageMoments/constants/TemplatePlaceholder.d.ts +3 -0
- package/bin/messageMoments/constants/TemplatePlaceholder.js +6 -0
- package/bin/messageMoments/enums/MessageMomentBlockEnum.d.ts +11 -0
- package/bin/messageMoments/enums/MessageMomentBlockEnum.js +15 -0
- package/bin/messageMoments/enums/MessageMomentEnum.d.ts +42 -0
- package/bin/messageMoments/enums/MessageMomentEnum.js +46 -0
- package/bin/messageMoments/index.d.ts +5 -0
- package/bin/messageMoments/index.js +21 -0
- package/bin/messagesConnector/dtos/SendMessageRequest.d.ts +1 -0
- package/bin/messagesConnector/dtos/SendMessageRequest.js +7 -0
- package/bin/messagesConnector/dtos/TemplateMessageCreateRequest.d.ts +2 -0
- package/bin/messagesConnector/dtos/TemplateMessageCreateRequest.js +6 -0
- package/bin/messagesConnector/dtos/TemplateMessageUpdateRequest.d.ts +2 -0
- package/bin/messagesConnector/dtos/TemplateMessageUpdateRequest.js +6 -0
- package/bin/notificationMessages/constants/MomentTemplateLimits.d.ts +4 -0
- package/bin/notificationMessages/constants/MomentTemplateLimits.js +7 -0
- package/bin/notificationMessages/dtos/MomentTemplateListResponse.d.ts +5 -0
- package/bin/notificationMessages/dtos/MomentTemplateListResponse.js +23 -0
- package/bin/notificationMessages/dtos/MomentTemplateResponse.d.ts +15 -0
- package/bin/notificationMessages/dtos/MomentTemplateResponse.js +54 -0
- package/bin/notificationMessages/dtos/MomentTemplateUpsertRequest.d.ts +6 -0
- package/bin/notificationMessages/dtos/MomentTemplateUpsertRequest.js +39 -0
- package/bin/notificationMessages/dtos/NotificationQueueMessageRequest.d.ts +2 -0
- package/bin/notificationMessages/enums/NotificationTemplateOriginEnum.d.ts +4 -0
- package/bin/notificationMessages/enums/NotificationTemplateOriginEnum.js +8 -0
- package/bin/notificationMessages/index.d.ts +5 -0
- package/bin/notificationMessages/index.js +5 -0
- package/bin/retailWizard/dtos/responses/BackofficeStoreDetailResponse.d.ts +3 -1
- package/bin/retailWizard/enums/StoreMixCategoryEnum.d.ts +9 -0
- package/bin/retailWizard/enums/StoreMixCategoryEnum.js +13 -0
- package/bin/retailWizard/index.d.ts +1 -0
- package/bin/retailWizard/index.js +1 -0
- package/bin/rewardsEligibility/dtos/backoffice/FailedConditionEvaluationResponse.d.ts +6 -0
- package/bin/rewardsEligibility/dtos/backoffice/FailedConditionEvaluationResponse.js +7 -0
- package/bin/rewardsEligibility/dtos/backoffice/FailedConditionStatResponse.d.ts +3 -0
- package/bin/rewardsEligibility/index.d.ts +1 -0
- package/bin/rewardsEligibility/index.js +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/loanCredit/constants/RegulatoryCampaign.ts +10 -0
- package/src/loanCredit/dtos/requests/BackofficeSendRegulatoryNoticeRequest.ts +24 -0
- package/src/loanCredit/dtos/responses/RegulatoryNoticeCampaignPage.ts +13 -0
- package/src/loanCredit/index.ts +3 -0
- package/src/mdm/dtos/DeviceEnrollRequest.ts +7 -1
- package/src/mdm/enums/MdmNoticeTypeEnum.ts +2 -0
- package/src/messageMoments/constants/MessageMomentCatalog.ts +91 -0
- package/src/messageMoments/constants/MessageMomentVariables.ts +42 -0
- package/src/messageMoments/constants/TemplatePlaceholder.ts +3 -0
- package/src/messageMoments/enums/MessageMomentBlockEnum.ts +11 -0
- package/src/messageMoments/enums/MessageMomentEnum.ts +50 -0
- package/src/messageMoments/index.ts +5 -0
- package/src/messagesConnector/dtos/SendMessageRequest.ts +2 -0
- package/src/messagesConnector/dtos/TemplateMessageCreateRequest.ts +6 -0
- package/src/messagesConnector/dtos/TemplateMessageUpdateRequest.ts +6 -0
- package/src/notificationMessages/constants/MomentTemplateLimits.ts +5 -0
- package/src/notificationMessages/dtos/MomentTemplateListResponse.ts +9 -0
- package/src/notificationMessages/dtos/MomentTemplateResponse.ts +34 -0
- package/src/notificationMessages/dtos/MomentTemplateUpsertRequest.ts +24 -0
- package/src/notificationMessages/dtos/NotificationQueueMessageRequest.ts +3 -1
- package/src/notificationMessages/enums/NotificationTemplateOriginEnum.ts +4 -0
- package/src/notificationMessages/index.ts +6 -2
- package/src/retailWizard/dtos/responses/BackofficeStoreDetailResponse.ts +3 -1
- package/src/retailWizard/enums/StoreMixCategoryEnum.ts +9 -0
- package/src/retailWizard/index.ts +1 -0
- package/src/rewardsEligibility/dtos/backoffice/FailedConditionEvaluationResponse.ts +6 -0
- package/src/rewardsEligibility/dtos/backoffice/FailedConditionStatResponse.ts +4 -0
- package/src/rewardsEligibility/index.ts +1 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FailedConditionEvaluationResponse = void 0;
|
|
4
|
+
/** En qué evaluación falló una condición y cuántas veces (máximo 5 por condición, de mayor a menor). */
|
|
5
|
+
class FailedConditionEvaluationResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.FailedConditionEvaluationResponse = FailedConditionEvaluationResponse;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FailedConditionEvaluationResponse } from './FailedConditionEvaluationResponse';
|
|
1
2
|
/** Condición que más hace fallar la regla (`GET /metrics/failed-conditions`). */
|
|
2
3
|
export declare class FailedConditionStatResponse {
|
|
3
4
|
/** `{source}.{field}`. */
|
|
@@ -5,4 +6,6 @@ export declare class FailedConditionStatResponse {
|
|
|
5
6
|
/** Etiqueta legible (del catálogo de reglas; si no está, la propia `key`). */
|
|
6
7
|
label: string;
|
|
7
8
|
count: number;
|
|
9
|
+
/** Evaluaciones donde falla esta condición, ordenadas por `count` descendente (máx. 5). */
|
|
10
|
+
evaluations: FailedConditionEvaluationResponse[];
|
|
8
11
|
}
|
|
@@ -66,4 +66,5 @@ export * from './dtos/backoffice/RunResultListResponse';
|
|
|
66
66
|
export * from './dtos/backoffice/CreateRunResponse';
|
|
67
67
|
export * from './dtos/backoffice/MetricsPointResponse';
|
|
68
68
|
export * from './dtos/backoffice/FailedConditionStatResponse';
|
|
69
|
+
export * from './dtos/backoffice/FailedConditionEvaluationResponse';
|
|
69
70
|
export * from './dtos/backoffice/MetricsQuery';
|
|
@@ -88,4 +88,5 @@ __exportStar(require("./dtos/backoffice/RunResultListResponse"), exports);
|
|
|
88
88
|
__exportStar(require("./dtos/backoffice/CreateRunResponse"), exports);
|
|
89
89
|
__exportStar(require("./dtos/backoffice/MetricsPointResponse"), exports);
|
|
90
90
|
__exportStar(require("./dtos/backoffice/FailedConditionStatResponse"), exports);
|
|
91
|
+
__exportStar(require("./dtos/backoffice/FailedConditionEvaluationResponse"), exports);
|
|
91
92
|
__exportStar(require("./dtos/backoffice/MetricsQuery"), exports);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * as Identity from './provider';
|
|
|
22
22
|
export * as Header from './header';
|
|
23
23
|
export * as ServicePayment from './servicePayment';
|
|
24
24
|
export * as NotificationMessages from './notificationMessages';
|
|
25
|
+
export * as MessageMoments from './messageMoments';
|
|
25
26
|
export * as SessionActivity from './sessionActivity';
|
|
26
27
|
export * as EventBridgeMessage from './eventBridge';
|
|
27
28
|
export * as GenericMessage from './genericMessage';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MessageMomentEnum } from '../../messageMoments/enums/MessageMomentEnum';
|
|
2
|
+
|
|
3
|
+
/** Los avisos regulatorios que se mandan a toda la cartera viva desde el backoffice. */
|
|
4
|
+
export const REGULATORY_CAMPAIGN_MOMENTS: readonly MessageMomentEnum[] = [
|
|
5
|
+
MessageMomentEnum.CAT_TERMS_NOTICE,
|
|
6
|
+
MessageMomentEnum.PRIVACY_ARCO_NOTICE,
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
/** Llave de la campaña: corta y sin separadores, porque viaja dentro de la referencia del aviso. */
|
|
10
|
+
export const REGULATORY_CAMPAIGN_KEY_PATTERN = /^[A-Za-z0-9-]{1,12}$/;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsIn, IsNotEmpty, IsOptional, IsString, Matches } from 'class-validator';
|
|
3
|
+
import { MessageMomentEnum } from '../../../messageMoments/enums/MessageMomentEnum';
|
|
4
|
+
import { REGULATORY_CAMPAIGN_KEY_PATTERN, REGULATORY_CAMPAIGN_MOMENTS } from '../../constants/RegulatoryCampaign';
|
|
5
|
+
|
|
6
|
+
/** Body de `POST /backoffice/regulatory-notices` (loan-credit-business): una página de la campaña. */
|
|
7
|
+
export class BackofficeSendRegulatoryNoticeRequest {
|
|
8
|
+
@Expose()
|
|
9
|
+
@IsIn(REGULATORY_CAMPAIGN_MOMENTS)
|
|
10
|
+
moment!: MessageMomentEnum;
|
|
11
|
+
|
|
12
|
+
/** La misma en todas las páginas: reintentar la campaña no duplica el aviso. */
|
|
13
|
+
@Expose()
|
|
14
|
+
@IsString()
|
|
15
|
+
@Matches(REGULATORY_CAMPAIGN_KEY_PATTERN)
|
|
16
|
+
campaignKey!: string;
|
|
17
|
+
|
|
18
|
+
/** Cursor de la página anterior; ausente en la primera. */
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsString()
|
|
22
|
+
@IsNotEmpty()
|
|
23
|
+
nextToken?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Lo que dejó una página de la campaña regulatoria. */
|
|
2
|
+
export interface RegulatoryNoticeCampaignPage {
|
|
3
|
+
/** Créditos vivos revisados en esta página. */
|
|
4
|
+
examined: number;
|
|
5
|
+
/** Avisos que salieron por algún canal. */
|
|
6
|
+
delivered: number;
|
|
7
|
+
/** Avisos que la puerta descartó, cada uno con su fila de evidencia. */
|
|
8
|
+
discarded: number;
|
|
9
|
+
/** Avisos que fallaron; también dejan fila FALLIDA. */
|
|
10
|
+
failed: number;
|
|
11
|
+
/** Cursor de la página siguiente; ausente cuando la campaña terminó. */
|
|
12
|
+
nextToken?: string;
|
|
13
|
+
}
|
package/src/loanCredit/index.ts
CHANGED
|
@@ -155,6 +155,9 @@ export * from './dtos/responses/LoanRestructure';
|
|
|
155
155
|
export * from './dtos/responses/LoanRestructureListResponse';
|
|
156
156
|
export * from './dtos/responses/LoanRestructurePreviewInstallment';
|
|
157
157
|
export * from './dtos/responses/LoanRestructurePreview';
|
|
158
|
+
export * from './constants/RegulatoryCampaign';
|
|
159
|
+
export * from './dtos/requests/BackofficeSendRegulatoryNoticeRequest';
|
|
160
|
+
export * from './dtos/responses/RegulatoryNoticeCampaignPage';
|
|
158
161
|
export * from './dtos/responses/LoanOtpDispatch';
|
|
159
162
|
export * from './dtos/responses/LoanPrepaymentQuote';
|
|
160
163
|
export * from './dtos/responses/LoanPaymentReviewItem';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose } from "class-transformer";
|
|
2
|
-
import { IsString, IsNotEmpty, IsOptional, IsNumber, IsPositive, Matches, IsEnum } from "class-validator";
|
|
2
|
+
import { IsString, IsNotEmpty, IsOptional, IsNumber, IsPositive, Matches, IsEnum, IsISO8601 } from "class-validator";
|
|
3
3
|
import { CREDIT_ID_MESSAGE, CREDIT_ID_PATTERN } from "../../common/constants/CreditIdPattern";
|
|
4
4
|
import { MdmLockModeEnum } from "../../retailCatalog/enums/MdmLockModeEnum";
|
|
5
5
|
|
|
@@ -39,6 +39,12 @@ export class DeviceEnrollRequest {
|
|
|
39
39
|
@IsOptional()
|
|
40
40
|
lockMode?: MdmLockModeEnum;
|
|
41
41
|
|
|
42
|
+
/** ISO-8601 del primer bloqueo programado (primer vencimiento); lo usan proveedores que agendan el bloqueo al enrolar. */
|
|
43
|
+
@Expose()
|
|
44
|
+
@IsISO8601()
|
|
45
|
+
@IsOptional()
|
|
46
|
+
firstLockAt?: string;
|
|
47
|
+
|
|
42
48
|
@Expose()
|
|
43
49
|
@IsString()
|
|
44
50
|
@IsNotEmpty()
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* No es la cadencia completa de cobranza: los hitos de otros canales (tarde del día 0, días 90 y 180) no se pintan acá.
|
|
5
5
|
*/
|
|
6
6
|
export enum MdmNoticeTypeEnum {
|
|
7
|
+
/** Tres días antes del vencimiento de la cuota. */
|
|
8
|
+
PRE_DUE_3_DAYS = "PRE_DUE_3_DAYS",
|
|
7
9
|
/** Dos días antes del vencimiento de la cuota. */
|
|
8
10
|
PRE_DUE_2_DAYS = "PRE_DUE_2_DAYS",
|
|
9
11
|
/** Un día antes del vencimiento de la cuota. */
|
|
@@ -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
|
+
}
|
|
@@ -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,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
|
+
}
|
|
@@ -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
|
-
|
|
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)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { FailedConditionEvaluationResponse } from './FailedConditionEvaluationResponse';
|
|
2
|
+
|
|
1
3
|
/** Condición que más hace fallar la regla (`GET /metrics/failed-conditions`). */
|
|
2
4
|
export class FailedConditionStatResponse {
|
|
3
5
|
/** `{source}.{field}`. */
|
|
@@ -5,4 +7,6 @@ export class FailedConditionStatResponse {
|
|
|
5
7
|
/** Etiqueta legible (del catálogo de reglas; si no está, la propia `key`). */
|
|
6
8
|
label: string;
|
|
7
9
|
count: number;
|
|
10
|
+
/** Evaluaciones donde falla esta condición, ordenadas por `count` descendente (máx. 5). */
|
|
11
|
+
evaluations: FailedConditionEvaluationResponse[];
|
|
8
12
|
}
|
|
@@ -77,4 +77,5 @@ export * from './dtos/backoffice/RunResultListResponse';
|
|
|
77
77
|
export * from './dtos/backoffice/CreateRunResponse';
|
|
78
78
|
export * from './dtos/backoffice/MetricsPointResponse';
|
|
79
79
|
export * from './dtos/backoffice/FailedConditionStatResponse';
|
|
80
|
+
export * from './dtos/backoffice/FailedConditionEvaluationResponse';
|
|
80
81
|
export * from './dtos/backoffice/MetricsQuery';
|