@fiado/type-kit 3.564.0 → 3.566.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/retailCustomer/customerReferralContract.test.ts +228 -0
- package/_test_/unit/retailPromotions/constants.test.ts +1 -1
- package/_test_/unit/retailPromotions/referralPromotion.test.ts +177 -0
- package/_test_/unit/retailPromotions/referralRewardsByPhones.test.ts +73 -0
- package/_test_/unit/retailPromotions/referralWizardContracts.test.ts +119 -0
- package/_test_/unit/retailPromotions/salePromotionPaymentCheck.test.ts +29 -0
- package/_test_/unit/retailWizard/backofficeCustomerReferrals.test.ts +78 -0
- package/_test_/unit/retailWizard/promotionInboundMessages.test.ts +151 -0
- package/_test_/unit/retailWizard/referralsCapture.test.ts +66 -0
- package/_test_/unit/retailWizard/ventaSagaMessages.test.ts +7 -2
- package/bin/retailCustomer/dtos/CustomerReferral.d.ts +25 -0
- package/bin/retailCustomer/dtos/CustomerReferral.js +99 -0
- package/bin/retailCustomer/dtos/requests/CreateCustomerReferralsRequest.d.ts +19 -0
- package/bin/retailCustomer/dtos/requests/CreateCustomerReferralsRequest.js +101 -0
- package/bin/retailCustomer/dtos/requests/GetCustomersByPhonesRequest.d.ts +4 -0
- package/bin/retailCustomer/dtos/requests/GetCustomersByPhonesRequest.js +28 -0
- package/bin/retailCustomer/dtos/requests/GetReferralsByPhoneQuery.d.ts +6 -0
- package/bin/retailCustomer/dtos/requests/GetReferralsByPhoneQuery.js +39 -0
- package/bin/retailCustomer/dtos/requests/UpdateCustomerReferralRequest.d.ts +8 -0
- package/bin/retailCustomer/dtos/requests/UpdateCustomerReferralRequest.js +53 -0
- package/bin/retailCustomer/dtos/requests/UpsertPromotionBonusRequest.d.ts +4 -0
- package/bin/retailCustomer/dtos/requests/UpsertPromotionBonusRequest.js +15 -0
- package/bin/retailCustomer/dtos/responses/CustomerReferralResponses.d.ts +39 -0
- package/bin/retailCustomer/dtos/responses/CustomerReferralResponses.js +2 -0
- package/bin/retailCustomer/enums/ReferralRoleEnum.d.ts +5 -0
- package/bin/retailCustomer/enums/ReferralRoleEnum.js +9 -0
- package/bin/retailCustomer/enums/ReferralSourceEnum.d.ts +6 -0
- package/bin/retailCustomer/enums/ReferralSourceEnum.js +10 -0
- package/bin/retailCustomer/enums/ReferralStatusEnum.d.ts +7 -0
- package/bin/retailCustomer/enums/ReferralStatusEnum.js +11 -0
- package/bin/retailCustomer/index.d.ts +9 -0
- package/bin/retailCustomer/index.js +9 -0
- package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.js +2 -0
- package/bin/retailPromotions/dtos/ReferralPromotion.d.ts +33 -0
- package/bin/retailPromotions/dtos/ReferralPromotion.js +2 -0
- package/bin/retailPromotions/dtos/SalePromotion.d.ts +3 -0
- package/bin/retailPromotions/dtos/requests/CheckSalePromotionPaymentRequest.d.ts +6 -0
- package/bin/retailPromotions/dtos/requests/CheckSalePromotionPaymentRequest.js +25 -0
- package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.d.ts +3 -0
- package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.js +8 -0
- package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.d.ts +2 -0
- package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.js +7 -0
- package/bin/retailPromotions/dtos/requests/GetReferralRewardsByPhonesRequest.d.ts +5 -0
- package/bin/retailPromotions/dtos/requests/GetReferralRewardsByPhonesRequest.js +34 -0
- package/bin/retailPromotions/dtos/requests/ListLiveReferralPromotionsQuery.d.ts +10 -0
- package/bin/retailPromotions/dtos/requests/ListLiveReferralPromotionsQuery.js +38 -0
- package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.d.ts +6 -1
- package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.js +15 -1
- package/bin/retailPromotions/dtos/requests/ReferralPromotionInput.d.ts +24 -0
- package/bin/retailPromotions/dtos/requests/ReferralPromotionInput.js +119 -0
- package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.d.ts +3 -0
- package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.js +8 -0
- package/bin/retailPromotions/dtos/responses/LiveReferralPromotionsResponse.d.ts +24 -0
- package/bin/retailPromotions/dtos/responses/LiveReferralPromotionsResponse.js +2 -0
- package/bin/retailPromotions/dtos/responses/ReferralRewardsByPhonesResponses.d.ts +25 -0
- package/bin/retailPromotions/dtos/responses/ReferralRewardsByPhonesResponses.js +2 -0
- package/bin/retailPromotions/dtos/responses/SalePromotionPaymentCheckResponses.d.ts +16 -0
- package/bin/retailPromotions/dtos/responses/SalePromotionPaymentCheckResponses.js +2 -0
- package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.d.ts +13 -0
- package/bin/retailPromotions/enums/ReferralPromotionChannelEnum.d.ts +5 -0
- package/bin/retailPromotions/enums/ReferralPromotionChannelEnum.js +9 -0
- package/bin/retailPromotions/enums/ReferralRewardStatusEnum.d.ts +9 -0
- package/bin/retailPromotions/enums/ReferralRewardStatusEnum.js +13 -0
- package/bin/retailPromotions/enums/ReferralRewardTypeEnum.d.ts +10 -0
- package/bin/retailPromotions/enums/ReferralRewardTypeEnum.js +14 -0
- package/bin/retailPromotions/enums/ReferralTriggerEnum.d.ts +13 -0
- package/bin/retailPromotions/enums/ReferralTriggerEnum.js +17 -0
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.d.ts +5 -1
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.js +4 -0
- package/bin/retailPromotions/enums/SalePromotionKindEnum.d.ts +3 -2
- package/bin/retailPromotions/enums/SalePromotionKindEnum.js +2 -1
- package/bin/retailPromotions/index.d.ts +12 -0
- package/bin/retailPromotions/index.js +12 -0
- package/bin/retailWizard/dtos/responses/BackofficeCustomerReferralsResponse.d.ts +58 -0
- package/bin/retailWizard/dtos/responses/BackofficeCustomerReferralsResponse.js +2 -0
- package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.d.ts +4 -2
- package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.js +3 -1
- package/bin/retailWizard/enums/WizardStepEnum.d.ts +3 -1
- package/bin/retailWizard/enums/WizardStepEnum.js +2 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.d.ts +7 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.js +22 -1
- package/bin/retailWizard/events/RetailPromotionAccountOpenedMessage.d.ts +15 -0
- package/bin/retailWizard/events/RetailPromotionAccountOpenedMessage.js +56 -0
- package/bin/retailWizard/events/RetailPromotionInboundMessage.d.ts +15 -0
- package/bin/retailWizard/events/RetailPromotionInboundMessage.js +41 -1
- package/bin/retailWizard/events/RetailPromotionInstallmentPaidMessage.d.ts +20 -0
- package/bin/retailWizard/events/RetailPromotionInstallmentPaidMessage.js +75 -0
- package/bin/retailWizard/events/RetailPromotionQueueMessage.d.ts +5 -0
- package/bin/retailWizard/events/RetailPromotionQueueMessage.js +2 -0
- package/bin/retailWizard/index.d.ts +4 -0
- package/bin/retailWizard/index.js +4 -0
- package/package.json +1 -1
- package/src/retailCustomer/dtos/CustomerReferral.ts +77 -0
- package/src/retailCustomer/dtos/requests/CreateCustomerReferralsRequest.ts +91 -0
- package/src/retailCustomer/dtos/requests/GetCustomersByPhonesRequest.ts +15 -0
- package/src/retailCustomer/dtos/requests/GetReferralsByPhoneQuery.ts +23 -0
- package/src/retailCustomer/dtos/requests/UpdateCustomerReferralRequest.ts +38 -0
- package/src/retailCustomer/dtos/requests/UpsertPromotionBonusRequest.ts +15 -1
- package/src/retailCustomer/dtos/responses/CustomerReferralResponses.ts +46 -0
- package/src/retailCustomer/enums/ReferralRoleEnum.ts +5 -0
- package/src/retailCustomer/enums/ReferralSourceEnum.ts +6 -0
- package/src/retailCustomer/enums/ReferralStatusEnum.ts +7 -0
- package/src/retailCustomer/index.ts +9 -0
- package/src/retailPromotions/constants/retailPromotionsErrorHttpStatus.ts +2 -0
- package/src/retailPromotions/dtos/ReferralPromotion.ts +35 -0
- package/src/retailPromotions/dtos/SalePromotion.ts +3 -0
- package/src/retailPromotions/dtos/requests/CheckSalePromotionPaymentRequest.ts +12 -0
- package/src/retailPromotions/dtos/requests/CreateSalePromotionRequest.ts +8 -0
- package/src/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.ts +7 -0
- package/src/retailPromotions/dtos/requests/GetReferralRewardsByPhonesRequest.ts +20 -0
- package/src/retailPromotions/dtos/requests/ListLiveReferralPromotionsQuery.ts +24 -0
- package/src/retailPromotions/dtos/requests/ListSalePromotionsQuery.ts +14 -1
- package/src/retailPromotions/dtos/requests/ReferralPromotionInput.ts +93 -0
- package/src/retailPromotions/dtos/requests/UpdateSalePromotionRequest.ts +8 -0
- package/src/retailPromotions/dtos/responses/LiveReferralPromotionsResponse.ts +26 -0
- package/src/retailPromotions/dtos/responses/ReferralRewardsByPhonesResponses.ts +28 -0
- package/src/retailPromotions/dtos/responses/SalePromotionPaymentCheckResponses.ts +17 -0
- package/src/retailPromotions/dtos/responses/WizardSalePromotionResponses.ts +15 -0
- package/src/retailPromotions/enums/ReferralPromotionChannelEnum.ts +5 -0
- package/src/retailPromotions/enums/ReferralRewardStatusEnum.ts +9 -0
- package/src/retailPromotions/enums/ReferralRewardTypeEnum.ts +10 -0
- package/src/retailPromotions/enums/ReferralTriggerEnum.ts +13 -0
- package/src/retailPromotions/enums/RetailPromotionsErrorCodeEnum.ts +4 -0
- package/src/retailPromotions/enums/SalePromotionKindEnum.ts +2 -1
- package/src/retailPromotions/index.ts +12 -0
- package/src/retailWizard/dtos/responses/BackofficeCustomerReferralsResponse.ts +63 -0
- package/src/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.ts +3 -1
- package/src/retailWizard/enums/WizardStepEnum.ts +2 -0
- package/src/retailWizard/events/RetailCommissionInboundMessage.ts +18 -0
- package/src/retailWizard/events/RetailPromotionAccountOpenedMessage.ts +38 -0
- package/src/retailWizard/events/RetailPromotionInboundMessage.ts +43 -1
- package/src/retailWizard/events/RetailPromotionInstallmentPaidMessage.ts +53 -0
- package/src/retailWizard/events/RetailPromotionQueueMessage.ts +9 -0
- package/src/retailWizard/index.ts +4 -0
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RetailCommissionInboundMessage = exports.RetailCommissionInboundLine = void 0;
|
|
12
|
+
exports.RetailCommissionInboundMessage = exports.RetailCommissionInboundReferral = exports.RetailCommissionInboundLine = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const ItemTypeEnum_1 = require("../../retailCatalog/enums/ItemTypeEnum");
|
|
@@ -78,6 +78,20 @@ __decorate([
|
|
|
78
78
|
(0, class_validator_1.Min)(0),
|
|
79
79
|
__metadata("design:type", Number)
|
|
80
80
|
], RetailCommissionInboundLine.prototype, "phoneCount", void 0);
|
|
81
|
+
/** Referido capturado en la venta, con quien lo capturó para su comisión. */
|
|
82
|
+
class RetailCommissionInboundReferral {
|
|
83
|
+
}
|
|
84
|
+
exports.RetailCommissionInboundReferral = RetailCommissionInboundReferral;
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, class_validator_1.IsString)(),
|
|
87
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], RetailCommissionInboundReferral.prototype, "referralId", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, class_validator_1.IsString)(),
|
|
92
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], RetailCommissionInboundReferral.prototype, "capturedBy", void 0);
|
|
81
95
|
/** Venta cerrada o cancelada que el wizard publica en RetailCommissionInboundQueue. */
|
|
82
96
|
class RetailCommissionInboundMessage {
|
|
83
97
|
}
|
|
@@ -151,3 +165,10 @@ __decorate([
|
|
|
151
165
|
(0, class_transformer_1.Type)(() => RetailCommissionInboundLine),
|
|
152
166
|
__metadata("design:type", Array)
|
|
153
167
|
], RetailCommissionInboundMessage.prototype, "lines", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, class_validator_1.IsOptional)(),
|
|
170
|
+
(0, class_validator_1.IsArray)(),
|
|
171
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
172
|
+
(0, class_transformer_1.Type)(() => RetailCommissionInboundReferral),
|
|
173
|
+
__metadata("design:type", Array)
|
|
174
|
+
], RetailCommissionInboundMessage.prototype, "referrals", void 0);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RetailPromotionInboundMessageTypeEnum } from '../enums/RetailPromotionInboundMessageTypeEnum';
|
|
2
|
+
/** Cuenta PCF que quedó OPEN (LINKED no cuenta); el wizard la publica en RetailPromotionInboundQueue. */
|
|
3
|
+
export declare class RetailPromotionAccountOpenedMessage {
|
|
4
|
+
type: RetailPromotionInboundMessageTypeEnum.ACCOUNT_OPENED;
|
|
5
|
+
tenantId: string;
|
|
6
|
+
retailerId: string;
|
|
7
|
+
storeId: string;
|
|
8
|
+
/** El retailCustomerId de quien abrió la cuenta. */
|
|
9
|
+
customerId: string;
|
|
10
|
+
/** Teléfono a 10 dígitos: con él se busca al referidor. */
|
|
11
|
+
phone: string;
|
|
12
|
+
/** Sesión del wizard donde se abrió la cuenta. */
|
|
13
|
+
sessionId: string;
|
|
14
|
+
openedAt: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RetailPromotionAccountOpenedMessage = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const RetailPromotionInboundMessageTypeEnum_1 = require("../enums/RetailPromotionInboundMessageTypeEnum");
|
|
15
|
+
/** Cuenta PCF que quedó OPEN (LINKED no cuenta); el wizard la publica en RetailPromotionInboundQueue. */
|
|
16
|
+
class RetailPromotionAccountOpenedMessage {
|
|
17
|
+
}
|
|
18
|
+
exports.RetailPromotionAccountOpenedMessage = RetailPromotionAccountOpenedMessage;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.Equals)(RetailPromotionInboundMessageTypeEnum_1.RetailPromotionInboundMessageTypeEnum.ACCOUNT_OPENED),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], RetailPromotionAccountOpenedMessage.prototype, "type", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], RetailPromotionAccountOpenedMessage.prototype, "tenantId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], RetailPromotionAccountOpenedMessage.prototype, "retailerId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], RetailPromotionAccountOpenedMessage.prototype, "storeId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], RetailPromotionAccountOpenedMessage.prototype, "customerId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_validator_1.IsString)(),
|
|
45
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], RetailPromotionAccountOpenedMessage.prototype, "phone", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], RetailPromotionAccountOpenedMessage.prototype, "sessionId", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsISO8601)(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], RetailPromotionAccountOpenedMessage.prototype, "openedAt", void 0);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { LinePromotionAmount } from '../../retailPromotions/dtos/LinePromotionAmount';
|
|
2
2
|
import { SalePromotionRef } from '../../retailPromotions/dtos/SalePromotionRef';
|
|
3
|
+
import { ExternalProviderEnum } from '../enums/ExternalProviderEnum';
|
|
3
4
|
import { RetailPromotionInboundMessageTypeEnum } from '../enums/RetailPromotionInboundMessageTypeEnum';
|
|
5
|
+
import { SalePaymentMethodEnum } from '../enums/SalePaymentMethodEnum';
|
|
6
|
+
import { SaleTypeEnum } from '../enums/SaleTypeEnum';
|
|
4
7
|
import { WizardLineRoleEnum } from '../enums/WizardLineRoleEnum';
|
|
5
8
|
/** Línea de la venta en el mensaje de Promociones. */
|
|
6
9
|
export declare class RetailPromotionInboundLine {
|
|
@@ -45,4 +48,16 @@ export declare class RetailPromotionInboundMessage {
|
|
|
45
48
|
/** Todas las promos de venta de la venta; `salePromotionId` queda como la principal. */
|
|
46
49
|
salePromotions?: SalePromotionRef[] | null;
|
|
47
50
|
lines: RetailPromotionInboundLine[];
|
|
51
|
+
/** Forma de pago; ausente en mensajes viejos. */
|
|
52
|
+
saleType?: SaleTypeEnum;
|
|
53
|
+
/** Medio de cobro, solo en contado. */
|
|
54
|
+
paymentMethod?: SalePaymentMethodEnum | null;
|
|
55
|
+
/** Financiera externa, solo en `EXTERNAL_REFERRAL`. */
|
|
56
|
+
externalProvider?: ExternalProviderEnum | null;
|
|
57
|
+
/** Precio del equipo en centavos; en crédito no es el enganche. */
|
|
58
|
+
amountCents?: number;
|
|
59
|
+
/** 1 + ventas no canceladas del cliente en la cadena. */
|
|
60
|
+
purchaseNumber?: number;
|
|
61
|
+
/** Teléfono del cliente a 10 dígitos. */
|
|
62
|
+
phone?: string;
|
|
48
63
|
}
|
|
@@ -14,7 +14,10 @@ const class_transformer_1 = require("class-transformer");
|
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const LinePromotionAmount_1 = require("../../retailPromotions/dtos/LinePromotionAmount");
|
|
16
16
|
const SalePromotionRef_1 = require("../../retailPromotions/dtos/SalePromotionRef");
|
|
17
|
+
const ExternalProviderEnum_1 = require("../enums/ExternalProviderEnum");
|
|
17
18
|
const RetailPromotionInboundMessageTypeEnum_1 = require("../enums/RetailPromotionInboundMessageTypeEnum");
|
|
19
|
+
const SalePaymentMethodEnum_1 = require("../enums/SalePaymentMethodEnum");
|
|
20
|
+
const SaleTypeEnum_1 = require("../enums/SaleTypeEnum");
|
|
18
21
|
const WizardLineRoleEnum_1 = require("../enums/WizardLineRoleEnum");
|
|
19
22
|
/** Línea de la venta en el mensaje de Promociones. */
|
|
20
23
|
class RetailPromotionInboundLine {
|
|
@@ -98,12 +101,16 @@ __decorate([
|
|
|
98
101
|
(0, class_validator_1.IsBoolean)(),
|
|
99
102
|
__metadata("design:type", Boolean)
|
|
100
103
|
], RetailPromotionInboundLine.prototype, "returned", void 0);
|
|
104
|
+
const SALE_MESSAGE_TYPES = [
|
|
105
|
+
RetailPromotionInboundMessageTypeEnum_1.RetailPromotionInboundMessageTypeEnum.SALE_CONFIRMED,
|
|
106
|
+
RetailPromotionInboundMessageTypeEnum_1.RetailPromotionInboundMessageTypeEnum.SALE_CANCELLED,
|
|
107
|
+
];
|
|
101
108
|
/** Venta confirmada o cancelada que el wizard publica en RetailPromotionInboundQueue; crédito = trae creditId. */
|
|
102
109
|
class RetailPromotionInboundMessage {
|
|
103
110
|
}
|
|
104
111
|
exports.RetailPromotionInboundMessage = RetailPromotionInboundMessage;
|
|
105
112
|
__decorate([
|
|
106
|
-
(0, class_validator_1.
|
|
113
|
+
(0, class_validator_1.IsIn)(SALE_MESSAGE_TYPES),
|
|
107
114
|
__metadata("design:type", String)
|
|
108
115
|
], RetailPromotionInboundMessage.prototype, "type", void 0);
|
|
109
116
|
__decorate([
|
|
@@ -182,3 +189,36 @@ __decorate([
|
|
|
182
189
|
(0, class_transformer_1.Type)(() => RetailPromotionInboundLine),
|
|
183
190
|
__metadata("design:type", Array)
|
|
184
191
|
], RetailPromotionInboundMessage.prototype, "lines", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, class_validator_1.IsOptional)(),
|
|
194
|
+
(0, class_validator_1.IsEnum)(SaleTypeEnum_1.SaleTypeEnum),
|
|
195
|
+
__metadata("design:type", String)
|
|
196
|
+
], RetailPromotionInboundMessage.prototype, "saleType", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, class_validator_1.IsOptional)(),
|
|
199
|
+
(0, class_validator_1.IsEnum)(SalePaymentMethodEnum_1.SalePaymentMethodEnum),
|
|
200
|
+
__metadata("design:type", String)
|
|
201
|
+
], RetailPromotionInboundMessage.prototype, "paymentMethod", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
(0, class_validator_1.IsOptional)(),
|
|
204
|
+
(0, class_validator_1.IsEnum)(ExternalProviderEnum_1.ExternalProviderEnum),
|
|
205
|
+
__metadata("design:type", String)
|
|
206
|
+
], RetailPromotionInboundMessage.prototype, "externalProvider", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
(0, class_validator_1.IsOptional)(),
|
|
209
|
+
(0, class_validator_1.IsInt)(),
|
|
210
|
+
(0, class_validator_1.Min)(0),
|
|
211
|
+
__metadata("design:type", Number)
|
|
212
|
+
], RetailPromotionInboundMessage.prototype, "amountCents", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
(0, class_validator_1.IsOptional)(),
|
|
215
|
+
(0, class_validator_1.IsInt)(),
|
|
216
|
+
(0, class_validator_1.Min)(1),
|
|
217
|
+
__metadata("design:type", Number)
|
|
218
|
+
], RetailPromotionInboundMessage.prototype, "purchaseNumber", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
(0, class_validator_1.IsOptional)(),
|
|
221
|
+
(0, class_validator_1.IsString)(),
|
|
222
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
223
|
+
__metadata("design:type", String)
|
|
224
|
+
], RetailPromotionInboundMessage.prototype, "phone", void 0);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LoanInstallmentStatusEnum } from '../../loanCredit/enums/LoanInstallmentStatusEnum';
|
|
2
|
+
import { RetailPromotionInboundMessageTypeEnum } from '../enums/RetailPromotionInboundMessageTypeEnum';
|
|
3
|
+
/** Cuota pagada que loan-credit publica en RetailPromotionInboundQueue: `InstallmentPaidV1` + contexto. Sin PII. */
|
|
4
|
+
export declare class RetailPromotionInstallmentPaidMessage {
|
|
5
|
+
type: RetailPromotionInboundMessageTypeEnum.CREDIT_INSTALLMENT_PAID;
|
|
6
|
+
tenantId: string;
|
|
7
|
+
creditId: string;
|
|
8
|
+
installmentNumber: number;
|
|
9
|
+
/** Lo pagado de la cuota en total, en centavos. */
|
|
10
|
+
paidCents: number;
|
|
11
|
+
paidAt: string;
|
|
12
|
+
installmentStatus: LoanInstallmentStatusEnum;
|
|
13
|
+
paymentId: string;
|
|
14
|
+
wizardSessionId: string;
|
|
15
|
+
storeId: string;
|
|
16
|
+
/** Pagada a más tardar en su vencimiento. */
|
|
17
|
+
onTime: boolean;
|
|
18
|
+
/** Cuotas seguidas a tiempo hasta esta, incluida; 0 si esta fue tarde. */
|
|
19
|
+
onTimeStreak: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
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.RetailPromotionInstallmentPaidMessage = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const LoanInstallmentStatusEnum_1 = require("../../loanCredit/enums/LoanInstallmentStatusEnum");
|
|
15
|
+
const RetailPromotionInboundMessageTypeEnum_1 = require("../enums/RetailPromotionInboundMessageTypeEnum");
|
|
16
|
+
/** Cuota pagada que loan-credit publica en RetailPromotionInboundQueue: `InstallmentPaidV1` + contexto. Sin PII. */
|
|
17
|
+
class RetailPromotionInstallmentPaidMessage {
|
|
18
|
+
}
|
|
19
|
+
exports.RetailPromotionInstallmentPaidMessage = RetailPromotionInstallmentPaidMessage;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.Equals)(RetailPromotionInboundMessageTypeEnum_1.RetailPromotionInboundMessageTypeEnum.CREDIT_INSTALLMENT_PAID),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "type", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "tenantId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "creditId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsInt)(),
|
|
36
|
+
(0, class_validator_1.Min)(1),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "installmentNumber", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsInt)(),
|
|
41
|
+
(0, class_validator_1.Min)(0),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "paidCents", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsISO8601)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "paidAt", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsEnum)(LoanInstallmentStatusEnum_1.LoanInstallmentStatusEnum),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "installmentStatus", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_validator_1.IsString)(),
|
|
54
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "paymentId", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_validator_1.IsString)(),
|
|
59
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "wizardSessionId", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_validator_1.IsString)(),
|
|
64
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "storeId", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_validator_1.IsBoolean)(),
|
|
69
|
+
__metadata("design:type", Boolean)
|
|
70
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "onTime", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsInt)(),
|
|
73
|
+
(0, class_validator_1.Min)(0),
|
|
74
|
+
__metadata("design:type", Number)
|
|
75
|
+
], RetailPromotionInstallmentPaidMessage.prototype, "onTimeStreak", void 0);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RetailPromotionAccountOpenedMessage } from './RetailPromotionAccountOpenedMessage';
|
|
2
|
+
import { RetailPromotionInboundMessage } from './RetailPromotionInboundMessage';
|
|
3
|
+
import { RetailPromotionInstallmentPaidMessage } from './RetailPromotionInstallmentPaidMessage';
|
|
4
|
+
/** Cualquier mensaje de RetailPromotionInboundQueue; el `type` dice cuál clase validar. */
|
|
5
|
+
export type RetailPromotionQueueMessage = RetailPromotionInboundMessage | RetailPromotionAccountOpenedMessage | RetailPromotionInstallmentPaidMessage;
|
|
@@ -157,6 +157,7 @@ export * from './enums/SellerTableSourceStatusEnum';
|
|
|
157
157
|
export * from './dtos/responses/BackofficeSellerTableResponse';
|
|
158
158
|
export * from './dtos/responses/BackofficeCustomerTableResponse';
|
|
159
159
|
export * from './dtos/responses/BackofficeAccountOpeningsResponse';
|
|
160
|
+
export * from './dtos/responses/BackofficeCustomerReferralsResponse';
|
|
160
161
|
export * from './enums/StoreKindEnum';
|
|
161
162
|
export * from './dtos/responses/BackofficeStoreTableResponse';
|
|
162
163
|
export * from './enums/StoreMixCategoryEnum';
|
|
@@ -169,6 +170,9 @@ export * from './events/SessionExpiredV1';
|
|
|
169
170
|
export * from './enums/RetailPromotionInboundMessageTypeEnum';
|
|
170
171
|
export * from './enums/RetailCommissionInboundMessageTypeEnum';
|
|
171
172
|
export * from './events/RetailPromotionInboundMessage';
|
|
173
|
+
export * from './events/RetailPromotionAccountOpenedMessage';
|
|
174
|
+
export * from './events/RetailPromotionInstallmentPaidMessage';
|
|
175
|
+
export * from './events/RetailPromotionQueueMessage';
|
|
172
176
|
export * from './events/RetailCommissionInboundMessage';
|
|
173
177
|
export * from './enums/WizardSessionLookupStatusEnum';
|
|
174
178
|
export * from './dtos/WizardSessionLookupEntry';
|
|
@@ -190,6 +190,7 @@ __exportStar(require("./enums/SellerTableSourceStatusEnum"), exports);
|
|
|
190
190
|
__exportStar(require("./dtos/responses/BackofficeSellerTableResponse"), exports);
|
|
191
191
|
__exportStar(require("./dtos/responses/BackofficeCustomerTableResponse"), exports);
|
|
192
192
|
__exportStar(require("./dtos/responses/BackofficeAccountOpeningsResponse"), exports);
|
|
193
|
+
__exportStar(require("./dtos/responses/BackofficeCustomerReferralsResponse"), exports);
|
|
193
194
|
__exportStar(require("./enums/StoreKindEnum"), exports);
|
|
194
195
|
__exportStar(require("./dtos/responses/BackofficeStoreTableResponse"), exports);
|
|
195
196
|
__exportStar(require("./enums/StoreMixCategoryEnum"), exports);
|
|
@@ -203,6 +204,9 @@ __exportStar(require("./events/SessionExpiredV1"), exports);
|
|
|
203
204
|
__exportStar(require("./enums/RetailPromotionInboundMessageTypeEnum"), exports);
|
|
204
205
|
__exportStar(require("./enums/RetailCommissionInboundMessageTypeEnum"), exports);
|
|
205
206
|
__exportStar(require("./events/RetailPromotionInboundMessage"), exports);
|
|
207
|
+
__exportStar(require("./events/RetailPromotionAccountOpenedMessage"), exports);
|
|
208
|
+
__exportStar(require("./events/RetailPromotionInstallmentPaidMessage"), exports);
|
|
209
|
+
__exportStar(require("./events/RetailPromotionQueueMessage"), exports);
|
|
206
210
|
__exportStar(require("./events/RetailCommissionInboundMessage"), exports);
|
|
207
211
|
// Lookup privado por lote (GET /private/wizard-sessions/batch)
|
|
208
212
|
__exportStar(require("./enums/WizardSessionLookupStatusEnum"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsISO8601, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { ReferralSourceEnum } from '../enums/ReferralSourceEnum';
|
|
4
|
+
|
|
5
|
+
/** Persona que un cliente recomienda (owner: retail-customer-business). Teléfono normalizado a 10 dígitos. */
|
|
6
|
+
export class CustomerReferral {
|
|
7
|
+
@Expose()
|
|
8
|
+
@IsString()
|
|
9
|
+
referralId!: string;
|
|
10
|
+
|
|
11
|
+
/** Cliente que recomienda. */
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsString()
|
|
14
|
+
retailCustomerId!: string;
|
|
15
|
+
|
|
16
|
+
/** Cadena del cliente que recomienda. */
|
|
17
|
+
@Expose()
|
|
18
|
+
@IsString()
|
|
19
|
+
retailerId!: string;
|
|
20
|
+
|
|
21
|
+
/** Tienda de captura; `null` si se agregó en el cajón. */
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
@IsString()
|
|
25
|
+
storeId!: string | null;
|
|
26
|
+
|
|
27
|
+
@Expose()
|
|
28
|
+
@IsString()
|
|
29
|
+
name!: string;
|
|
30
|
+
|
|
31
|
+
@Expose()
|
|
32
|
+
@IsString()
|
|
33
|
+
phone!: string;
|
|
34
|
+
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsString()
|
|
38
|
+
email!: string | null;
|
|
39
|
+
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsEnum(ReferralSourceEnum)
|
|
42
|
+
source!: ReferralSourceEnum;
|
|
43
|
+
|
|
44
|
+
/** Sesión del wizard donde se capturó (venta). */
|
|
45
|
+
@Expose()
|
|
46
|
+
@IsOptional()
|
|
47
|
+
@IsString()
|
|
48
|
+
wizardSessionId!: string | null;
|
|
49
|
+
|
|
50
|
+
/** Solo en `SALE`. */
|
|
51
|
+
@Expose()
|
|
52
|
+
@IsOptional()
|
|
53
|
+
@IsString()
|
|
54
|
+
saleId!: string | null;
|
|
55
|
+
|
|
56
|
+
/** Solo en `OPENING`. */
|
|
57
|
+
@Expose()
|
|
58
|
+
@IsOptional()
|
|
59
|
+
@IsString()
|
|
60
|
+
accountOpeningSessionId!: string | null;
|
|
61
|
+
|
|
62
|
+
@Expose()
|
|
63
|
+
@IsString()
|
|
64
|
+
createdBy!: string;
|
|
65
|
+
|
|
66
|
+
@Expose()
|
|
67
|
+
@IsString()
|
|
68
|
+
updatedBy!: string;
|
|
69
|
+
|
|
70
|
+
@Expose()
|
|
71
|
+
@IsISO8601()
|
|
72
|
+
createdAt!: string;
|
|
73
|
+
|
|
74
|
+
@Expose()
|
|
75
|
+
@IsISO8601()
|
|
76
|
+
updatedAt!: string;
|
|
77
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
ArrayMinSize,
|
|
4
|
+
IsArray,
|
|
5
|
+
IsEmail,
|
|
6
|
+
IsEnum,
|
|
7
|
+
IsNotEmpty,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsString,
|
|
10
|
+
MaxLength,
|
|
11
|
+
ValidateIf,
|
|
12
|
+
ValidateNested,
|
|
13
|
+
} from 'class-validator';
|
|
14
|
+
import { Trim } from '../../../common/decorators/Trim';
|
|
15
|
+
import { EMAIL_MAX_LENGTH } from '../../../common/constants/InputPatterns';
|
|
16
|
+
import { ReferralSourceEnum } from '../../enums/ReferralSourceEnum';
|
|
17
|
+
|
|
18
|
+
const REFERRAL_NAME_MAX_LENGTH = 120;
|
|
19
|
+
|
|
20
|
+
/** Un renglón del lote. El teléfono llega como se tecleó; el lambda lo normaliza y valida. */
|
|
21
|
+
export class CustomerReferralInput {
|
|
22
|
+
@Expose()
|
|
23
|
+
@Trim()
|
|
24
|
+
@IsString()
|
|
25
|
+
@IsNotEmpty()
|
|
26
|
+
@MaxLength(REFERRAL_NAME_MAX_LENGTH)
|
|
27
|
+
name!: string;
|
|
28
|
+
|
|
29
|
+
@Expose()
|
|
30
|
+
@Trim()
|
|
31
|
+
@IsString()
|
|
32
|
+
@IsNotEmpty()
|
|
33
|
+
phone!: string;
|
|
34
|
+
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@Trim()
|
|
38
|
+
@IsEmail()
|
|
39
|
+
@MaxLength(EMAIL_MAX_LENGTH)
|
|
40
|
+
email?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Body de `privateCreateCustomerReferrals`: lote de referidos de un cliente. */
|
|
44
|
+
export class CreateCustomerReferralsRequest {
|
|
45
|
+
@Expose()
|
|
46
|
+
@IsEnum(ReferralSourceEnum)
|
|
47
|
+
source!: ReferralSourceEnum;
|
|
48
|
+
|
|
49
|
+
/** Tienda de captura; obligatoria en venta y apertura. */
|
|
50
|
+
@Expose()
|
|
51
|
+
@ValidateIf((o: CreateCustomerReferralsRequest) => o.source !== ReferralSourceEnum.BACKOFFICE || o.storeId !== undefined)
|
|
52
|
+
@Trim()
|
|
53
|
+
@IsString()
|
|
54
|
+
@IsNotEmpty()
|
|
55
|
+
storeId?: string;
|
|
56
|
+
|
|
57
|
+
@Expose()
|
|
58
|
+
@IsOptional()
|
|
59
|
+
@Trim()
|
|
60
|
+
@IsString()
|
|
61
|
+
@IsNotEmpty()
|
|
62
|
+
wizardSessionId?: string;
|
|
63
|
+
|
|
64
|
+
@Expose()
|
|
65
|
+
@IsOptional()
|
|
66
|
+
@Trim()
|
|
67
|
+
@IsString()
|
|
68
|
+
@IsNotEmpty()
|
|
69
|
+
saleId?: string;
|
|
70
|
+
|
|
71
|
+
@Expose()
|
|
72
|
+
@IsOptional()
|
|
73
|
+
@Trim()
|
|
74
|
+
@IsString()
|
|
75
|
+
@IsNotEmpty()
|
|
76
|
+
accountOpeningSessionId?: string;
|
|
77
|
+
|
|
78
|
+
/** Usuario que capturó (vendedor o admin); la llamada M2M no lo trae en el token. */
|
|
79
|
+
@Expose()
|
|
80
|
+
@Trim()
|
|
81
|
+
@IsString()
|
|
82
|
+
@IsNotEmpty()
|
|
83
|
+
capturedBy!: string;
|
|
84
|
+
|
|
85
|
+
@Expose()
|
|
86
|
+
@IsArray()
|
|
87
|
+
@ArrayMinSize(1)
|
|
88
|
+
@ValidateNested({ each: true })
|
|
89
|
+
@Type(() => CustomerReferralInput)
|
|
90
|
+
referrals!: CustomerReferralInput[];
|
|
91
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { ArrayMaxSize, ArrayMinSize, IsArray, IsNotEmpty, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
const PHONES_MAX_BATCH = 100;
|
|
5
|
+
|
|
6
|
+
/** Body de `privateGetCustomersByPhones`: qué teléfonos ya son clientes. */
|
|
7
|
+
export class GetCustomersByPhonesRequest {
|
|
8
|
+
@Expose()
|
|
9
|
+
@IsArray()
|
|
10
|
+
@ArrayMinSize(1)
|
|
11
|
+
@ArrayMaxSize(PHONES_MAX_BATCH)
|
|
12
|
+
@IsString({ each: true })
|
|
13
|
+
@IsNotEmpty({ each: true })
|
|
14
|
+
phones!: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsISO8601, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { Trim } from '../../../common/decorators/Trim';
|
|
4
|
+
|
|
5
|
+
/** Query de `privateGetReferralsByPhone`: quién recomendó ese teléfono en la cadena, capturado antes de `before`. */
|
|
6
|
+
export class GetReferralsByPhoneQuery {
|
|
7
|
+
@Expose()
|
|
8
|
+
@Trim()
|
|
9
|
+
@IsString()
|
|
10
|
+
@IsNotEmpty()
|
|
11
|
+
retailerId!: string;
|
|
12
|
+
|
|
13
|
+
@Expose()
|
|
14
|
+
@Trim()
|
|
15
|
+
@IsString()
|
|
16
|
+
@IsNotEmpty()
|
|
17
|
+
phone!: string;
|
|
18
|
+
|
|
19
|
+
@Expose()
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsISO8601()
|
|
22
|
+
before?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEmail, IsNotEmpty, IsOptional, IsString, MaxLength, ValidateIf } from 'class-validator';
|
|
3
|
+
import { Trim } from '../../../common/decorators/Trim';
|
|
4
|
+
import { EMAIL_MAX_LENGTH } from '../../../common/constants/InputPatterns';
|
|
5
|
+
|
|
6
|
+
const REFERRAL_NAME_MAX_LENGTH = 120;
|
|
7
|
+
|
|
8
|
+
/** Body de `privateUpdateCustomerReferral`: corrige datos sin cambiar dónde se capturó. `email: null` lo quita. */
|
|
9
|
+
export class UpdateCustomerReferralRequest {
|
|
10
|
+
@Expose()
|
|
11
|
+
@IsOptional()
|
|
12
|
+
@Trim()
|
|
13
|
+
@IsString()
|
|
14
|
+
@IsNotEmpty()
|
|
15
|
+
@MaxLength(REFERRAL_NAME_MAX_LENGTH)
|
|
16
|
+
name?: string;
|
|
17
|
+
|
|
18
|
+
@Expose()
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@Trim()
|
|
21
|
+
@IsString()
|
|
22
|
+
@IsNotEmpty()
|
|
23
|
+
phone?: string;
|
|
24
|
+
|
|
25
|
+
@Expose()
|
|
26
|
+
@ValidateIf((o: UpdateCustomerReferralRequest) => o.email !== undefined && o.email !== null)
|
|
27
|
+
@Trim()
|
|
28
|
+
@IsEmail()
|
|
29
|
+
@MaxLength(EMAIL_MAX_LENGTH)
|
|
30
|
+
email?: string | null;
|
|
31
|
+
|
|
32
|
+
/** Usuario que edita; la llamada M2M no lo trae en el token. */
|
|
33
|
+
@Expose()
|
|
34
|
+
@Trim()
|
|
35
|
+
@IsString()
|
|
36
|
+
@IsNotEmpty()
|
|
37
|
+
updatedBy!: string;
|
|
38
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsIn, IsInt, IsNotEmpty, IsOptional, IsPositive, IsString, MaxLength, ValidateIf } from 'class-validator';
|
|
2
|
+
import { IsEnum, IsIn, IsInt, IsNotEmpty, IsOptional, IsPositive, IsString, MaxLength, ValidateIf } from 'class-validator';
|
|
3
3
|
import { Trim } from '../../../common/decorators/Trim';
|
|
4
4
|
import { BonusTypeEnum } from '../../enums/BonusTypeEnum';
|
|
5
|
+
import { ReferralRoleEnum } from '../../enums/ReferralRoleEnum';
|
|
5
6
|
import { WelcomeBonusStatusEnum } from '../../enums/WelcomeBonusStatusEnum';
|
|
6
7
|
|
|
7
8
|
/** Tope del motivo libre que el caller escribe en el asiento. */
|
|
@@ -118,4 +119,17 @@ export class UpsertPromotionBonusRequest {
|
|
|
118
119
|
@IsString()
|
|
119
120
|
@IsNotEmpty()
|
|
120
121
|
sellerRetailUserId?: string;
|
|
122
|
+
|
|
123
|
+
/** Solo en premios de referido: a quién se le paga. */
|
|
124
|
+
@Expose()
|
|
125
|
+
@IsOptional()
|
|
126
|
+
@IsEnum(ReferralRoleEnum)
|
|
127
|
+
role?: ReferralRoleEnum;
|
|
128
|
+
|
|
129
|
+
@Expose()
|
|
130
|
+
@IsOptional()
|
|
131
|
+
@Trim()
|
|
132
|
+
@IsString()
|
|
133
|
+
@IsNotEmpty()
|
|
134
|
+
referralId?: string;
|
|
121
135
|
}
|