@fiado/type-kit 3.562.0 → 3.564.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/welcomeBonusRequests.test.ts +1 -1
- package/_test_/unit/retailPromotions/constants.test.ts +1 -1
- package/_test_/unit/retailPromotions/welcomeBonusPromotion.test.ts +34 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +3 -1
- package/bin/retailCustomer/enums/WelcomeBonusAmountSourceEnum.d.ts +3 -1
- package/bin/retailCustomer/enums/WelcomeBonusAmountSourceEnum.js +2 -0
- package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.js +2 -0
- package/bin/retailPromotions/dtos/SalePromotion.d.ts +3 -0
- package/bin/retailPromotions/dtos/responses/WelcomeBonusPromotionResponse.d.ts +6 -0
- package/bin/retailPromotions/dtos/responses/WelcomeBonusPromotionResponse.js +2 -0
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.d.ts +5 -1
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.js +4 -0
- package/bin/retailPromotions/enums/SalePromotionSystemKeyEnum.d.ts +5 -0
- package/bin/retailPromotions/enums/SalePromotionSystemKeyEnum.js +9 -0
- package/bin/retailPromotions/index.d.ts +2 -0
- package/bin/retailPromotions/index.js +2 -0
- package/bin/task-manager-business/dtos/CreateTaskRequest.d.ts +13 -0
- package/bin/task-manager-business/dtos/CreateTaskRequest.js +50 -0
- package/bin/task-manager-business/dtos/ListTasksQuery.d.ts +13 -0
- package/bin/task-manager-business/dtos/ListTasksQuery.js +60 -0
- package/bin/task-manager-business/dtos/MarketingMaterialDetails.d.ts +6 -0
- package/bin/task-manager-business/dtos/MarketingMaterialDetails.js +28 -0
- package/bin/task-manager-business/dtos/TaskResponse.d.ts +27 -0
- package/bin/task-manager-business/dtos/TaskResponse.js +2 -0
- package/bin/task-manager-business/dtos/TaskTransitionResponse.d.ts +11 -0
- package/bin/task-manager-business/dtos/TaskTransitionResponse.js +2 -0
- package/bin/task-manager-business/dtos/TaskTypeDefinitionResponse.d.ts +12 -0
- package/bin/task-manager-business/dtos/TaskTypeDefinitionResponse.js +2 -0
- package/bin/task-manager-business/dtos/TaskTypeQuery.d.ts +5 -0
- package/bin/task-manager-business/dtos/TaskTypeQuery.js +22 -0
- package/bin/task-manager-business/dtos/TransitionTaskRequest.d.ts +8 -0
- package/bin/task-manager-business/dtos/TransitionTaskRequest.js +36 -0
- package/bin/task-manager-business/enums/MarketingMaterialStatus.d.ts +9 -0
- package/bin/task-manager-business/enums/MarketingMaterialStatus.js +13 -0
- package/bin/task-manager-business/enums/MaterialType.d.ts +7 -0
- package/bin/task-manager-business/enums/MaterialType.js +11 -0
- package/bin/task-manager-business/enums/OwnerType.d.ts +4 -0
- package/bin/task-manager-business/enums/OwnerType.js +8 -0
- package/bin/task-manager-business/enums/TaskType.d.ts +4 -0
- package/bin/task-manager-business/enums/TaskType.js +8 -0
- package/bin/task-manager-business/index.d.ts +12 -0
- package/bin/task-manager-business/index.js +30 -0
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/retailCustomer/enums/WelcomeBonusAmountSourceEnum.ts +2 -0
- package/src/retailPromotions/constants/retailPromotionsErrorHttpStatus.ts +2 -0
- package/src/retailPromotions/dtos/SalePromotion.ts +3 -0
- package/src/retailPromotions/dtos/responses/WelcomeBonusPromotionResponse.ts +6 -0
- package/src/retailPromotions/enums/RetailPromotionsErrorCodeEnum.ts +4 -0
- package/src/retailPromotions/enums/SalePromotionSystemKeyEnum.ts +5 -0
- package/src/retailPromotions/index.ts +2 -0
- package/src/task-manager-business/dtos/CreateTaskRequest.ts +30 -0
- package/src/task-manager-business/dtos/ListTasksQuery.ts +40 -0
- package/src/task-manager-business/dtos/MarketingMaterialDetails.ts +13 -0
- package/src/task-manager-business/dtos/TaskResponse.ts +29 -0
- package/src/task-manager-business/dtos/TaskTransitionResponse.ts +11 -0
- package/src/task-manager-business/dtos/TaskTypeDefinitionResponse.ts +13 -0
- package/src/task-manager-business/dtos/TaskTypeQuery.ts +8 -0
- package/src/task-manager-business/dtos/TransitionTaskRequest.ts +19 -0
- package/src/task-manager-business/enums/MarketingMaterialStatus.ts +9 -0
- package/src/task-manager-business/enums/MaterialType.ts +7 -0
- package/src/task-manager-business/enums/OwnerType.ts +4 -0
- package/src/task-manager-business/enums/TaskType.ts +4 -0
- package/src/task-manager-business/index.ts +14 -0
|
@@ -219,6 +219,6 @@ describe('enums del bono de bienvenida', () => {
|
|
|
219
219
|
});
|
|
220
220
|
|
|
221
221
|
it('el origen del monto distingue el parámetro del fallback local', () => {
|
|
222
|
-
expect(Object.values(WelcomeBonusAmountSourceEnum)).toEqual(['PARAM', 'DEFAULT']);
|
|
222
|
+
expect(Object.values(WelcomeBonusAmountSourceEnum)).toEqual(['PARAM', 'DEFAULT', 'SALE_PROMOTION']);
|
|
223
223
|
});
|
|
224
224
|
});
|
|
@@ -43,7 +43,7 @@ describe('catálogo de errores', () => {
|
|
|
43
43
|
expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.CODE_NOT_FOUND).toBe(404);
|
|
44
44
|
expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.DISCOUNT_AFTER_QUOTE).toBe(409);
|
|
45
45
|
expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.CODE_NOT_OWNED).toBe(422);
|
|
46
|
-
expect(Object.keys(RetailPromotionsErrorCodeEnum)).toHaveLength(
|
|
46
|
+
expect(Object.keys(RetailPromotionsErrorCodeEnum)).toHaveLength(34);
|
|
47
47
|
expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.SPLIT_FINANCING_DISABLED).toBe(409);
|
|
48
48
|
});
|
|
49
49
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import {
|
|
3
|
+
RETAIL_PROMOTIONS_ERROR_HTTP_STATUS,
|
|
4
|
+
RetailPromotionsErrorCodeEnum,
|
|
5
|
+
SalePromotion,
|
|
6
|
+
SalePromotionSystemKeyEnum,
|
|
7
|
+
WelcomeBonusPromotionResponse,
|
|
8
|
+
} from '../../../src/retailPromotions/index';
|
|
9
|
+
import { WelcomeBonusAmountSourceEnum } from '../../../src/retailCustomer/index';
|
|
10
|
+
|
|
11
|
+
describe('promo de sistema del bono de bienvenida', () => {
|
|
12
|
+
it('la llave de sistema solo tiene WELCOME_BONUS', () => {
|
|
13
|
+
expect(Object.values(SalePromotionSystemKeyEnum)).toEqual(['WELCOME_BONUS']);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('la promo de venta expone systemKey opcional', () => {
|
|
17
|
+
const systemKey: SalePromotion['systemKey'] = SalePromotionSystemKeyEnum.WELCOME_BONUS;
|
|
18
|
+
expect(systemKey).toBe('WELCOME_BONUS');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('la respuesta privada trae id, estado y monto', () => {
|
|
22
|
+
const response: WelcomeBonusPromotionResponse = { promotionId: 'p', active: true, amountCents: 2500 };
|
|
23
|
+
expect(Object.keys(response)).toEqual(['promotionId', 'active', 'amountCents']);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('los candados de la promo de sistema son 422', () => {
|
|
27
|
+
expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS[RetailPromotionsErrorCodeEnum.SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED]).toBe(422);
|
|
28
|
+
expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS[RetailPromotionsErrorCodeEnum.SYSTEM_PROMOTION_FIELD_LOCKED]).toBe(422);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('el monto del bono puede salir de la promo de venta', () => {
|
|
32
|
+
expect(WelcomeBonusAmountSourceEnum.SALE_PROMOTION).toBe('SALE_PROMOTION');
|
|
33
|
+
});
|
|
34
|
+
});
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -38,7 +38,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.CentralPayments = exports.Helpdesk = exports.FiadoApiResponse = exports.Auth = exports.LegalDocumentsBusiness = exports.Role = exports.STPAccount = exports.RiskProfile = exports.FraudPreventionEngine = exports.BBVARst = exports.Stp = exports.BenefitCenter = exports.FiadoIncFavorite = exports.BankAccount = exports.P2pContact = exports.CreditContract = exports.Contract = exports.ProductCatalog = exports.ContactInfo = exports.TransactionAnalytics = exports.Transaction = exports.TransactionProcessor = exports.GenericMessage = exports.EventBridgeMessage = exports.SessionActivity = exports.MessageMoments = exports.NotificationMessages = exports.ServicePayment = exports.Header = exports.Identity = exports.UserTags = exports.Group = exports.File = exports.ExchangeRate = exports.Directory = exports.Currency = exports.Country = exports.Card = exports.Authentication = exports.AppContent = exports.App = exports.Offices = exports.Places = exports.Address = exports.Beneficiary = exports.Activity = exports.Biometrics = exports.MetamapConnector = exports.Account = exports.Crypto = void 0;
|
|
40
40
|
exports.RetailCards = exports.RetailCatalog = exports.RetailCommission = exports.RetailOrg = exports.EmailVerification = exports.NetworkConnector = exports.Modelias = exports.TotpSecurity = exports.Passport = exports.WalletFunding = exports.Remittance = exports.PlatformRbac = exports.CognitoBackofficeConnector = exports.WhatsappConnector = exports.TwilioConnector = exports.MessagesConnector = exports.Mdm = exports.MilestoneBusiness = exports.CirculoCredito = exports.CreditStatements = exports.Sentry = exports.AiEngine = exports.Funnel = exports.TeamsConnector = exports.PlatformErrorEvents = exports.CustomerFile = exports.CreditBackoffice = exports.CreditDashboard = exports.CreditEngine = exports.Credit = exports.ComissionBusiness = exports.UsMarketGrowthBusiness = exports.ReferralBusiness = exports.ZendeskMessaging = exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = exports.Collector = exports.Pricelist = exports.Company = exports.Services = exports.AccountIssuanceBusiness = exports.AppSelectionData = exports.Device = exports.Observations = exports.IssuanceBusiness = exports.Blacklist = void 0;
|
|
41
|
-
exports.LoanRetailAudit = exports.Rules = exports.PdfRender = exports.DatalakeReports = exports.RewardsEligibility = exports.Rewards = exports.DynamicForm = exports.FileStorage = exports.MoneyTransfer = exports.RetailLoan = exports.Membership = exports.WebhookBusiness = exports.PeopleBusiness = exports.UserConfirmations = exports.Collection = exports.Shipping = exports.PhoneSales = exports.Onboarding = exports.Kyc = exports.LoanScoring = exports.LoanCredit = exports.LoanCollectorAssignment = exports.LoanOfferings = exports.Shortlink = exports.LoanConfig = exports.DatalakeQuery = exports.RetailIntegration = exports.RetailPromotions = exports.RetailWizard = exports.RetailCustomer = void 0;
|
|
41
|
+
exports.TaskManager = exports.LoanRetailAudit = exports.Rules = exports.PdfRender = exports.DatalakeReports = exports.RewardsEligibility = exports.Rewards = exports.DynamicForm = exports.FileStorage = exports.MoneyTransfer = exports.RetailLoan = exports.Membership = exports.WebhookBusiness = exports.PeopleBusiness = exports.UserConfirmations = exports.Collection = exports.Shipping = exports.PhoneSales = exports.Onboarding = exports.Kyc = exports.LoanScoring = exports.LoanCredit = exports.LoanCollectorAssignment = exports.LoanOfferings = exports.Shortlink = exports.LoanConfig = exports.DatalakeQuery = exports.RetailIntegration = exports.RetailPromotions = exports.RetailWizard = exports.RetailCustomer = void 0;
|
|
42
42
|
exports.Crypto = __importStar(require("./crypto"));
|
|
43
43
|
exports.Account = __importStar(require("./account"));
|
|
44
44
|
exports.MetamapConnector = __importStar(require("./metamapConnector"));
|
|
@@ -255,3 +255,5 @@ exports.Rules = __importStar(require("./rules"));
|
|
|
255
255
|
// LoanRetailAudit: contrato del lambda central loan-retail-audit-business (bitácora y accesos a PII
|
|
256
256
|
// de Loan y Retail): mensaje de su cola, POST /private/pii-access-logs y GET /private/audit-trail.
|
|
257
257
|
exports.LoanRetailAudit = __importStar(require("./loanRetailAudit"));
|
|
258
|
+
// TaskManager: DTOs del lambda task-manager-business (gestor genérico de tareas; primer tipo MARKETING_MATERIAL).
|
|
259
|
+
exports.TaskManager = __importStar(require("./task-manager-business"));
|
|
@@ -8,5 +8,7 @@ export declare enum WelcomeBonusAmountSourceEnum {
|
|
|
8
8
|
/** Parámetro de negocio de `loan-config` (`WELCOME_BONUS/amount_cents`). */
|
|
9
9
|
PARAM = "PARAM",
|
|
10
10
|
/** Default local del wizard, usado porque `loan-config` no respondió. */
|
|
11
|
-
DEFAULT = "DEFAULT"
|
|
11
|
+
DEFAULT = "DEFAULT",
|
|
12
|
+
/** Monto de la promo de venta de sistema `WELCOME_BONUS` del retailer. */
|
|
13
|
+
SALE_PROMOTION = "SALE_PROMOTION"
|
|
12
14
|
}
|
|
@@ -13,4 +13,6 @@ var WelcomeBonusAmountSourceEnum;
|
|
|
13
13
|
WelcomeBonusAmountSourceEnum["PARAM"] = "PARAM";
|
|
14
14
|
/** Default local del wizard, usado porque `loan-config` no respondió. */
|
|
15
15
|
WelcomeBonusAmountSourceEnum["DEFAULT"] = "DEFAULT";
|
|
16
|
+
/** Monto de la promo de venta de sistema `WELCOME_BONUS` del retailer. */
|
|
17
|
+
WelcomeBonusAmountSourceEnum["SALE_PROMOTION"] = "SALE_PROMOTION";
|
|
16
18
|
})(WelcomeBonusAmountSourceEnum || (exports.WelcomeBonusAmountSourceEnum = WelcomeBonusAmountSourceEnum = {}));
|
|
@@ -36,4 +36,6 @@ exports.RETAIL_PROMOTIONS_ERROR_HTTP_STATUS = {
|
|
|
36
36
|
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.SPLIT_FINANCING_DISABLED]: 409,
|
|
37
37
|
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.PROMOTION_NOT_STACKABLE]: 422,
|
|
38
38
|
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.PROMOTION_PAYMENT_NOT_ELIGIBLE]: 422,
|
|
39
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED]: 422,
|
|
40
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.SYSTEM_PROMOTION_FIELD_LOCKED]: 422,
|
|
39
41
|
};
|
|
@@ -2,11 +2,14 @@ import { PromotionAppliesToEnum } from '../enums/PromotionAppliesToEnum';
|
|
|
2
2
|
import { PromotionPaymentOptionEnum } from '../enums/PromotionPaymentOptionEnum';
|
|
3
3
|
import { SalePromotionPhaseEnum } from '../enums/SalePromotionPhaseEnum';
|
|
4
4
|
import { SalePromotionStatusEnum } from '../enums/SalePromotionStatusEnum';
|
|
5
|
+
import { SalePromotionSystemKeyEnum } from '../enums/SalePromotionSystemKeyEnum';
|
|
5
6
|
import { SalePromotionLevers, SalePromotionScope, SalePromotionSegmentation } from './SalePromotionLevers';
|
|
6
7
|
/** Promo de venta tal como la devuelve el CRUD. Dinero en centavos, fechas ISO. */
|
|
7
8
|
export interface SalePromotion {
|
|
8
9
|
promotionId: string;
|
|
9
10
|
retailerId: string;
|
|
11
|
+
/** Presente solo en promos sembradas por el sistema; ausente en las del admin. */
|
|
12
|
+
systemKey?: SalePromotionSystemKeyEnum;
|
|
10
13
|
name: string;
|
|
11
14
|
/** Texto que ve el cliente en el wizard. */
|
|
12
15
|
customerText: string;
|
|
@@ -48,5 +48,9 @@ export declare enum RetailPromotionsErrorCodeEnum {
|
|
|
48
48
|
/** La promo no acumulable choca con otra en la misma línea. */
|
|
49
49
|
PROMOTION_NOT_STACKABLE = "PROMOTION_NOT_STACKABLE",
|
|
50
50
|
/** La promo no acepta la forma de pago o el medio de cobro de la venta. */
|
|
51
|
-
PROMOTION_PAYMENT_NOT_ELIGIBLE = "PROMOTION_PAYMENT_NOT_ELIGIBLE"
|
|
51
|
+
PROMOTION_PAYMENT_NOT_ELIGIBLE = "PROMOTION_PAYMENT_NOT_ELIGIBLE",
|
|
52
|
+
/** La promo de sistema solo admite pausar y reanudar. */
|
|
53
|
+
SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED = "SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED",
|
|
54
|
+
/** De la promo de sistema solo se edita el monto del bono. */
|
|
55
|
+
SYSTEM_PROMOTION_FIELD_LOCKED = "SYSTEM_PROMOTION_FIELD_LOCKED"
|
|
52
56
|
}
|
|
@@ -53,4 +53,8 @@ var RetailPromotionsErrorCodeEnum;
|
|
|
53
53
|
RetailPromotionsErrorCodeEnum["PROMOTION_NOT_STACKABLE"] = "PROMOTION_NOT_STACKABLE";
|
|
54
54
|
/** La promo no acepta la forma de pago o el medio de cobro de la venta. */
|
|
55
55
|
RetailPromotionsErrorCodeEnum["PROMOTION_PAYMENT_NOT_ELIGIBLE"] = "PROMOTION_PAYMENT_NOT_ELIGIBLE";
|
|
56
|
+
/** La promo de sistema solo admite pausar y reanudar. */
|
|
57
|
+
RetailPromotionsErrorCodeEnum["SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED"] = "SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED";
|
|
58
|
+
/** De la promo de sistema solo se edita el monto del bono. */
|
|
59
|
+
RetailPromotionsErrorCodeEnum["SYSTEM_PROMOTION_FIELD_LOCKED"] = "SYSTEM_PROMOTION_FIELD_LOCKED";
|
|
56
60
|
})(RetailPromotionsErrorCodeEnum || (exports.RetailPromotionsErrorCodeEnum = RetailPromotionsErrorCodeEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SalePromotionSystemKeyEnum = void 0;
|
|
4
|
+
/** Promos de venta que siembra el sistema; solo se pausan, reanudan o editan su monto. */
|
|
5
|
+
var SalePromotionSystemKeyEnum;
|
|
6
|
+
(function (SalePromotionSystemKeyEnum) {
|
|
7
|
+
/** Bono de bienvenida por apertura de cuenta, una por retailer. */
|
|
8
|
+
SalePromotionSystemKeyEnum["WELCOME_BONUS"] = "WELCOME_BONUS";
|
|
9
|
+
})(SalePromotionSystemKeyEnum || (exports.SalePromotionSystemKeyEnum = SalePromotionSystemKeyEnum = {}));
|
|
@@ -19,6 +19,7 @@ export * from './enums/SaleCouponAvailabilityEnum';
|
|
|
19
19
|
export * from './enums/RetailPromotionsErrorCodeEnum';
|
|
20
20
|
export * from './enums/SalePromotionKindEnum';
|
|
21
21
|
export * from './enums/SkuSalePromotionLookupStatusEnum';
|
|
22
|
+
export * from './enums/SalePromotionSystemKeyEnum';
|
|
22
23
|
export * from './constants/retailPromotionsErrorHttpStatus';
|
|
23
24
|
export * from './constants/salePromotionTransitions';
|
|
24
25
|
export * from './constants/bonusPreMoney';
|
|
@@ -60,3 +61,4 @@ export * from './dtos/responses/WizardSalePromotionResponses';
|
|
|
60
61
|
export * from './dtos/responses/SkuSalePromotionsResponse';
|
|
61
62
|
export * from './dtos/responses/SalePromotionSegmentsResponse';
|
|
62
63
|
export * from './dtos/responses/ActiveSalePromotionsBySkusResponse';
|
|
64
|
+
export * from './dtos/responses/WelcomeBonusPromotionResponse';
|
|
@@ -36,6 +36,7 @@ __exportStar(require("./enums/SaleCouponAvailabilityEnum"), exports);
|
|
|
36
36
|
__exportStar(require("./enums/RetailPromotionsErrorCodeEnum"), exports);
|
|
37
37
|
__exportStar(require("./enums/SalePromotionKindEnum"), exports);
|
|
38
38
|
__exportStar(require("./enums/SkuSalePromotionLookupStatusEnum"), exports);
|
|
39
|
+
__exportStar(require("./enums/SalePromotionSystemKeyEnum"), exports);
|
|
39
40
|
// Constantes y helpers puros
|
|
40
41
|
__exportStar(require("./constants/retailPromotionsErrorHttpStatus"), exports);
|
|
41
42
|
__exportStar(require("./constants/salePromotionTransitions"), exports);
|
|
@@ -82,3 +83,4 @@ __exportStar(require("./dtos/responses/WizardSalePromotionResponses"), exports);
|
|
|
82
83
|
__exportStar(require("./dtos/responses/SkuSalePromotionsResponse"), exports);
|
|
83
84
|
__exportStar(require("./dtos/responses/SalePromotionSegmentsResponse"), exports);
|
|
84
85
|
__exportStar(require("./dtos/responses/ActiveSalePromotionsBySkusResponse"), exports);
|
|
86
|
+
__exportStar(require("./dtos/responses/WelcomeBonusPromotionResponse"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OwnerType } from '../enums/OwnerType';
|
|
2
|
+
import { TaskType } from '../enums/TaskType';
|
|
3
|
+
export declare class TaskOwnerInput {
|
|
4
|
+
type: OwnerType;
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
/** Body de POST /v2/backoffice/tasks. `details` se valida después con el DTO del tipo de tarea. */
|
|
8
|
+
export declare class CreateTaskRequest {
|
|
9
|
+
taskType: TaskType;
|
|
10
|
+
dueDate: string;
|
|
11
|
+
owner: TaskOwnerInput;
|
|
12
|
+
details: Record<string, unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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.CreateTaskRequest = exports.TaskOwnerInput = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const OwnerType_1 = require("../enums/OwnerType");
|
|
16
|
+
const TaskType_1 = require("../enums/TaskType");
|
|
17
|
+
class TaskOwnerInput {
|
|
18
|
+
}
|
|
19
|
+
exports.TaskOwnerInput = TaskOwnerInput;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsEnum)(OwnerType_1.OwnerType),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], TaskOwnerInput.prototype, "type", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.Length)(1, 64),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], TaskOwnerInput.prototype, "id", void 0);
|
|
29
|
+
/** Body de POST /v2/backoffice/tasks. `details` se valida después con el DTO del tipo de tarea. */
|
|
30
|
+
class CreateTaskRequest {
|
|
31
|
+
}
|
|
32
|
+
exports.CreateTaskRequest = CreateTaskRequest;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsEnum)(TaskType_1.TaskType),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CreateTaskRequest.prototype, "taskType", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/, { message: 'dueDate debe tener formato YYYY-MM-DD' }),
|
|
39
|
+
(0, class_validator_1.IsDateString)({ strict: true }, { message: 'dueDate debe ser una fecha válida' }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], CreateTaskRequest.prototype, "dueDate", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.ValidateNested)(),
|
|
44
|
+
(0, class_transformer_1.Type)(() => TaskOwnerInput),
|
|
45
|
+
__metadata("design:type", TaskOwnerInput)
|
|
46
|
+
], CreateTaskRequest.prototype, "owner", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_validator_1.IsObject)(),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], CreateTaskRequest.prototype, "details", void 0);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MaterialType } from '../enums/MaterialType';
|
|
2
|
+
import { OwnerType } from '../enums/OwnerType';
|
|
3
|
+
import { TaskType } from '../enums/TaskType';
|
|
4
|
+
/** Query de GET /v2/backoffice/tasks. Los valores llegan como string desde API Gateway. */
|
|
5
|
+
export declare class ListTasksQuery {
|
|
6
|
+
taskType: TaskType;
|
|
7
|
+
status?: string;
|
|
8
|
+
ownerType?: OwnerType;
|
|
9
|
+
ownerId?: string;
|
|
10
|
+
materialType?: MaterialType;
|
|
11
|
+
overdue?: boolean;
|
|
12
|
+
closedWithinDays?: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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.ListTasksQuery = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const MaterialType_1 = require("../enums/MaterialType");
|
|
16
|
+
const OwnerType_1 = require("../enums/OwnerType");
|
|
17
|
+
const TaskType_1 = require("../enums/TaskType");
|
|
18
|
+
/** Query de GET /v2/backoffice/tasks. Los valores llegan como string desde API Gateway. */
|
|
19
|
+
class ListTasksQuery {
|
|
20
|
+
}
|
|
21
|
+
exports.ListTasksQuery = ListTasksQuery;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsEnum)(TaskType_1.TaskType),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], ListTasksQuery.prototype, "taskType", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.Matches)(/^[A-Z_]{1,32}$/),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ListTasksQuery.prototype, "status", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsEnum)(OwnerType_1.OwnerType),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], ListTasksQuery.prototype, "ownerType", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.IsString)(),
|
|
39
|
+
(0, class_validator_1.Length)(1, 64),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], ListTasksQuery.prototype, "ownerId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsEnum)(MaterialType_1.MaterialType),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], ListTasksQuery.prototype, "materialType", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, class_transformer_1.Transform)(({ value }) => (value === 'true' ? true : value === 'false' ? false : value)),
|
|
50
|
+
(0, class_validator_1.IsBoolean)(),
|
|
51
|
+
__metadata("design:type", Boolean)
|
|
52
|
+
], ListTasksQuery.prototype, "overdue", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
56
|
+
(0, class_validator_1.IsInt)(),
|
|
57
|
+
(0, class_validator_1.Min)(1),
|
|
58
|
+
(0, class_validator_1.Max)(365),
|
|
59
|
+
__metadata("design:type", Number)
|
|
60
|
+
], ListTasksQuery.prototype, "closedWithinDays", void 0);
|
|
@@ -0,0 +1,28 @@
|
|
|
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.MarketingMaterialDetails = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const MaterialType_1 = require("../enums/MaterialType");
|
|
15
|
+
/** `details` de una tarea MARKETING_MATERIAL. */
|
|
16
|
+
class MarketingMaterialDetails {
|
|
17
|
+
}
|
|
18
|
+
exports.MarketingMaterialDetails = MarketingMaterialDetails;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsEnum)(MaterialType_1.MaterialType),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], MarketingMaterialDetails.prototype, "materialType", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.MaxLength)(2000),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], MarketingMaterialDetails.prototype, "description", void 0);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OwnerType } from '../enums/OwnerType';
|
|
2
|
+
import { TaskType } from '../enums/TaskType';
|
|
3
|
+
export interface TaskOwnerResponse {
|
|
4
|
+
type: OwnerType;
|
|
5
|
+
/** directoryId */
|
|
6
|
+
id: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
}
|
|
9
|
+
/** Tarea tal como la devuelve task-manager-business. `overdue` se calcula al leer. */
|
|
10
|
+
export interface TaskResponse {
|
|
11
|
+
taskId: string;
|
|
12
|
+
taskType: TaskType;
|
|
13
|
+
title: string;
|
|
14
|
+
status: string;
|
|
15
|
+
/** YYYY-MM-DD */
|
|
16
|
+
dueDate: string;
|
|
17
|
+
owner: TaskOwnerResponse;
|
|
18
|
+
details: Record<string, unknown>;
|
|
19
|
+
createdBy: string;
|
|
20
|
+
/** ISO 8601 */
|
|
21
|
+
createdAt: string;
|
|
22
|
+
/** ISO 8601 */
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
/** ISO 8601. Solo presente en estados finales. */
|
|
25
|
+
closedAt?: string;
|
|
26
|
+
overdue: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Un cambio de estado del historial. `from` es null en la creación. */
|
|
2
|
+
export interface TaskTransitionResponse {
|
|
3
|
+
from: string | null;
|
|
4
|
+
to: string;
|
|
5
|
+
/** ISO 8601 */
|
|
6
|
+
at: string;
|
|
7
|
+
by: string;
|
|
8
|
+
reason?: string;
|
|
9
|
+
/** false si la transición se registró pero la tarea no llegó a moverse (intento incompleto). */
|
|
10
|
+
complete: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OwnerType } from '../enums/OwnerType';
|
|
2
|
+
import { TaskType } from '../enums/TaskType';
|
|
3
|
+
/** Definición de un tipo de tarea, para que el backoffice pinte estados y botones. */
|
|
4
|
+
export interface TaskTypeDefinitionResponse {
|
|
5
|
+
taskType: TaskType;
|
|
6
|
+
ownerType: OwnerType;
|
|
7
|
+
statuses: string[];
|
|
8
|
+
initialStatus: string;
|
|
9
|
+
finalStatuses: string[];
|
|
10
|
+
transitions: Record<string, string[]>;
|
|
11
|
+
reasonRequiredFor: string[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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.TaskTypeQuery = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const TaskType_1 = require("../enums/TaskType");
|
|
15
|
+
/** Query `?taskType=` de las rutas por id (detalle e historial). */
|
|
16
|
+
class TaskTypeQuery {
|
|
17
|
+
}
|
|
18
|
+
exports.TaskTypeQuery = TaskTypeQuery;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsEnum)(TaskType_1.TaskType),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], TaskTypeQuery.prototype, "taskType", void 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TaskType } from '../enums/TaskType';
|
|
2
|
+
/** Body de POST /v2/backoffice/tasks/{taskId}/transitions. `from` = estado que el usuario estaba viendo. */
|
|
3
|
+
export declare class TransitionTaskRequest {
|
|
4
|
+
taskType: TaskType;
|
|
5
|
+
from: string;
|
|
6
|
+
to: string;
|
|
7
|
+
reason?: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.TransitionTaskRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const TaskType_1 = require("../enums/TaskType");
|
|
15
|
+
/** Body de POST /v2/backoffice/tasks/{taskId}/transitions. `from` = estado que el usuario estaba viendo. */
|
|
16
|
+
class TransitionTaskRequest {
|
|
17
|
+
}
|
|
18
|
+
exports.TransitionTaskRequest = TransitionTaskRequest;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsEnum)(TaskType_1.TaskType),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], TransitionTaskRequest.prototype, "taskType", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.Matches)(/^[A-Z_]{1,32}$/),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], TransitionTaskRequest.prototype, "from", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.Matches)(/^[A-Z_]{1,32}$/),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], TransitionTaskRequest.prototype, "to", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.MaxLength)(500),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], TransitionTaskRequest.prototype, "reason", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Estados del flujo MARKETING_MATERIAL. ARRIVED y CANCELLED son finales. */
|
|
2
|
+
export declare enum MarketingMaterialStatus {
|
|
3
|
+
PROMISED = "PROMISED",
|
|
4
|
+
DESIGN = "DESIGN",
|
|
5
|
+
IN_PRODUCTION = "IN_PRODUCTION",
|
|
6
|
+
SHIPPED = "SHIPPED",
|
|
7
|
+
ARRIVED = "ARRIVED",
|
|
8
|
+
CANCELLED = "CANCELLED"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MarketingMaterialStatus = void 0;
|
|
4
|
+
/** Estados del flujo MARKETING_MATERIAL. ARRIVED y CANCELLED son finales. */
|
|
5
|
+
var MarketingMaterialStatus;
|
|
6
|
+
(function (MarketingMaterialStatus) {
|
|
7
|
+
MarketingMaterialStatus["PROMISED"] = "PROMISED";
|
|
8
|
+
MarketingMaterialStatus["DESIGN"] = "DESIGN";
|
|
9
|
+
MarketingMaterialStatus["IN_PRODUCTION"] = "IN_PRODUCTION";
|
|
10
|
+
MarketingMaterialStatus["SHIPPED"] = "SHIPPED";
|
|
11
|
+
MarketingMaterialStatus["ARRIVED"] = "ARRIVED";
|
|
12
|
+
MarketingMaterialStatus["CANCELLED"] = "CANCELLED";
|
|
13
|
+
})(MarketingMaterialStatus || (exports.MarketingMaterialStatus = MarketingMaterialStatus = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MaterialType = void 0;
|
|
4
|
+
/** Materiales de marketing que se prometen a un promotor. OTHER + descripción cubre lo no listado. */
|
|
5
|
+
var MaterialType;
|
|
6
|
+
(function (MaterialType) {
|
|
7
|
+
MaterialType["PLASTIC_CARD"] = "PLASTIC_CARD";
|
|
8
|
+
MaterialType["REEL"] = "REEL";
|
|
9
|
+
MaterialType["DIGITAL_AD"] = "DIGITAL_AD";
|
|
10
|
+
MaterialType["OTHER"] = "OTHER";
|
|
11
|
+
})(MaterialType || (exports.MaterialType = MaterialType = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OwnerType = void 0;
|
|
4
|
+
/** Para quién es la tarea. El id del dueño es su directoryId. */
|
|
5
|
+
var OwnerType;
|
|
6
|
+
(function (OwnerType) {
|
|
7
|
+
OwnerType["PROMOTER"] = "PROMOTER";
|
|
8
|
+
})(OwnerType || (exports.OwnerType = OwnerType = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskType = void 0;
|
|
4
|
+
/** Tipos de tarea de task-manager-business. Cada uno tiene su TaskTypeDefinition en el lambda. */
|
|
5
|
+
var TaskType;
|
|
6
|
+
(function (TaskType) {
|
|
7
|
+
TaskType["MARKETING_MATERIAL"] = "MARKETING_MATERIAL";
|
|
8
|
+
})(TaskType || (exports.TaskType = TaskType = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './enums/TaskType';
|
|
2
|
+
export * from './enums/OwnerType';
|
|
3
|
+
export * from './enums/MaterialType';
|
|
4
|
+
export * from './enums/MarketingMaterialStatus';
|
|
5
|
+
export * from './dtos/CreateTaskRequest';
|
|
6
|
+
export * from './dtos/TransitionTaskRequest';
|
|
7
|
+
export * from './dtos/ListTasksQuery';
|
|
8
|
+
export * from './dtos/TaskTypeQuery';
|
|
9
|
+
export * from './dtos/MarketingMaterialDetails';
|
|
10
|
+
export * from './dtos/TaskResponse';
|
|
11
|
+
export * from './dtos/TaskTransitionResponse';
|
|
12
|
+
export * from './dtos/TaskTypeDefinitionResponse';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
//enums
|
|
18
|
+
__exportStar(require("./enums/TaskType"), exports);
|
|
19
|
+
__exportStar(require("./enums/OwnerType"), exports);
|
|
20
|
+
__exportStar(require("./enums/MaterialType"), exports);
|
|
21
|
+
__exportStar(require("./enums/MarketingMaterialStatus"), exports);
|
|
22
|
+
//dtos
|
|
23
|
+
__exportStar(require("./dtos/CreateTaskRequest"), exports);
|
|
24
|
+
__exportStar(require("./dtos/TransitionTaskRequest"), exports);
|
|
25
|
+
__exportStar(require("./dtos/ListTasksQuery"), exports);
|
|
26
|
+
__exportStar(require("./dtos/TaskTypeQuery"), exports);
|
|
27
|
+
__exportStar(require("./dtos/MarketingMaterialDetails"), exports);
|
|
28
|
+
__exportStar(require("./dtos/TaskResponse"), exports);
|
|
29
|
+
__exportStar(require("./dtos/TaskTransitionResponse"), exports);
|
|
30
|
+
__exportStar(require("./dtos/TaskTypeDefinitionResponse"), exports);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -221,3 +221,6 @@ export * as Rules from './rules';
|
|
|
221
221
|
// LoanRetailAudit: contrato del lambda central loan-retail-audit-business (bitácora y accesos a PII
|
|
222
222
|
// de Loan y Retail): mensaje de su cola, POST /private/pii-access-logs y GET /private/audit-trail.
|
|
223
223
|
export * as LoanRetailAudit from './loanRetailAudit';
|
|
224
|
+
|
|
225
|
+
// TaskManager: DTOs del lambda task-manager-business (gestor genérico de tareas; primer tipo MARKETING_MATERIAL).
|
|
226
|
+
export * as TaskManager from './task-manager-business';
|
|
@@ -9,4 +9,6 @@ export enum WelcomeBonusAmountSourceEnum {
|
|
|
9
9
|
PARAM = 'PARAM',
|
|
10
10
|
/** Default local del wizard, usado porque `loan-config` no respondió. */
|
|
11
11
|
DEFAULT = 'DEFAULT',
|
|
12
|
+
/** Monto de la promo de venta de sistema `WELCOME_BONUS` del retailer. */
|
|
13
|
+
SALE_PROMOTION = 'SALE_PROMOTION',
|
|
12
14
|
}
|
|
@@ -34,4 +34,6 @@ export const RETAIL_PROMOTIONS_ERROR_HTTP_STATUS: Readonly<Record<C, 400 | 403 |
|
|
|
34
34
|
[C.SPLIT_FINANCING_DISABLED]: 409,
|
|
35
35
|
[C.PROMOTION_NOT_STACKABLE]: 422,
|
|
36
36
|
[C.PROMOTION_PAYMENT_NOT_ELIGIBLE]: 422,
|
|
37
|
+
[C.SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED]: 422,
|
|
38
|
+
[C.SYSTEM_PROMOTION_FIELD_LOCKED]: 422,
|
|
37
39
|
};
|
|
@@ -2,12 +2,15 @@ import { PromotionAppliesToEnum } from '../enums/PromotionAppliesToEnum';
|
|
|
2
2
|
import { PromotionPaymentOptionEnum } from '../enums/PromotionPaymentOptionEnum';
|
|
3
3
|
import { SalePromotionPhaseEnum } from '../enums/SalePromotionPhaseEnum';
|
|
4
4
|
import { SalePromotionStatusEnum } from '../enums/SalePromotionStatusEnum';
|
|
5
|
+
import { SalePromotionSystemKeyEnum } from '../enums/SalePromotionSystemKeyEnum';
|
|
5
6
|
import { SalePromotionLevers, SalePromotionScope, SalePromotionSegmentation } from './SalePromotionLevers';
|
|
6
7
|
|
|
7
8
|
/** Promo de venta tal como la devuelve el CRUD. Dinero en centavos, fechas ISO. */
|
|
8
9
|
export interface SalePromotion {
|
|
9
10
|
promotionId: string;
|
|
10
11
|
retailerId: string;
|
|
12
|
+
/** Presente solo en promos sembradas por el sistema; ausente en las del admin. */
|
|
13
|
+
systemKey?: SalePromotionSystemKeyEnum;
|
|
11
14
|
name: string;
|
|
12
15
|
/** Texto que ve el cliente en el wizard. */
|
|
13
16
|
customerText: string;
|
|
@@ -49,4 +49,8 @@ export enum RetailPromotionsErrorCodeEnum {
|
|
|
49
49
|
PROMOTION_NOT_STACKABLE = 'PROMOTION_NOT_STACKABLE',
|
|
50
50
|
/** La promo no acepta la forma de pago o el medio de cobro de la venta. */
|
|
51
51
|
PROMOTION_PAYMENT_NOT_ELIGIBLE = 'PROMOTION_PAYMENT_NOT_ELIGIBLE',
|
|
52
|
+
/** La promo de sistema solo admite pausar y reanudar. */
|
|
53
|
+
SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED = 'SYSTEM_PROMOTION_TRANSITION_NOT_ALLOWED',
|
|
54
|
+
/** De la promo de sistema solo se edita el monto del bono. */
|
|
55
|
+
SYSTEM_PROMOTION_FIELD_LOCKED = 'SYSTEM_PROMOTION_FIELD_LOCKED',
|
|
52
56
|
}
|
|
@@ -20,6 +20,7 @@ export * from './enums/SaleCouponAvailabilityEnum';
|
|
|
20
20
|
export * from './enums/RetailPromotionsErrorCodeEnum';
|
|
21
21
|
export * from './enums/SalePromotionKindEnum';
|
|
22
22
|
export * from './enums/SkuSalePromotionLookupStatusEnum';
|
|
23
|
+
export * from './enums/SalePromotionSystemKeyEnum';
|
|
23
24
|
|
|
24
25
|
// Constantes y helpers puros
|
|
25
26
|
export * from './constants/retailPromotionsErrorHttpStatus';
|
|
@@ -71,3 +72,4 @@ export * from './dtos/responses/WizardSalePromotionResponses';
|
|
|
71
72
|
export * from './dtos/responses/SkuSalePromotionsResponse';
|
|
72
73
|
export * from './dtos/responses/SalePromotionSegmentsResponse';
|
|
73
74
|
export * from './dtos/responses/ActiveSalePromotionsBySkusResponse';
|
|
75
|
+
export * from './dtos/responses/WelcomeBonusPromotionResponse';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { IsDateString, IsEnum, IsObject, IsString, Length, Matches, ValidateNested } from 'class-validator';
|
|
3
|
+
import { OwnerType } from '../enums/OwnerType';
|
|
4
|
+
import { TaskType } from '../enums/TaskType';
|
|
5
|
+
|
|
6
|
+
export class TaskOwnerInput {
|
|
7
|
+
@IsEnum(OwnerType)
|
|
8
|
+
type: OwnerType;
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
@Length(1, 64)
|
|
12
|
+
id: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Body de POST /v2/backoffice/tasks. `details` se valida después con el DTO del tipo de tarea. */
|
|
16
|
+
export class CreateTaskRequest {
|
|
17
|
+
@IsEnum(TaskType)
|
|
18
|
+
taskType: TaskType;
|
|
19
|
+
|
|
20
|
+
@Matches(/^\d{4}-\d{2}-\d{2}$/, { message: 'dueDate debe tener formato YYYY-MM-DD' })
|
|
21
|
+
@IsDateString({ strict: true }, { message: 'dueDate debe ser una fecha válida' })
|
|
22
|
+
dueDate: string;
|
|
23
|
+
|
|
24
|
+
@ValidateNested()
|
|
25
|
+
@Type(() => TaskOwnerInput)
|
|
26
|
+
owner: TaskOwnerInput;
|
|
27
|
+
|
|
28
|
+
@IsObject()
|
|
29
|
+
details: Record<string, unknown>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Transform, Type } from 'class-transformer';
|
|
2
|
+
import { IsBoolean, IsEnum, IsInt, IsOptional, IsString, Length, Matches, Max, Min } from 'class-validator';
|
|
3
|
+
import { MaterialType } from '../enums/MaterialType';
|
|
4
|
+
import { OwnerType } from '../enums/OwnerType';
|
|
5
|
+
import { TaskType } from '../enums/TaskType';
|
|
6
|
+
|
|
7
|
+
/** Query de GET /v2/backoffice/tasks. Los valores llegan como string desde API Gateway. */
|
|
8
|
+
export class ListTasksQuery {
|
|
9
|
+
@IsEnum(TaskType)
|
|
10
|
+
taskType: TaskType;
|
|
11
|
+
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@Matches(/^[A-Z_]{1,32}$/)
|
|
14
|
+
status?: string;
|
|
15
|
+
|
|
16
|
+
@IsOptional()
|
|
17
|
+
@IsEnum(OwnerType)
|
|
18
|
+
ownerType?: OwnerType;
|
|
19
|
+
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsString()
|
|
22
|
+
@Length(1, 64)
|
|
23
|
+
ownerId?: string;
|
|
24
|
+
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@IsEnum(MaterialType)
|
|
27
|
+
materialType?: MaterialType;
|
|
28
|
+
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@Transform(({ value }) => (value === 'true' ? true : value === 'false' ? false : value))
|
|
31
|
+
@IsBoolean()
|
|
32
|
+
overdue?: boolean;
|
|
33
|
+
|
|
34
|
+
@IsOptional()
|
|
35
|
+
@Type(() => Number)
|
|
36
|
+
@IsInt()
|
|
37
|
+
@Min(1)
|
|
38
|
+
@Max(365)
|
|
39
|
+
closedWithinDays?: number;
|
|
40
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IsEnum, IsOptional, IsString, MaxLength } from 'class-validator';
|
|
2
|
+
import { MaterialType } from '../enums/MaterialType';
|
|
3
|
+
|
|
4
|
+
/** `details` de una tarea MARKETING_MATERIAL. */
|
|
5
|
+
export class MarketingMaterialDetails {
|
|
6
|
+
@IsEnum(MaterialType)
|
|
7
|
+
materialType: MaterialType;
|
|
8
|
+
|
|
9
|
+
@IsOptional()
|
|
10
|
+
@IsString()
|
|
11
|
+
@MaxLength(2000)
|
|
12
|
+
description?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OwnerType } from '../enums/OwnerType';
|
|
2
|
+
import { TaskType } from '../enums/TaskType';
|
|
3
|
+
|
|
4
|
+
export interface TaskOwnerResponse {
|
|
5
|
+
type: OwnerType;
|
|
6
|
+
/** directoryId */
|
|
7
|
+
id: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Tarea tal como la devuelve task-manager-business. `overdue` se calcula al leer. */
|
|
12
|
+
export interface TaskResponse {
|
|
13
|
+
taskId: string;
|
|
14
|
+
taskType: TaskType;
|
|
15
|
+
title: string;
|
|
16
|
+
status: string;
|
|
17
|
+
/** YYYY-MM-DD */
|
|
18
|
+
dueDate: string;
|
|
19
|
+
owner: TaskOwnerResponse;
|
|
20
|
+
details: Record<string, unknown>;
|
|
21
|
+
createdBy: string;
|
|
22
|
+
/** ISO 8601 */
|
|
23
|
+
createdAt: string;
|
|
24
|
+
/** ISO 8601 */
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
/** ISO 8601. Solo presente en estados finales. */
|
|
27
|
+
closedAt?: string;
|
|
28
|
+
overdue: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Un cambio de estado del historial. `from` es null en la creación. */
|
|
2
|
+
export interface TaskTransitionResponse {
|
|
3
|
+
from: string | null;
|
|
4
|
+
to: string;
|
|
5
|
+
/** ISO 8601 */
|
|
6
|
+
at: string;
|
|
7
|
+
by: string;
|
|
8
|
+
reason?: string;
|
|
9
|
+
/** false si la transición se registró pero la tarea no llegó a moverse (intento incompleto). */
|
|
10
|
+
complete: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OwnerType } from '../enums/OwnerType';
|
|
2
|
+
import { TaskType } from '../enums/TaskType';
|
|
3
|
+
|
|
4
|
+
/** Definición de un tipo de tarea, para que el backoffice pinte estados y botones. */
|
|
5
|
+
export interface TaskTypeDefinitionResponse {
|
|
6
|
+
taskType: TaskType;
|
|
7
|
+
ownerType: OwnerType;
|
|
8
|
+
statuses: string[];
|
|
9
|
+
initialStatus: string;
|
|
10
|
+
finalStatuses: string[];
|
|
11
|
+
transitions: Record<string, string[]>;
|
|
12
|
+
reasonRequiredFor: string[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IsEnum, IsOptional, IsString, Matches, MaxLength } from 'class-validator';
|
|
2
|
+
import { TaskType } from '../enums/TaskType';
|
|
3
|
+
|
|
4
|
+
/** Body de POST /v2/backoffice/tasks/{taskId}/transitions. `from` = estado que el usuario estaba viendo. */
|
|
5
|
+
export class TransitionTaskRequest {
|
|
6
|
+
@IsEnum(TaskType)
|
|
7
|
+
taskType: TaskType;
|
|
8
|
+
|
|
9
|
+
@Matches(/^[A-Z_]{1,32}$/)
|
|
10
|
+
from: string;
|
|
11
|
+
|
|
12
|
+
@Matches(/^[A-Z_]{1,32}$/)
|
|
13
|
+
to: string;
|
|
14
|
+
|
|
15
|
+
@IsOptional()
|
|
16
|
+
@IsString()
|
|
17
|
+
@MaxLength(500)
|
|
18
|
+
reason?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Estados del flujo MARKETING_MATERIAL. ARRIVED y CANCELLED son finales. */
|
|
2
|
+
export enum MarketingMaterialStatus {
|
|
3
|
+
PROMISED = 'PROMISED',
|
|
4
|
+
DESIGN = 'DESIGN',
|
|
5
|
+
IN_PRODUCTION = 'IN_PRODUCTION',
|
|
6
|
+
SHIPPED = 'SHIPPED',
|
|
7
|
+
ARRIVED = 'ARRIVED',
|
|
8
|
+
CANCELLED = 'CANCELLED',
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//enums
|
|
2
|
+
export * from './enums/TaskType';
|
|
3
|
+
export * from './enums/OwnerType';
|
|
4
|
+
export * from './enums/MaterialType';
|
|
5
|
+
export * from './enums/MarketingMaterialStatus';
|
|
6
|
+
//dtos
|
|
7
|
+
export * from './dtos/CreateTaskRequest';
|
|
8
|
+
export * from './dtos/TransitionTaskRequest';
|
|
9
|
+
export * from './dtos/ListTasksQuery';
|
|
10
|
+
export * from './dtos/TaskTypeQuery';
|
|
11
|
+
export * from './dtos/MarketingMaterialDetails';
|
|
12
|
+
export * from './dtos/TaskResponse';
|
|
13
|
+
export * from './dtos/TaskTransitionResponse';
|
|
14
|
+
export * from './dtos/TaskTypeDefinitionResponse';
|