@fiado/type-kit 3.596.0 → 3.598.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/customerMessages/customerMessagesContract.test.ts +71 -0
- package/_test_/unit/messageMoments/MessageMomentClassification.test.ts +85 -0
- package/_test_/unit/retailPromotions/constants.test.ts +1 -2
- package/_test_/unit/rules/segmentRelation.test.ts +62 -0
- package/bin/customerMessages/constants/CustomerMessageLimits.d.ts +7 -0
- package/bin/customerMessages/constants/CustomerMessageLimits.js +13 -0
- package/bin/customerMessages/dtos/requests/CustomerManualMessageRequest.d.ts +6 -0
- package/bin/customerMessages/dtos/requests/CustomerManualMessageRequest.js +31 -0
- package/bin/customerMessages/dtos/requests/CustomerMessageHistoryQuery.d.ts +8 -0
- package/bin/customerMessages/dtos/requests/CustomerMessageHistoryQuery.js +40 -0
- package/bin/customerMessages/dtos/responses/CollectionQuotaDay.d.ts +9 -0
- package/bin/customerMessages/dtos/responses/CollectionQuotaDay.js +7 -0
- package/bin/customerMessages/dtos/responses/CollectionQuotaResponse.d.ts +8 -0
- package/bin/customerMessages/dtos/responses/CollectionQuotaResponse.js +7 -0
- package/bin/customerMessages/dtos/responses/CustomerManualMessageResponse.d.ts +4 -0
- package/bin/customerMessages/dtos/responses/CustomerManualMessageResponse.js +7 -0
- package/bin/customerMessages/dtos/responses/CustomerMessageHistoryItem.d.ts +19 -0
- package/bin/customerMessages/dtos/responses/CustomerMessageHistoryItem.js +7 -0
- package/bin/customerMessages/dtos/responses/CustomerMessageHistoryResponse.d.ts +8 -0
- package/bin/customerMessages/dtos/responses/CustomerMessageHistoryResponse.js +7 -0
- package/bin/customerMessages/index.d.ts +8 -0
- package/bin/customerMessages/index.js +24 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +3 -1
- package/bin/messageMoments/constants/MessageMomentCatalog.d.ts +11 -0
- package/bin/messageMoments/constants/MessageMomentCatalog.js +13 -1
- package/bin/messageMoments/constants/MessageMomentClassification.d.ts +19 -0
- package/bin/messageMoments/constants/MessageMomentClassification.js +51 -0
- package/bin/messageMoments/enums/MessageMomentCategoryEnum.d.ts +5 -0
- package/bin/messageMoments/enums/MessageMomentCategoryEnum.js +9 -0
- package/bin/messageMoments/index.d.ts +2 -0
- package/bin/messageMoments/index.js +2 -0
- package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.js +0 -1
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.d.ts +0 -2
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.js +0 -2
- package/bin/rules/dtos/population/SegmentGroup.d.ts +2 -1
- package/bin/rules/dtos/population/SegmentGroup.js +2 -0
- package/bin/rules/dtos/population/SegmentRelationCondition.d.ts +18 -0
- package/bin/rules/dtos/population/SegmentRelationCondition.js +69 -0
- package/bin/rules/enums/SegmentConditionKindEnum.d.ts +2 -1
- package/bin/rules/enums/SegmentConditionKindEnum.js +1 -0
- package/bin/rules/enums/SegmentRelationQuantifierKindEnum.d.ts +5 -0
- package/bin/rules/enums/SegmentRelationQuantifierKindEnum.js +9 -0
- package/bin/rules/index.d.ts +2 -0
- package/bin/rules/index.js +2 -0
- package/package.json +1 -1
- package/src/customerMessages/constants/CustomerMessageLimits.ts +13 -0
- package/src/customerMessages/dtos/requests/CustomerManualMessageRequest.ts +16 -0
- package/src/customerMessages/dtos/requests/CustomerMessageHistoryQuery.ts +25 -0
- package/src/customerMessages/dtos/responses/CollectionQuotaDay.ts +10 -0
- package/src/customerMessages/dtos/responses/CollectionQuotaResponse.ts +9 -0
- package/src/customerMessages/dtos/responses/CustomerManualMessageResponse.ts +4 -0
- package/src/customerMessages/dtos/responses/CustomerMessageHistoryItem.ts +20 -0
- package/src/customerMessages/dtos/responses/CustomerMessageHistoryResponse.ts +9 -0
- package/src/customerMessages/index.ts +8 -0
- package/src/index.ts +3 -0
- package/src/messageMoments/constants/MessageMomentCatalog.ts +20 -1
- package/src/messageMoments/constants/MessageMomentClassification.ts +56 -0
- package/src/messageMoments/enums/MessageMomentCategoryEnum.ts +5 -0
- package/src/messageMoments/index.ts +2 -0
- package/src/retailPromotions/constants/retailPromotionsErrorHttpStatus.ts +0 -1
- package/src/retailPromotions/enums/RetailPromotionsErrorCodeEnum.ts +0 -2
- package/src/rules/dtos/population/SegmentGroup.ts +3 -1
- package/src/rules/dtos/population/SegmentRelationCondition.ts +25 -0
- package/src/rules/enums/SegmentConditionKindEnum.ts +1 -0
- package/src/rules/enums/SegmentRelationQuantifierKindEnum.ts +5 -0
- package/src/rules/index.ts +2 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MANUAL_SEND_MOMENTS = exports.COLLECTION_MOMENT_OVERRIDES = exports.COLLECTION_BLOCKS = exports.CREDIT_CATEGORY_OVERRIDES = exports.BLOCK_DEFAULT_CATEGORY = void 0;
|
|
4
|
+
exports.classifyMoment = classifyMoment;
|
|
5
|
+
const MessageMomentBlockEnum_1 = require("../enums/MessageMomentBlockEnum");
|
|
6
|
+
const MessageMomentCategoryEnum_1 = require("../enums/MessageMomentCategoryEnum");
|
|
7
|
+
const MessageMomentEnum_1 = require("../enums/MessageMomentEnum");
|
|
8
|
+
/** Categoría por defecto de cada bloque; un momento nuevo la hereda. */
|
|
9
|
+
exports.BLOCK_DEFAULT_CATEGORY = {
|
|
10
|
+
[MessageMomentBlockEnum_1.MessageMomentBlockEnum.ORIGINATION]: MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.SALE,
|
|
11
|
+
[MessageMomentBlockEnum_1.MessageMomentBlockEnum.REMINDERS]: MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.CREDIT,
|
|
12
|
+
[MessageMomentBlockEnum_1.MessageMomentBlockEnum.PAYMENTS]: MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.CREDIT,
|
|
13
|
+
[MessageMomentBlockEnum_1.MessageMomentBlockEnum.COLLECTIONS]: MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.CREDIT,
|
|
14
|
+
[MessageMomentBlockEnum_1.MessageMomentBlockEnum.DEVICE_LOCK]: MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.CREDIT,
|
|
15
|
+
[MessageMomentBlockEnum_1.MessageMomentBlockEnum.EXCEPTIONS]: MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.CREDIT,
|
|
16
|
+
[MessageMomentBlockEnum_1.MessageMomentBlockEnum.CLOSURE]: MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.CREDIT,
|
|
17
|
+
[MessageMomentBlockEnum_1.MessageMomentBlockEnum.SERVICE]: MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.SALE,
|
|
18
|
+
[MessageMomentBlockEnum_1.MessageMomentBlockEnum.REFERRALS]: MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.SALE,
|
|
19
|
+
};
|
|
20
|
+
/** Momentos del bloque de servicio que van al historial del crédito. */
|
|
21
|
+
exports.CREDIT_CATEGORY_OVERRIDES = new Set([
|
|
22
|
+
MessageMomentEnum_1.MessageMomentEnum.MONTHLY_STATEMENT,
|
|
23
|
+
MessageMomentEnum_1.MessageMomentEnum.CAT_TERMS_NOTICE,
|
|
24
|
+
MessageMomentEnum_1.MessageMomentEnum.PRIVACY_ARCO_NOTICE,
|
|
25
|
+
]);
|
|
26
|
+
/** Bloques cuyos momentos son de cobranza y cuentan contra el tope diario. */
|
|
27
|
+
exports.COLLECTION_BLOCKS = new Set([
|
|
28
|
+
MessageMomentBlockEnum_1.MessageMomentBlockEnum.REMINDERS,
|
|
29
|
+
MessageMomentBlockEnum_1.MessageMomentBlockEnum.COLLECTIONS,
|
|
30
|
+
]);
|
|
31
|
+
/** Momentos de cobranza fuera de esos bloques. */
|
|
32
|
+
exports.COLLECTION_MOMENT_OVERRIDES = new Set([
|
|
33
|
+
MessageMomentEnum_1.MessageMomentEnum.PAYMENT_REJECTED,
|
|
34
|
+
MessageMomentEnum_1.MessageMomentEnum.MDM_LOCK_APPLIED,
|
|
35
|
+
MessageMomentEnum_1.MessageMomentEnum.LAST_INSTALLMENT,
|
|
36
|
+
]);
|
|
37
|
+
/** Momentos que el backoffice puede enviar a mano a un cliente. */
|
|
38
|
+
exports.MANUAL_SEND_MOMENTS = new Set([
|
|
39
|
+
MessageMomentEnum_1.MessageMomentEnum.F5_FRAUD_CONFIRMED,
|
|
40
|
+
MessageMomentEnum_1.MessageMomentEnum.CAT_TERMS_NOTICE,
|
|
41
|
+
MessageMomentEnum_1.MessageMomentEnum.PRIVACY_ARCO_NOTICE,
|
|
42
|
+
MessageMomentEnum_1.MessageMomentEnum.REFERRAL_COUPON_ISSUED,
|
|
43
|
+
]);
|
|
44
|
+
/** Clasificación de un momento: la de su bloque, salvo que esté en una lista de excepciones. */
|
|
45
|
+
function classifyMoment(messageType, blockId) {
|
|
46
|
+
return {
|
|
47
|
+
category: exports.CREDIT_CATEGORY_OVERRIDES.has(messageType) ? MessageMomentCategoryEnum_1.MessageMomentCategoryEnum.CREDIT : exports.BLOCK_DEFAULT_CATEGORY[blockId],
|
|
48
|
+
collection: exports.COLLECTION_BLOCKS.has(blockId) || exports.COLLECTION_MOMENT_OVERRIDES.has(messageType),
|
|
49
|
+
manualSend: exports.MANUAL_SEND_MOMENTS.has(messageType),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageMomentCategoryEnum = void 0;
|
|
4
|
+
/** A qué historial del cliente pertenece un momento: la venta o el crédito. */
|
|
5
|
+
var MessageMomentCategoryEnum;
|
|
6
|
+
(function (MessageMomentCategoryEnum) {
|
|
7
|
+
MessageMomentCategoryEnum["SALE"] = "SALE";
|
|
8
|
+
MessageMomentCategoryEnum["CREDIT"] = "CREDIT";
|
|
9
|
+
})(MessageMomentCategoryEnum || (exports.MessageMomentCategoryEnum = MessageMomentCategoryEnum = {}));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './enums/MessageMomentEnum';
|
|
2
2
|
export * from './enums/MessageMomentBlockEnum';
|
|
3
|
+
export * from './enums/MessageMomentCategoryEnum';
|
|
4
|
+
export * from './constants/MessageMomentClassification';
|
|
3
5
|
export * from './constants/MessageMomentVariables';
|
|
4
6
|
export * from './constants/MessageMomentCatalog';
|
|
5
7
|
export * from './constants/TemplatePlaceholder';
|
|
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./enums/MessageMomentEnum"), exports);
|
|
18
18
|
__exportStar(require("./enums/MessageMomentBlockEnum"), exports);
|
|
19
|
+
__exportStar(require("./enums/MessageMomentCategoryEnum"), exports);
|
|
20
|
+
__exportStar(require("./constants/MessageMomentClassification"), exports);
|
|
19
21
|
__exportStar(require("./constants/MessageMomentVariables"), exports);
|
|
20
22
|
__exportStar(require("./constants/MessageMomentCatalog"), exports);
|
|
21
23
|
__exportStar(require("./constants/TemplatePlaceholder"), exports);
|
|
@@ -33,7 +33,6 @@ exports.RETAIL_PROMOTIONS_ERROR_HTTP_STATUS = {
|
|
|
33
33
|
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.SALE_PROMOTION_HOLD_CONFLICT]: 409,
|
|
34
34
|
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.INVALID_NEXT_TOKEN]: 400,
|
|
35
35
|
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CATALOG_SKU_NOT_FOUND]: 404,
|
|
36
|
-
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.SPLIT_FINANCING_DISABLED]: 409,
|
|
37
36
|
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.PROMOTION_NOT_STACKABLE]: 422,
|
|
38
37
|
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.PROMOTION_PAYMENT_NOT_ELIGIBLE]: 422,
|
|
39
38
|
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED]: 422,
|
|
@@ -43,8 +43,6 @@ export declare enum RetailPromotionsErrorCodeEnum {
|
|
|
43
43
|
INVALID_NEXT_TOKEN = "INVALID_NEXT_TOKEN",
|
|
44
44
|
/** El SKU no existe en el catálogo. */
|
|
45
45
|
CATALOG_SKU_NOT_FOUND = "CATALOG_SKU_NOT_FOUND",
|
|
46
|
-
/** Con el reparto apagado no se aplican palancas de precio ni código; los regalos sí. */
|
|
47
|
-
SPLIT_FINANCING_DISABLED = "SPLIT_FINANCING_DISABLED",
|
|
48
46
|
/** La promo no acumulable choca con otra en la misma línea. */
|
|
49
47
|
PROMOTION_NOT_STACKABLE = "PROMOTION_NOT_STACKABLE",
|
|
50
48
|
/** La promo no acepta la forma de pago o el medio de cobro de la venta. */
|
|
@@ -47,8 +47,6 @@ var RetailPromotionsErrorCodeEnum;
|
|
|
47
47
|
RetailPromotionsErrorCodeEnum["INVALID_NEXT_TOKEN"] = "INVALID_NEXT_TOKEN";
|
|
48
48
|
/** El SKU no existe en el catálogo. */
|
|
49
49
|
RetailPromotionsErrorCodeEnum["CATALOG_SKU_NOT_FOUND"] = "CATALOG_SKU_NOT_FOUND";
|
|
50
|
-
/** Con el reparto apagado no se aplican palancas de precio ni código; los regalos sí. */
|
|
51
|
-
RetailPromotionsErrorCodeEnum["SPLIT_FINANCING_DISABLED"] = "SPLIT_FINANCING_DISABLED";
|
|
52
50
|
/** La promo no acumulable choca con otra en la misma línea. */
|
|
53
51
|
RetailPromotionsErrorCodeEnum["PROMOTION_NOT_STACKABLE"] = "PROMOTION_NOT_STACKABLE";
|
|
54
52
|
/** La promo no acepta la forma de pago o el medio de cobro de la venta. */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SegmentMatchEnum } from '../../enums/SegmentMatchEnum';
|
|
2
2
|
import { SegmentAggregateCondition } from './SegmentAggregateCondition';
|
|
3
3
|
import { SegmentColumnCondition } from './SegmentColumnCondition';
|
|
4
|
-
|
|
4
|
+
import { SegmentRelationCondition } from './SegmentRelationCondition';
|
|
5
|
+
export type SegmentCondition = SegmentColumnCondition | SegmentAggregateCondition | SegmentRelationCondition;
|
|
5
6
|
export declare class SegmentGroup {
|
|
6
7
|
match: SegmentMatchEnum;
|
|
7
8
|
/** `kind` decide la clase; un `kind` desconocido NO se instancia y la validacion lo rechaza (el objeto queda sin `@Equals` valido). */
|
|
@@ -16,6 +16,7 @@ const SegmentConditionKindEnum_1 = require("../../enums/SegmentConditionKindEnum
|
|
|
16
16
|
const SegmentMatchEnum_1 = require("../../enums/SegmentMatchEnum");
|
|
17
17
|
const SegmentAggregateCondition_1 = require("./SegmentAggregateCondition");
|
|
18
18
|
const SegmentColumnCondition_1 = require("./SegmentColumnCondition");
|
|
19
|
+
const SegmentRelationCondition_1 = require("./SegmentRelationCondition");
|
|
19
20
|
class SegmentGroup {
|
|
20
21
|
}
|
|
21
22
|
exports.SegmentGroup = SegmentGroup;
|
|
@@ -37,6 +38,7 @@ __decorate([
|
|
|
37
38
|
subTypes: [
|
|
38
39
|
{ value: SegmentColumnCondition_1.SegmentColumnCondition, name: SegmentConditionKindEnum_1.SegmentConditionKindEnum.COLUMN },
|
|
39
40
|
{ value: SegmentAggregateCondition_1.SegmentAggregateCondition, name: SegmentConditionKindEnum_1.SegmentConditionKindEnum.AGGREGATE },
|
|
41
|
+
{ value: SegmentRelationCondition_1.SegmentRelationCondition, name: SegmentConditionKindEnum_1.SegmentConditionKindEnum.RELATION },
|
|
40
42
|
],
|
|
41
43
|
},
|
|
42
44
|
}),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SegmentConditionKindEnum } from '../../enums/SegmentConditionKindEnum';
|
|
2
|
+
import { SegmentOperatorEnum } from '../../enums/SegmentOperatorEnum';
|
|
3
|
+
import { SegmentRelationQuantifierKindEnum } from '../../enums/SegmentRelationQuantifierKindEnum';
|
|
4
|
+
import { SegmentColumnCondition } from './SegmentColumnCondition';
|
|
5
|
+
/** Cuantificador de una relacion 1:N. COUNT exige `op` y `value`; ANY/ALL no los llevan. */
|
|
6
|
+
export declare class SegmentRelationQuantifier {
|
|
7
|
+
kind: SegmentRelationQuantifierKindEnum;
|
|
8
|
+
op?: SegmentOperatorEnum;
|
|
9
|
+
value?: number;
|
|
10
|
+
}
|
|
11
|
+
/** (c) Condicion sobre los relacionados de la persona (referidor / referidos). `filters` se aplica a cada relacionado. */
|
|
12
|
+
export declare class SegmentRelationCondition {
|
|
13
|
+
kind: SegmentConditionKindEnum.RELATION;
|
|
14
|
+
relation: string;
|
|
15
|
+
/** MANY: obligatorio; ONE: ausente (lo valida el compilador, no el DTO). */
|
|
16
|
+
quantifier?: SegmentRelationQuantifier;
|
|
17
|
+
filters: SegmentColumnCondition[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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.SegmentRelationCondition = exports.SegmentRelationQuantifier = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const RulesRelationLimits_1 = require("../../constants/RulesRelationLimits");
|
|
16
|
+
const SegmentConditionKindEnum_1 = require("../../enums/SegmentConditionKindEnum");
|
|
17
|
+
const SegmentOperatorEnum_1 = require("../../enums/SegmentOperatorEnum");
|
|
18
|
+
const SegmentRelationQuantifierKindEnum_1 = require("../../enums/SegmentRelationQuantifierKindEnum");
|
|
19
|
+
const SegmentColumnCondition_1 = require("./SegmentColumnCondition");
|
|
20
|
+
/** Cuantificador de una relacion 1:N. COUNT exige `op` y `value`; ANY/ALL no los llevan. */
|
|
21
|
+
class SegmentRelationQuantifier {
|
|
22
|
+
}
|
|
23
|
+
exports.SegmentRelationQuantifier = SegmentRelationQuantifier;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_transformer_1.Expose)(),
|
|
26
|
+
(0, class_validator_1.IsEnum)(SegmentRelationQuantifierKindEnum_1.SegmentRelationQuantifierKindEnum),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], SegmentRelationQuantifier.prototype, "kind", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
(0, class_validator_1.ValidateIf)((q) => q.kind === SegmentRelationQuantifierKindEnum_1.SegmentRelationQuantifierKindEnum.COUNT || q.op !== undefined),
|
|
32
|
+
(0, class_validator_1.IsEnum)(SegmentOperatorEnum_1.SegmentOperatorEnum),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], SegmentRelationQuantifier.prototype, "op", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Expose)(),
|
|
37
|
+
(0, class_validator_1.ValidateIf)((q) => q.kind === SegmentRelationQuantifierKindEnum_1.SegmentRelationQuantifierKindEnum.COUNT || q.value !== undefined),
|
|
38
|
+
(0, class_validator_1.IsNumber)(),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], SegmentRelationQuantifier.prototype, "value", void 0);
|
|
41
|
+
/** (c) Condicion sobre los relacionados de la persona (referidor / referidos). `filters` se aplica a cada relacionado. */
|
|
42
|
+
class SegmentRelationCondition {
|
|
43
|
+
}
|
|
44
|
+
exports.SegmentRelationCondition = SegmentRelationCondition;
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_transformer_1.Expose)(),
|
|
47
|
+
(0, class_validator_1.Equals)(SegmentConditionKindEnum_1.SegmentConditionKindEnum.RELATION),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], SegmentRelationCondition.prototype, "kind", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_transformer_1.Expose)(),
|
|
52
|
+
(0, class_validator_1.Matches)(RulesRelationLimits_1.RULES_RELATION_NAME_PATTERN),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], SegmentRelationCondition.prototype, "relation", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_transformer_1.Expose)(),
|
|
57
|
+
(0, class_validator_1.IsOptional)(),
|
|
58
|
+
(0, class_validator_1.ValidateNested)(),
|
|
59
|
+
(0, class_transformer_1.Type)(() => SegmentRelationQuantifier),
|
|
60
|
+
__metadata("design:type", SegmentRelationQuantifier)
|
|
61
|
+
], SegmentRelationCondition.prototype, "quantifier", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_transformer_1.Expose)(),
|
|
64
|
+
(0, class_validator_1.IsArray)(),
|
|
65
|
+
(0, class_validator_1.ArrayMaxSize)(10),
|
|
66
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
67
|
+
(0, class_transformer_1.Type)(() => SegmentColumnCondition_1.SegmentColumnCondition),
|
|
68
|
+
__metadata("design:type", Array)
|
|
69
|
+
], SegmentRelationCondition.prototype, "filters", void 0);
|
|
@@ -5,4 +5,5 @@ var SegmentConditionKindEnum;
|
|
|
5
5
|
(function (SegmentConditionKindEnum) {
|
|
6
6
|
SegmentConditionKindEnum["COLUMN"] = "COLUMN";
|
|
7
7
|
SegmentConditionKindEnum["AGGREGATE"] = "AGGREGATE";
|
|
8
|
+
SegmentConditionKindEnum["RELATION"] = "RELATION";
|
|
8
9
|
})(SegmentConditionKindEnum || (exports.SegmentConditionKindEnum = SegmentConditionKindEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SegmentRelationQuantifierKindEnum = void 0;
|
|
4
|
+
var SegmentRelationQuantifierKindEnum;
|
|
5
|
+
(function (SegmentRelationQuantifierKindEnum) {
|
|
6
|
+
SegmentRelationQuantifierKindEnum["ANY"] = "ANY";
|
|
7
|
+
SegmentRelationQuantifierKindEnum["ALL"] = "ALL";
|
|
8
|
+
SegmentRelationQuantifierKindEnum["COUNT"] = "COUNT";
|
|
9
|
+
})(SegmentRelationQuantifierKindEnum || (exports.SegmentRelationQuantifierKindEnum = SegmentRelationQuantifierKindEnum = {}));
|
package/bin/rules/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from './dtos/EvaluateRulesResponse';
|
|
|
20
20
|
export * from './enums/SegmentMatchEnum';
|
|
21
21
|
export * from './enums/SegmentOutputEnum';
|
|
22
22
|
export * from './enums/SegmentConditionKindEnum';
|
|
23
|
+
export * from './enums/SegmentRelationQuantifierKindEnum';
|
|
23
24
|
export * from './enums/SegmentAggregateFnEnum';
|
|
24
25
|
export * from './enums/SegmentOperatorEnum';
|
|
25
26
|
export * from './enums/SegmentParamTypeEnum';
|
|
@@ -28,6 +29,7 @@ export * from './constants/SegmentLimits';
|
|
|
28
29
|
export * from './dtos/population/SegmentWindow';
|
|
29
30
|
export * from './dtos/population/SegmentColumnCondition';
|
|
30
31
|
export * from './dtos/population/SegmentAggregateCondition';
|
|
32
|
+
export * from './dtos/population/SegmentRelationCondition';
|
|
31
33
|
export * from './dtos/population/SegmentGroup';
|
|
32
34
|
export * from './dtos/population/PopulationSegmentDefinition';
|
|
33
35
|
export * from './dtos/population/SegmentParam';
|
package/bin/rules/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __exportStar(require("./dtos/EvaluateRulesResponse"), exports);
|
|
|
40
40
|
__exportStar(require("./enums/SegmentMatchEnum"), exports);
|
|
41
41
|
__exportStar(require("./enums/SegmentOutputEnum"), exports);
|
|
42
42
|
__exportStar(require("./enums/SegmentConditionKindEnum"), exports);
|
|
43
|
+
__exportStar(require("./enums/SegmentRelationQuantifierKindEnum"), exports);
|
|
43
44
|
__exportStar(require("./enums/SegmentAggregateFnEnum"), exports);
|
|
44
45
|
__exportStar(require("./enums/SegmentOperatorEnum"), exports);
|
|
45
46
|
__exportStar(require("./enums/SegmentParamTypeEnum"), exports);
|
|
@@ -48,6 +49,7 @@ __exportStar(require("./constants/SegmentLimits"), exports);
|
|
|
48
49
|
__exportStar(require("./dtos/population/SegmentWindow"), exports);
|
|
49
50
|
__exportStar(require("./dtos/population/SegmentColumnCondition"), exports);
|
|
50
51
|
__exportStar(require("./dtos/population/SegmentAggregateCondition"), exports);
|
|
52
|
+
__exportStar(require("./dtos/population/SegmentRelationCondition"), exports);
|
|
51
53
|
__exportStar(require("./dtos/population/SegmentGroup"), exports);
|
|
52
54
|
__exportStar(require("./dtos/population/PopulationSegmentDefinition"), exports);
|
|
53
55
|
__exportStar(require("./dtos/population/SegmentParam"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DeliveryChannelExtendedEnum } from '../../messagesConnector/enums/DeliveryChannelExtendedEnum';
|
|
2
|
+
|
|
3
|
+
/** Máximo de mensajes por página del historial del cliente. */
|
|
4
|
+
export const CUSTOMER_MESSAGE_HISTORY_MAX_LIMIT = 50;
|
|
5
|
+
|
|
6
|
+
/** Id de ficha de un momento: `PM-` y tres dígitos. */
|
|
7
|
+
export const MESSAGE_MOMENT_TEMPLATE_ID_PATTERN = /^PM-\d{3}$/;
|
|
8
|
+
|
|
9
|
+
/** Canales por los que el backoffice puede enviar un momento a mano. */
|
|
10
|
+
export const CUSTOMER_MANUAL_MESSAGE_CHANNELS: readonly DeliveryChannelExtendedEnum[] = [
|
|
11
|
+
DeliveryChannelExtendedEnum.SMS,
|
|
12
|
+
DeliveryChannelExtendedEnum.PUSH_NOTIFICATION,
|
|
13
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsIn, IsString, Matches } from 'class-validator';
|
|
3
|
+
import { DeliveryChannelExtendedEnum } from '../../../messagesConnector/enums/DeliveryChannelExtendedEnum';
|
|
4
|
+
import { CUSTOMER_MANUAL_MESSAGE_CHANNELS, MESSAGE_MOMENT_TEMPLATE_ID_PATTERN } from '../../constants/CustomerMessageLimits';
|
|
5
|
+
|
|
6
|
+
/** Body del envío manual de un momento a un cliente desde el backoffice. */
|
|
7
|
+
export class CustomerManualMessageRequest {
|
|
8
|
+
@Expose()
|
|
9
|
+
@IsString()
|
|
10
|
+
@Matches(MESSAGE_MOMENT_TEMPLATE_ID_PATTERN)
|
|
11
|
+
templateId!: string;
|
|
12
|
+
|
|
13
|
+
@Expose()
|
|
14
|
+
@IsIn(CUSTOMER_MANUAL_MESSAGE_CHANNELS)
|
|
15
|
+
channel!: DeliveryChannelExtendedEnum;
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
3
|
+
import { MessageMomentCategoryEnum } from '../../../messageMoments/enums/MessageMomentCategoryEnum';
|
|
4
|
+
import { CUSTOMER_MESSAGE_HISTORY_MAX_LIMIT } from '../../constants/CustomerMessageLimits';
|
|
5
|
+
|
|
6
|
+
/** Query del historial de mensajes de un cliente, filtrado por venta o crédito. */
|
|
7
|
+
export class CustomerMessageHistoryQuery {
|
|
8
|
+
@Expose()
|
|
9
|
+
@IsEnum(MessageMomentCategoryEnum)
|
|
10
|
+
category!: MessageMomentCategoryEnum;
|
|
11
|
+
|
|
12
|
+
/** Cursor opaco de la página anterior. */
|
|
13
|
+
@Expose()
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
cursor?: string;
|
|
17
|
+
|
|
18
|
+
@Expose()
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@Type(() => Number)
|
|
21
|
+
@IsInt()
|
|
22
|
+
@Min(1)
|
|
23
|
+
@Max(CUSTOMER_MESSAGE_HISTORY_MAX_LIMIT)
|
|
24
|
+
limit?: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DeliveryChannelExtendedEnum } from '../../../messagesConnector/enums/DeliveryChannelExtendedEnum';
|
|
2
|
+
|
|
3
|
+
/** Mensajes de cobranza de un día de tienda en un canal: enviados y bloqueados por el tope. */
|
|
4
|
+
export class CollectionQuotaDay {
|
|
5
|
+
/** YYYY-MM-DD en la zona de la tienda. */
|
|
6
|
+
storeDay!: string;
|
|
7
|
+
channel!: DeliveryChannelExtendedEnum;
|
|
8
|
+
sent!: number;
|
|
9
|
+
blocked!: number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CollectionQuotaDay } from './CollectionQuotaDay';
|
|
2
|
+
|
|
3
|
+
/** Contador diario de cobranza del cliente por canal. */
|
|
4
|
+
export class CollectionQuotaResponse {
|
|
5
|
+
maxPerChannel!: number;
|
|
6
|
+
/** YYYY-MM-DD del día de tienda actual. */
|
|
7
|
+
today!: string;
|
|
8
|
+
days!: CollectionQuotaDay[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MessageMomentCategoryEnum } from '../../../messageMoments/enums/MessageMomentCategoryEnum';
|
|
2
|
+
import { DeliveryChannelExtendedEnum } from '../../../messagesConnector/enums/DeliveryChannelExtendedEnum';
|
|
3
|
+
import { MessageLogStatusEnum } from '../../../messagesConnector/enums/MessageLogStatusEnum';
|
|
4
|
+
import { NotificationOriginEnum } from '../../../messagesConnector/enums/NotificationOriginEnum';
|
|
5
|
+
|
|
6
|
+
/** Un mensaje del historial del cliente, clasificado por su momento. */
|
|
7
|
+
export class CustomerMessageHistoryItem {
|
|
8
|
+
messageId!: string;
|
|
9
|
+
templateId!: string;
|
|
10
|
+
messageType!: string;
|
|
11
|
+
category!: MessageMomentCategoryEnum;
|
|
12
|
+
collection!: boolean;
|
|
13
|
+
channelType!: DeliveryChannelExtendedEnum;
|
|
14
|
+
status!: MessageLogStatusEnum;
|
|
15
|
+
/** Null cuando el texto no se muestra, como el OTP. */
|
|
16
|
+
renderedMessage!: string | null;
|
|
17
|
+
origin!: NotificationOriginEnum;
|
|
18
|
+
/** ISO 8601. */
|
|
19
|
+
createdAt!: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CustomerMessageHistoryItem } from './CustomerMessageHistoryItem';
|
|
2
|
+
|
|
3
|
+
/** Página del historial del cliente, del más nuevo al más viejo. `nextCursor` en null: no hay más. */
|
|
4
|
+
export class CustomerMessageHistoryResponse {
|
|
5
|
+
/** False si el cliente no tiene cuenta Fiado; entonces `items` viene vacío. */
|
|
6
|
+
hasFiadoAccount!: boolean;
|
|
7
|
+
items!: CustomerMessageHistoryItem[];
|
|
8
|
+
nextCursor!: string | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './constants/CustomerMessageLimits';
|
|
2
|
+
export * from './dtos/requests/CustomerMessageHistoryQuery';
|
|
3
|
+
export * from './dtos/requests/CustomerManualMessageRequest';
|
|
4
|
+
export * from './dtos/responses/CustomerMessageHistoryItem';
|
|
5
|
+
export * from './dtos/responses/CustomerMessageHistoryResponse';
|
|
6
|
+
export * from './dtos/responses/CollectionQuotaDay';
|
|
7
|
+
export * from './dtos/responses/CollectionQuotaResponse';
|
|
8
|
+
export * from './dtos/responses/CustomerManualMessageResponse';
|
package/src/index.ts
CHANGED
|
@@ -224,3 +224,6 @@ export * as LoanRetailAudit from './loanRetailAudit';
|
|
|
224
224
|
|
|
225
225
|
// TaskManager: DTOs del lambda task-manager-business (gestor genérico de tareas; primer tipo MARKETING_MATERIAL).
|
|
226
226
|
export * as TaskManager from './task-manager-business';
|
|
227
|
+
|
|
228
|
+
// CustomerMessages: historial de mensajes del cliente por venta o crédito, contador de cobranza y envío manual.
|
|
229
|
+
export * as CustomerMessages from './customerMessages';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { MessageMomentEnum } from '../enums/MessageMomentEnum';
|
|
2
2
|
import { MessageMomentBlockEnum } from '../enums/MessageMomentBlockEnum';
|
|
3
|
+
import { MessageMomentCategoryEnum } from '../enums/MessageMomentCategoryEnum';
|
|
4
|
+
import { classifyMoment } from './MessageMomentClassification';
|
|
3
5
|
import {
|
|
4
6
|
CREDIT_MOMENT_ALWAYS_VARIABLES,
|
|
5
7
|
CREDIT_MOMENT_CONDITIONAL_VARIABLES,
|
|
@@ -20,6 +22,12 @@ export interface MessageMomentIdentity {
|
|
|
20
22
|
blockId: MessageMomentBlockEnum;
|
|
21
23
|
alwaysVariables: readonly string[];
|
|
22
24
|
conditionalVariables: readonly string[];
|
|
25
|
+
/** Historial del cliente donde aparece: venta o crédito. */
|
|
26
|
+
category: MessageMomentCategoryEnum;
|
|
27
|
+
/** Es cobranza: cuenta contra el tope diario por canal. */
|
|
28
|
+
collection: boolean;
|
|
29
|
+
/** El backoffice lo puede enviar a mano. */
|
|
30
|
+
manualSend: boolean;
|
|
23
31
|
}
|
|
24
32
|
|
|
25
33
|
/** Un momento del crédito: las variables del crédito más las que solo emite él. */
|
|
@@ -30,6 +38,7 @@ function creditMoment(templateId: string, messageType: MessageMomentEnum, blockI
|
|
|
30
38
|
blockId,
|
|
31
39
|
alwaysVariables: [...CREDIT_MOMENT_ALWAYS_VARIABLES, ...(MOMENT_SPECIFIC_VARIABLES[messageType] ?? [])],
|
|
32
40
|
conditionalVariables: CREDIT_MOMENT_CONDITIONAL_VARIABLES,
|
|
41
|
+
...classifyMoment(messageType, blockId),
|
|
33
42
|
};
|
|
34
43
|
}
|
|
35
44
|
|
|
@@ -41,7 +50,7 @@ function standaloneMoment(
|
|
|
41
50
|
alwaysVariables: readonly string[],
|
|
42
51
|
conditionalVariables: readonly string[] = [],
|
|
43
52
|
): MessageMomentIdentity {
|
|
44
|
-
return { templateId, messageType, blockId, alwaysVariables, conditionalVariables };
|
|
53
|
+
return { templateId, messageType, blockId, alwaysVariables, conditionalVariables, ...classifyMoment(messageType, blockId) };
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
const B = MessageMomentBlockEnum;
|
|
@@ -100,3 +109,13 @@ export const momentByTemplateId: ReadonlyMap<string, MessageMomentIdentity> = ne
|
|
|
100
109
|
export const momentByMessageType: ReadonlyMap<string, MessageMomentIdentity> = new Map(
|
|
101
110
|
MESSAGE_MOMENT_CATALOG.map((moment) => [moment.messageType, moment]),
|
|
102
111
|
);
|
|
112
|
+
|
|
113
|
+
/** Si el messageType es de cobranza; false para lo que no está en el catálogo. */
|
|
114
|
+
export function isCollectionMoment(messageType: string): boolean {
|
|
115
|
+
return momentByMessageType.get(messageType)?.collection ?? false;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Los momentos de una categoría, en el orden del catálogo. */
|
|
119
|
+
export function momentsOfCategory(category: MessageMomentCategoryEnum): readonly MessageMomentIdentity[] {
|
|
120
|
+
return MESSAGE_MOMENT_CATALOG.filter((moment) => moment.category === category);
|
|
121
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MessageMomentBlockEnum } from '../enums/MessageMomentBlockEnum';
|
|
2
|
+
import { MessageMomentCategoryEnum } from '../enums/MessageMomentCategoryEnum';
|
|
3
|
+
import { MessageMomentEnum } from '../enums/MessageMomentEnum';
|
|
4
|
+
|
|
5
|
+
/** Categoría por defecto de cada bloque; un momento nuevo la hereda. */
|
|
6
|
+
export const BLOCK_DEFAULT_CATEGORY: Readonly<Record<MessageMomentBlockEnum, MessageMomentCategoryEnum>> = {
|
|
7
|
+
[MessageMomentBlockEnum.ORIGINATION]: MessageMomentCategoryEnum.SALE,
|
|
8
|
+
[MessageMomentBlockEnum.REMINDERS]: MessageMomentCategoryEnum.CREDIT,
|
|
9
|
+
[MessageMomentBlockEnum.PAYMENTS]: MessageMomentCategoryEnum.CREDIT,
|
|
10
|
+
[MessageMomentBlockEnum.COLLECTIONS]: MessageMomentCategoryEnum.CREDIT,
|
|
11
|
+
[MessageMomentBlockEnum.DEVICE_LOCK]: MessageMomentCategoryEnum.CREDIT,
|
|
12
|
+
[MessageMomentBlockEnum.EXCEPTIONS]: MessageMomentCategoryEnum.CREDIT,
|
|
13
|
+
[MessageMomentBlockEnum.CLOSURE]: MessageMomentCategoryEnum.CREDIT,
|
|
14
|
+
[MessageMomentBlockEnum.SERVICE]: MessageMomentCategoryEnum.SALE,
|
|
15
|
+
[MessageMomentBlockEnum.REFERRALS]: MessageMomentCategoryEnum.SALE,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** Momentos del bloque de servicio que van al historial del crédito. */
|
|
19
|
+
export const CREDIT_CATEGORY_OVERRIDES: ReadonlySet<MessageMomentEnum> = new Set([
|
|
20
|
+
MessageMomentEnum.MONTHLY_STATEMENT,
|
|
21
|
+
MessageMomentEnum.CAT_TERMS_NOTICE,
|
|
22
|
+
MessageMomentEnum.PRIVACY_ARCO_NOTICE,
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
/** Bloques cuyos momentos son de cobranza y cuentan contra el tope diario. */
|
|
26
|
+
export const COLLECTION_BLOCKS: ReadonlySet<MessageMomentBlockEnum> = new Set([
|
|
27
|
+
MessageMomentBlockEnum.REMINDERS,
|
|
28
|
+
MessageMomentBlockEnum.COLLECTIONS,
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
/** Momentos de cobranza fuera de esos bloques. */
|
|
32
|
+
export const COLLECTION_MOMENT_OVERRIDES: ReadonlySet<MessageMomentEnum> = new Set([
|
|
33
|
+
MessageMomentEnum.PAYMENT_REJECTED,
|
|
34
|
+
MessageMomentEnum.MDM_LOCK_APPLIED,
|
|
35
|
+
MessageMomentEnum.LAST_INSTALLMENT,
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
/** Momentos que el backoffice puede enviar a mano a un cliente. */
|
|
39
|
+
export const MANUAL_SEND_MOMENTS: ReadonlySet<MessageMomentEnum> = new Set([
|
|
40
|
+
MessageMomentEnum.F5_FRAUD_CONFIRMED,
|
|
41
|
+
MessageMomentEnum.CAT_TERMS_NOTICE,
|
|
42
|
+
MessageMomentEnum.PRIVACY_ARCO_NOTICE,
|
|
43
|
+
MessageMomentEnum.REFERRAL_COUPON_ISSUED,
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
/** Clasificación de un momento: la de su bloque, salvo que esté en una lista de excepciones. */
|
|
47
|
+
export function classifyMoment(
|
|
48
|
+
messageType: MessageMomentEnum,
|
|
49
|
+
blockId: MessageMomentBlockEnum,
|
|
50
|
+
): { category: MessageMomentCategoryEnum; collection: boolean; manualSend: boolean } {
|
|
51
|
+
return {
|
|
52
|
+
category: CREDIT_CATEGORY_OVERRIDES.has(messageType) ? MessageMomentCategoryEnum.CREDIT : BLOCK_DEFAULT_CATEGORY[blockId],
|
|
53
|
+
collection: COLLECTION_BLOCKS.has(blockId) || COLLECTION_MOMENT_OVERRIDES.has(messageType),
|
|
54
|
+
manualSend: MANUAL_SEND_MOMENTS.has(messageType),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './enums/MessageMomentEnum';
|
|
2
2
|
export * from './enums/MessageMomentBlockEnum';
|
|
3
|
+
export * from './enums/MessageMomentCategoryEnum';
|
|
4
|
+
export * from './constants/MessageMomentClassification';
|
|
3
5
|
export * from './constants/MessageMomentVariables';
|
|
4
6
|
export * from './constants/MessageMomentCatalog';
|
|
5
7
|
export * from './constants/TemplatePlaceholder';
|
|
@@ -31,7 +31,6 @@ export const RETAIL_PROMOTIONS_ERROR_HTTP_STATUS: Readonly<Record<C, 400 | 403 |
|
|
|
31
31
|
[C.SALE_PROMOTION_HOLD_CONFLICT]: 409,
|
|
32
32
|
[C.INVALID_NEXT_TOKEN]: 400,
|
|
33
33
|
[C.CATALOG_SKU_NOT_FOUND]: 404,
|
|
34
|
-
[C.SPLIT_FINANCING_DISABLED]: 409,
|
|
35
34
|
[C.PROMOTION_NOT_STACKABLE]: 422,
|
|
36
35
|
[C.PROMOTION_PAYMENT_NOT_ELIGIBLE]: 422,
|
|
37
36
|
[C.SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED]: 422,
|
|
@@ -43,8 +43,6 @@ export enum RetailPromotionsErrorCodeEnum {
|
|
|
43
43
|
INVALID_NEXT_TOKEN = 'INVALID_NEXT_TOKEN',
|
|
44
44
|
/** El SKU no existe en el catálogo. */
|
|
45
45
|
CATALOG_SKU_NOT_FOUND = 'CATALOG_SKU_NOT_FOUND',
|
|
46
|
-
/** Con el reparto apagado no se aplican palancas de precio ni código; los regalos sí. */
|
|
47
|
-
SPLIT_FINANCING_DISABLED = 'SPLIT_FINANCING_DISABLED',
|
|
48
46
|
/** La promo no acumulable choca con otra en la misma línea. */
|
|
49
47
|
PROMOTION_NOT_STACKABLE = 'PROMOTION_NOT_STACKABLE',
|
|
50
48
|
/** La promo no acepta la forma de pago o el medio de cobro de la venta. */
|
|
@@ -4,8 +4,9 @@ import { SegmentConditionKindEnum } from '../../enums/SegmentConditionKindEnum';
|
|
|
4
4
|
import { SegmentMatchEnum } from '../../enums/SegmentMatchEnum';
|
|
5
5
|
import { SegmentAggregateCondition } from './SegmentAggregateCondition';
|
|
6
6
|
import { SegmentColumnCondition } from './SegmentColumnCondition';
|
|
7
|
+
import { SegmentRelationCondition } from './SegmentRelationCondition';
|
|
7
8
|
|
|
8
|
-
export type SegmentCondition = SegmentColumnCondition | SegmentAggregateCondition;
|
|
9
|
+
export type SegmentCondition = SegmentColumnCondition | SegmentAggregateCondition | SegmentRelationCondition;
|
|
9
10
|
|
|
10
11
|
export class SegmentGroup {
|
|
11
12
|
@Expose() @IsEnum(SegmentMatchEnum) match: SegmentMatchEnum;
|
|
@@ -20,6 +21,7 @@ export class SegmentGroup {
|
|
|
20
21
|
subTypes: [
|
|
21
22
|
{ value: SegmentColumnCondition, name: SegmentConditionKindEnum.COLUMN },
|
|
22
23
|
{ value: SegmentAggregateCondition, name: SegmentConditionKindEnum.AGGREGATE },
|
|
24
|
+
{ value: SegmentRelationCondition, name: SegmentConditionKindEnum.RELATION },
|
|
23
25
|
],
|
|
24
26
|
},
|
|
25
27
|
})
|