@fiado/type-kit 3.561.0 → 3.563.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/directDeposit/directDepositDtos.test.ts +38 -0
- package/_test_/unit/pdfGenerator/pdfGeneratorDtos.test.ts +29 -0
- package/bin/directDeposit/dtos/DirectDepositFormatResponse.d.ts +4 -0
- package/bin/directDeposit/dtos/DirectDepositFormatResponse.js +7 -0
- package/bin/directDeposit/dtos/GetDirectDepositFormatByDirectoryRequest.d.ts +6 -0
- package/bin/directDeposit/dtos/GetDirectDepositFormatByDirectoryRequest.js +31 -0
- package/bin/directDeposit/dtos/GetDirectDepositFormatRequest.d.ts +5 -0
- package/bin/directDeposit/dtos/GetDirectDepositFormatRequest.js +26 -0
- package/bin/directDeposit/index.d.ts +3 -0
- package/bin/directDeposit/index.js +20 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +3 -1
- package/bin/pdfGenerator/dtos/PdfGeneratorPageConfig.d.ts +28 -0
- package/bin/pdfGenerator/dtos/PdfGeneratorPageConfig.js +14 -0
- package/bin/pdfGenerator/dtos/PdfGeneratorRequest.d.ts +9 -0
- package/bin/pdfGenerator/dtos/PdfGeneratorRequest.js +33 -0
- package/bin/pdfGenerator/dtos/PdfGeneratorResponse.d.ts +4 -0
- package/bin/pdfGenerator/dtos/PdfGeneratorResponse.js +7 -0
- package/bin/pdfGenerator/index.d.ts +3 -0
- package/bin/pdfGenerator/index.js +20 -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/directDeposit/dtos/DirectDepositFormatResponse.ts +4 -0
- package/src/directDeposit/dtos/GetDirectDepositFormatByDirectoryRequest.ts +12 -0
- package/src/directDeposit/dtos/GetDirectDepositFormatRequest.ts +9 -0
- package/src/directDeposit/index.ts +4 -0
- package/src/index.ts +3 -0
- package/src/pdfGenerator/dtos/PdfGeneratorPageConfig.ts +22 -0
- package/src/pdfGenerator/dtos/PdfGeneratorRequest.ts +16 -0
- package/src/pdfGenerator/dtos/PdfGeneratorResponse.ts +4 -0
- package/src/pdfGenerator/index.ts +4 -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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validate } from 'class-validator';
|
|
4
|
+
import { GetDirectDepositFormatByDirectoryRequest, GetDirectDepositFormatRequest } from '../../../src/directDeposit';
|
|
5
|
+
|
|
6
|
+
const parse = async <T extends object>(cls: new () => T, query: unknown) => {
|
|
7
|
+
const instance = plainToInstance(cls, query);
|
|
8
|
+
const errors = (await validate(instance as object, { whitelist: true })).map(e => e.property);
|
|
9
|
+
return { instance, errors };
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
describe('GetDirectDepositFormatRequest (app: el directoryId sale del token)', () => {
|
|
13
|
+
it('convierte percentage de string (query) a número', async () => {
|
|
14
|
+
const { instance, errors } = await parse(GetDirectDepositFormatRequest, { percentage: '50' });
|
|
15
|
+
expect(errors).toEqual([]);
|
|
16
|
+
expect(instance.percentage).toBe(50);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('percentage es opcional', async () => {
|
|
20
|
+
expect((await parse(GetDirectDepositFormatRequest, {})).errors).toEqual([]);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it.each(['0', '101', '12.5', 'abc'])('rechaza percentage=%s', async (percentage) => {
|
|
24
|
+
expect((await parse(GetDirectDepositFormatRequest, { percentage })).errors).toEqual(['percentage']);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe('GetDirectDepositFormatByDirectoryRequest (agentes y backoffice)', () => {
|
|
29
|
+
it('acepta directoryId con percentage', async () => {
|
|
30
|
+
const { instance, errors } = await parse(GetDirectDepositFormatByDirectoryRequest, { directoryId: 'dir-1', percentage: '30' });
|
|
31
|
+
expect(errors).toEqual([]);
|
|
32
|
+
expect(instance.percentage).toBe(30);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it.each([[{}], [{ directoryId: '' }]])('directoryId es obligatorio (%j)', async (query) => {
|
|
36
|
+
expect((await parse(GetDirectDepositFormatByDirectoryRequest, query)).errors).toEqual(['directoryId']);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validate } from 'class-validator';
|
|
4
|
+
import { PdfGeneratorRequest } from '../../../src/pdfGenerator';
|
|
5
|
+
|
|
6
|
+
const errorsOf = async (body: unknown) =>
|
|
7
|
+
(await validate(plainToInstance(PdfGeneratorRequest, body) as object, { whitelist: true })).map(e => e.property);
|
|
8
|
+
|
|
9
|
+
describe('pdfGenerator DTOs', () => {
|
|
10
|
+
it('acepta html con page y provider', async () => {
|
|
11
|
+
expect(await errorsOf({
|
|
12
|
+
html: '<p>x</p>',
|
|
13
|
+
page: { size: 'A4', margin: { top: '45pt', right: '45pt', bottom: '45pt', left: '45pt' } },
|
|
14
|
+
provider: 'pdflib',
|
|
15
|
+
})).toEqual([]);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('acepta solo html', async () => {
|
|
19
|
+
expect(await errorsOf({ html: '<p>x</p>' })).toEqual([]);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('rechaza html vacío y provider desconocido', async () => {
|
|
23
|
+
expect((await errorsOf({ html: '', provider: 'chrome' })).sort()).toEqual(['html', 'provider']);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('rechaza page que no es objeto', async () => {
|
|
27
|
+
expect(await errorsOf({ html: '<p>x</p>', page: 'A4' })).toEqual(['page']);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DirectDepositFormatResponse = void 0;
|
|
4
|
+
/** `data` de la respuesta: el PDF del formato Direct Deposit en base64. */
|
|
5
|
+
class DirectDepositFormatResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.DirectDepositFormatResponse = DirectDepositFormatResponse;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Query de GET /agents/direct-deposit y /backoffice/direct-deposit (+ /v2): formato de un tercero. */
|
|
2
|
+
export declare class GetDirectDepositFormatByDirectoryRequest {
|
|
3
|
+
directoryId: string;
|
|
4
|
+
/** Porcentaje del cheque a depositar (1–100). Default 100. */
|
|
5
|
+
percentage?: number;
|
|
6
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.GetDirectDepositFormatByDirectoryRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/** Query de GET /agents/direct-deposit y /backoffice/direct-deposit (+ /v2): formato de un tercero. */
|
|
16
|
+
class GetDirectDepositFormatByDirectoryRequest {
|
|
17
|
+
}
|
|
18
|
+
exports.GetDirectDepositFormatByDirectoryRequest = GetDirectDepositFormatByDirectoryRequest;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], GetDirectDepositFormatByDirectoryRequest.prototype, "directoryId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
27
|
+
(0, class_validator_1.IsInt)(),
|
|
28
|
+
(0, class_validator_1.Min)(1),
|
|
29
|
+
(0, class_validator_1.Max)(100),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], GetDirectDepositFormatByDirectoryRequest.prototype, "percentage", void 0);
|
|
@@ -0,0 +1,26 @@
|
|
|
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.GetDirectDepositFormatRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/** Query de GET /direct-deposit (app) de direct-deposit-export-business. El directoryId sale del token. */
|
|
16
|
+
class GetDirectDepositFormatRequest {
|
|
17
|
+
}
|
|
18
|
+
exports.GetDirectDepositFormatRequest = GetDirectDepositFormatRequest;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsOptional)(),
|
|
21
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
22
|
+
(0, class_validator_1.IsInt)(),
|
|
23
|
+
(0, class_validator_1.Min)(1),
|
|
24
|
+
(0, class_validator_1.Max)(100),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], GetDirectDepositFormatRequest.prototype, "percentage", void 0);
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
//dtos
|
|
18
|
+
__exportStar(require("./dtos/GetDirectDepositFormatRequest"), exports);
|
|
19
|
+
__exportStar(require("./dtos/GetDirectDepositFormatByDirectoryRequest"), exports);
|
|
20
|
+
__exportStar(require("./dtos/DirectDepositFormatResponse"), exports);
|
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"));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Tamaño nombrado o personalizado en puntos PDF (1pt = 1/72in). */
|
|
2
|
+
export type PdfGeneratorPageSize = 'LETTER' | 'A4' | 'LEGAL' | {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
6
|
+
/** Texto por página en el margen; acepta los tokens {page} y {pages}. */
|
|
7
|
+
export declare class PdfGeneratorPageBoxText {
|
|
8
|
+
left?: string;
|
|
9
|
+
center?: string;
|
|
10
|
+
right?: string;
|
|
11
|
+
fontSize?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Configuración de hoja de pdf-generator-business. Las longitudes de margen llevan unidad
|
|
15
|
+
* (mm, cm, in, pt, px). Sin `page`, el lambda usa el @page de la plantilla o A4 con 2 mm.
|
|
16
|
+
*/
|
|
17
|
+
export declare class PdfGeneratorPageConfig {
|
|
18
|
+
size?: PdfGeneratorPageSize;
|
|
19
|
+
orientation?: 'portrait' | 'landscape';
|
|
20
|
+
margin?: {
|
|
21
|
+
top?: string;
|
|
22
|
+
right?: string;
|
|
23
|
+
bottom?: string;
|
|
24
|
+
left?: string;
|
|
25
|
+
};
|
|
26
|
+
header?: PdfGeneratorPageBoxText;
|
|
27
|
+
footer?: PdfGeneratorPageBoxText;
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PdfGeneratorPageConfig = exports.PdfGeneratorPageBoxText = void 0;
|
|
4
|
+
/** Texto por página en el margen; acepta los tokens {page} y {pages}. */
|
|
5
|
+
class PdfGeneratorPageBoxText {
|
|
6
|
+
}
|
|
7
|
+
exports.PdfGeneratorPageBoxText = PdfGeneratorPageBoxText;
|
|
8
|
+
/**
|
|
9
|
+
* Configuración de hoja de pdf-generator-business. Las longitudes de margen llevan unidad
|
|
10
|
+
* (mm, cm, in, pt, px). Sin `page`, el lambda usa el @page de la plantilla o A4 con 2 mm.
|
|
11
|
+
*/
|
|
12
|
+
class PdfGeneratorPageConfig {
|
|
13
|
+
}
|
|
14
|
+
exports.PdfGeneratorPageConfig = PdfGeneratorPageConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PdfGeneratorPageConfig } from './PdfGeneratorPageConfig';
|
|
2
|
+
/** POST /generate-pdf de pdf-generator-business: HTML ya armado → PDF en base64. */
|
|
3
|
+
export declare class PdfGeneratorRequest {
|
|
4
|
+
html: string;
|
|
5
|
+
/** La valida a fondo el propio lambda (400 con el campo que falla). */
|
|
6
|
+
page?: PdfGeneratorPageConfig;
|
|
7
|
+
/** Override del motor para este request (default del lambda: pdflib). */
|
|
8
|
+
provider?: 'pdflib' | 'puppeteer';
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.PdfGeneratorRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const PdfGeneratorPageConfig_1 = require("./PdfGeneratorPageConfig");
|
|
15
|
+
/** POST /generate-pdf de pdf-generator-business: HTML ya armado → PDF en base64. */
|
|
16
|
+
class PdfGeneratorRequest {
|
|
17
|
+
}
|
|
18
|
+
exports.PdfGeneratorRequest = PdfGeneratorRequest;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], PdfGeneratorRequest.prototype, "html", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
(0, class_validator_1.IsObject)(),
|
|
27
|
+
__metadata("design:type", PdfGeneratorPageConfig_1.PdfGeneratorPageConfig)
|
|
28
|
+
], PdfGeneratorRequest.prototype, "page", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsOptional)(),
|
|
31
|
+
(0, class_validator_1.IsIn)(['pdflib', 'puppeteer']),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], PdfGeneratorRequest.prototype, "provider", void 0);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PdfGeneratorResponse = void 0;
|
|
4
|
+
/** Respuesta de POST /generate-pdf. El header X-Pdf-Provider indica el motor usado. */
|
|
5
|
+
class PdfGeneratorResponse {
|
|
6
|
+
}
|
|
7
|
+
exports.PdfGeneratorResponse = PdfGeneratorResponse;
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
//dtos
|
|
18
|
+
__exportStar(require("./dtos/PdfGeneratorPageConfig"), exports);
|
|
19
|
+
__exportStar(require("./dtos/PdfGeneratorRequest"), exports);
|
|
20
|
+
__exportStar(require("./dtos/PdfGeneratorResponse"), 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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { IsInt, IsNotEmpty, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Query de GET /agents/direct-deposit y /backoffice/direct-deposit (+ /v2): formato de un tercero. */
|
|
5
|
+
export class GetDirectDepositFormatByDirectoryRequest {
|
|
6
|
+
@IsString() @IsNotEmpty()
|
|
7
|
+
directoryId!: string;
|
|
8
|
+
|
|
9
|
+
/** Porcentaje del cheque a depositar (1–100). Default 100. */
|
|
10
|
+
@IsOptional() @Type(() => Number) @IsInt() @Min(1) @Max(100)
|
|
11
|
+
percentage?: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { IsInt, IsOptional, Max, Min } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** Query de GET /direct-deposit (app) de direct-deposit-export-business. El directoryId sale del token. */
|
|
5
|
+
export class GetDirectDepositFormatRequest {
|
|
6
|
+
/** Porcentaje del cheque a depositar (1–100). Default 100. */
|
|
7
|
+
@IsOptional() @Type(() => Number) @IsInt() @Min(1) @Max(100)
|
|
8
|
+
percentage?: number;
|
|
9
|
+
}
|
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';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Tamaño nombrado o personalizado en puntos PDF (1pt = 1/72in). */
|
|
2
|
+
export type PdfGeneratorPageSize = 'LETTER' | 'A4' | 'LEGAL' | { width: number; height: number };
|
|
3
|
+
|
|
4
|
+
/** Texto por página en el margen; acepta los tokens {page} y {pages}. */
|
|
5
|
+
export class PdfGeneratorPageBoxText {
|
|
6
|
+
left?: string;
|
|
7
|
+
center?: string;
|
|
8
|
+
right?: string;
|
|
9
|
+
fontSize?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Configuración de hoja de pdf-generator-business. Las longitudes de margen llevan unidad
|
|
14
|
+
* (mm, cm, in, pt, px). Sin `page`, el lambda usa el @page de la plantilla o A4 con 2 mm.
|
|
15
|
+
*/
|
|
16
|
+
export class PdfGeneratorPageConfig {
|
|
17
|
+
size?: PdfGeneratorPageSize;
|
|
18
|
+
orientation?: 'portrait' | 'landscape';
|
|
19
|
+
margin?: { top?: string; right?: string; bottom?: string; left?: string };
|
|
20
|
+
header?: PdfGeneratorPageBoxText;
|
|
21
|
+
footer?: PdfGeneratorPageBoxText;
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IsIn, IsNotEmpty, IsObject, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { PdfGeneratorPageConfig } from './PdfGeneratorPageConfig';
|
|
3
|
+
|
|
4
|
+
/** POST /generate-pdf de pdf-generator-business: HTML ya armado → PDF en base64. */
|
|
5
|
+
export class PdfGeneratorRequest {
|
|
6
|
+
@IsString() @IsNotEmpty()
|
|
7
|
+
html!: string;
|
|
8
|
+
|
|
9
|
+
/** La valida a fondo el propio lambda (400 con el campo que falla). */
|
|
10
|
+
@IsOptional() @IsObject()
|
|
11
|
+
page?: PdfGeneratorPageConfig;
|
|
12
|
+
|
|
13
|
+
/** Override del motor para este request (default del lambda: pdflib). */
|
|
14
|
+
@IsOptional() @IsIn(['pdflib', 'puppeteer'])
|
|
15
|
+
provider?: 'pdflib' | 'puppeteer';
|
|
16
|
+
}
|
|
@@ -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';
|