@fiado/type-kit 3.236.0 → 3.238.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/shipping/CreateShippingRequest.validation.test.ts +71 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +5 -1
- package/bin/retailWizard/dtos/requests/ProfileQuestionsRequest.d.ts +19 -3
- package/bin/retailWizard/dtos/requests/ProfileQuestionsRequest.js +19 -3
- package/bin/shipping/dtos/CreateShippingRequest.d.ts +25 -0
- package/bin/shipping/dtos/CreateShippingRequest.js +76 -0
- package/bin/shipping/dtos/CreateShippingResponse.d.ts +5 -0
- package/bin/shipping/dtos/CreateShippingResponse.js +6 -0
- package/bin/shipping/dtos/ShippingDestinationAddress.d.ts +8 -0
- package/bin/shipping/dtos/ShippingDestinationAddress.js +46 -0
- package/bin/shipping/dtos/ShippingRecipient.d.ts +6 -0
- package/bin/shipping/dtos/ShippingRecipient.js +36 -0
- package/bin/shipping/dtos/UpdateShippingStatusRequest.d.ts +15 -0
- package/bin/shipping/dtos/UpdateShippingStatusRequest.js +55 -0
- package/bin/shipping/enums/DeliveryTypeEnum.d.ts +4 -0
- package/bin/shipping/enums/DeliveryTypeEnum.js +8 -0
- package/bin/shipping/enums/ShippingContentType.d.ts +9 -0
- package/bin/shipping/enums/ShippingContentType.js +13 -0
- package/bin/shipping/index.d.ts +8 -0
- package/bin/shipping/index.js +31 -0
- package/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/retailWizard/dtos/requests/ProfileQuestionsRequest.ts +19 -3
- package/src/shipping/dtos/CreateShippingRequest.ts +60 -0
- package/src/shipping/dtos/CreateShippingResponse.ts +6 -0
- package/src/shipping/dtos/ShippingDestinationAddress.ts +27 -0
- package/src/shipping/dtos/ShippingRecipient.ts +19 -0
- package/src/shipping/dtos/UpdateShippingStatusRequest.ts +35 -0
- package/src/shipping/enums/DeliveryTypeEnum.ts +4 -0
- package/src/shipping/enums/ShippingContentType.ts +9 -0
- package/src/shipping/index.ts +15 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { describe, it, expect } from '@jest/globals';
|
|
3
|
+
import { plainToInstance } from 'class-transformer';
|
|
4
|
+
import { validate } from 'class-validator';
|
|
5
|
+
import { CreateShippingRequest } from '../../../src/shipping/dtos/CreateShippingRequest';
|
|
6
|
+
import { ShippingContentType } from '../../../src/shipping/enums/ShippingContentType';
|
|
7
|
+
import { DeliveryTypeEnum } from '../../../src/shipping/enums/DeliveryTypeEnum';
|
|
8
|
+
|
|
9
|
+
const BASE = {
|
|
10
|
+
sourceSystem: 'CARD_BUSINESS',
|
|
11
|
+
originReference: 'POMELO#card_9f3c1e',
|
|
12
|
+
fiadoReference: 'POMELO#card_9f3c1e',
|
|
13
|
+
contentType: ShippingContentType.CARD,
|
|
14
|
+
deliveryType: DeliveryTypeEnum.OFFICE,
|
|
15
|
+
recipient: { firstName: 'Maria', lastName: 'Gomez', phoneNumber: '5511110000' },
|
|
16
|
+
destinationAddress: {
|
|
17
|
+
street: 'Avenida Insurgentes',
|
|
18
|
+
addressNumber: '1234',
|
|
19
|
+
neighborhood: 'Del Valle',
|
|
20
|
+
municipality: 'Benito Juarez',
|
|
21
|
+
region: 'CDMX',
|
|
22
|
+
postalCode: '03100',
|
|
23
|
+
},
|
|
24
|
+
officeCode: 'OC-001',
|
|
25
|
+
officeName: 'ESTAFETA CENTRO',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
async function errorsOf(payload: Record<string, unknown>): Promise<string[]> {
|
|
29
|
+
const errors = await validate(plainToInstance(CreateShippingRequest, payload));
|
|
30
|
+
return errors.map(e => e.property);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
describe('CreateShippingRequest', () => {
|
|
34
|
+
|
|
35
|
+
it('acepta un request OFFICE completo', async () => {
|
|
36
|
+
expect(await errorsOf(BASE)).toEqual([]);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('acepta HOME sin officeCode ni officeName', async () => {
|
|
40
|
+
const { officeCode, officeName, ...home } = BASE;
|
|
41
|
+
expect(await errorsOf({ ...home, deliveryType: DeliveryTypeEnum.HOME })).toEqual([]);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('exige officeCode y officeName cuando deliveryType es OFFICE', async () => {
|
|
45
|
+
const { officeCode, officeName, ...sinOficina } = BASE;
|
|
46
|
+
const props = await errorsOf(sinOficina);
|
|
47
|
+
expect(props).toContain('officeCode');
|
|
48
|
+
expect(props).toContain('officeName');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('rechaza contentType y deliveryType fuera del enum', async () => {
|
|
52
|
+
const props = await errorsOf({ ...BASE, contentType: 'celular', deliveryType: 'DOMICILIO' });
|
|
53
|
+
expect(props).toContain('contentType');
|
|
54
|
+
expect(props).toContain('deliveryType');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('exige los campos anidados del destinatario y la direccion', async () => {
|
|
58
|
+
const props = await errorsOf({ ...BASE, recipient: {}, destinationAddress: {} });
|
|
59
|
+
expect(props).toContain('recipient');
|
|
60
|
+
expect(props).toContain('destinationAddress');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('NO valida el techo de 60 de deliveryReference: eso lo hace el conector con error tipado', async () => {
|
|
64
|
+
expect(await errorsOf({ ...BASE, deliveryReference: 'x'.repeat(61) })).toEqual([]);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('lastName, phoneNumberSecondary, deliveryReference y additionalData son opcionales', async () => {
|
|
68
|
+
const { recipient, ...rest } = BASE;
|
|
69
|
+
expect(await errorsOf({ ...rest, recipient: { firstName: 'Jose', phoneNumber: '5533330000' } })).toEqual([]);
|
|
70
|
+
});
|
|
71
|
+
});
|
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.Observations = exports.IssuanceBusiness = exports.Blacklist = 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.BankAccount = exports.P2pContact = exports.CreditContract = exports.Contract = exports.ProductCatalog = exports.ContactInfo = exports.TransactionAnalytics = exports.Transaction = exports.TransactionProcessor = exports.GenericMessage = exports.EventBridgeMessage = exports.SessionActivity = 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.MetamapConnector = exports.Account = exports.Crypto = void 0;
|
|
40
40
|
exports.LoanCollectorAssignment = exports.LoanOfferings = exports.Shortlink = exports.LoanConfig = exports.RetailWizard = exports.RetailCustomer = exports.RetailCards = exports.RetailCatalog = exports.RetailOrg = exports.EmailVerification = exports.NetworkConnector = exports.Modelias = exports.TotpSecurity = exports.Passport = exports.WalletFunding = exports.Remittance = exports.PlatformRbac = exports.CognitoBackofficeConnector = 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.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 = void 0;
|
|
41
|
-
exports.PhoneSales = exports.Kyc = exports.LoanScoring = exports.LoanCredit = void 0;
|
|
41
|
+
exports.Shipping = exports.PhoneSales = exports.Kyc = exports.LoanScoring = exports.LoanCredit = void 0;
|
|
42
42
|
exports.Crypto = __importStar(require("./crypto"));
|
|
43
43
|
exports.Account = __importStar(require("./account"));
|
|
44
44
|
exports.MetamapConnector = __importStar(require("./metamapConnector"));
|
|
@@ -185,3 +185,7 @@ __exportStar(require("./complaint"), exports);
|
|
|
185
185
|
// PhoneSales: DTOs del lambda cell-phone-sales-business — variantes de dispositivo (modelo/color/
|
|
186
186
|
// storage/precio/stock), venta con delivery PICKUP|HOME y redención de código de referencia.
|
|
187
187
|
exports.PhoneSales = __importStar(require("./phoneSales"));
|
|
188
|
+
// Shipping: contrato genérico de envíos del fiado-estafeta-connector — agnóstico al producto
|
|
189
|
+
// (tarjetas, teléfonos, …). ExternalShippingStatus se reexporta acá desde `card/` sin moverlo,
|
|
190
|
+
// para no romper a los consumidores actuales del namespace Card.
|
|
191
|
+
exports.Shipping = __importStar(require("./shipping"));
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
* catálogos — mandar un valor fuera de catálogo deja un expediente que ningún backoffice sabe pintar,
|
|
11
11
|
* y nadie lo rechaza en runtime porque del otro lado son strings libres.
|
|
12
12
|
*
|
|
13
|
+
* ⚠️ Dos de los cinco NO usan el catálogo que su nombre sugiere. Está anotado en cada constante:
|
|
14
|
+
* `usageMonthly` sale de `Frequency` (no de `MoneyUsageCategories`) y `beneficialOwner` de `ActMXN`
|
|
15
|
+
* (no de `BeneficialOwnerMXN`). Sale de leer la pantalla real de la app, no de la doc.
|
|
16
|
+
*
|
|
13
17
|
* ⚠️ `beneficialOwner` debe ser `SELF` para que la cuenta pueda abrir: `fiado-card-business` valida
|
|
14
18
|
* exactamente ese valor. `OTHER` ("viene de otra persona") es una respuesta legítima del cliente que
|
|
15
19
|
* BLOQUEA la apertura — la pantalla tiene que advertirlo antes, no descubrirlo después.
|
|
@@ -20,11 +24,23 @@
|
|
|
20
24
|
export declare const MONTHLY_INCOME_VALUES: readonly ["0", "10000", "20000", "50000", "100000", "150000"];
|
|
21
25
|
/** `dataType=ExtraSupport` — apoyo económico extra mensual. */
|
|
22
26
|
export declare const EXTRA_SUPPORT_VALUES: readonly ["0", "2000", "10000", "20000", "50000", "60000"];
|
|
23
|
-
/**
|
|
24
|
-
|
|
27
|
+
/**
|
|
28
|
+
* `dataType=Frequency` — con qué frecuencia va a usar la cuenta ("2 al día", "3 al día"…).
|
|
29
|
+
*
|
|
30
|
+
* ⚠️ El nombre del campo engaña: `MXN_UsageMonthly` NO es "para qué usa el dinero". Es la FRECUENCIA
|
|
31
|
+
* de operaciones, y su catálogo es `Frequency`, no `MoneyUsageCategories`. Verificado contra la
|
|
32
|
+
* pantalla real de la app (`CreateAddressMxScreen`), que manda
|
|
33
|
+
* `MXN_UsageMonthly: selectedPaymentOrPurchaseFrequency.value`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const USAGE_MONTHLY_VALUES: readonly ["60", "90", "150", "180", "210", "240", "270", "300"];
|
|
25
36
|
/** `dataType=PurchaseAmountMaxMXN` — monto máximo por operación. */
|
|
26
37
|
export declare const MAXIMUM_TX_VALUES: readonly ["10000", "100000", "300000"];
|
|
27
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* `dataType=ActMXN` — "¿Actúas por tu propia cuenta?" (`SELF` = "Sí, por mi propia cuenta").
|
|
40
|
+
*
|
|
41
|
+
* ⚠️ NO es `BeneficialOwnerMXN`. Los dos catálogos comparten los valores `SELF`/`OTHER`, pero la
|
|
42
|
+
* pregunta que la app le hace al cliente es la de `ActMXN` y esa es la redacción que debe mostrarse.
|
|
43
|
+
*/
|
|
28
44
|
export declare const BENEFICIAL_OWNER_VALUES: readonly ["SELF", "OTHER"];
|
|
29
45
|
export declare class ProfileQuestionsRequest {
|
|
30
46
|
monthlyIncome: string;
|
|
@@ -24,6 +24,10 @@ const class_validator_1 = require("class-validator");
|
|
|
24
24
|
* catálogos — mandar un valor fuera de catálogo deja un expediente que ningún backoffice sabe pintar,
|
|
25
25
|
* y nadie lo rechaza en runtime porque del otro lado son strings libres.
|
|
26
26
|
*
|
|
27
|
+
* ⚠️ Dos de los cinco NO usan el catálogo que su nombre sugiere. Está anotado en cada constante:
|
|
28
|
+
* `usageMonthly` sale de `Frequency` (no de `MoneyUsageCategories`) y `beneficialOwner` de `ActMXN`
|
|
29
|
+
* (no de `BeneficialOwnerMXN`). Sale de leer la pantalla real de la app, no de la doc.
|
|
30
|
+
*
|
|
27
31
|
* ⚠️ `beneficialOwner` debe ser `SELF` para que la cuenta pueda abrir: `fiado-card-business` valida
|
|
28
32
|
* exactamente ese valor. `OTHER` ("viene de otra persona") es una respuesta legítima del cliente que
|
|
29
33
|
* BLOQUEA la apertura — la pantalla tiene que advertirlo antes, no descubrirlo después.
|
|
@@ -34,11 +38,23 @@ const class_validator_1 = require("class-validator");
|
|
|
34
38
|
exports.MONTHLY_INCOME_VALUES = ['0', '10000', '20000', '50000', '100000', '150000'];
|
|
35
39
|
/** `dataType=ExtraSupport` — apoyo económico extra mensual. */
|
|
36
40
|
exports.EXTRA_SUPPORT_VALUES = ['0', '2000', '10000', '20000', '50000', '60000'];
|
|
37
|
-
/**
|
|
38
|
-
|
|
41
|
+
/**
|
|
42
|
+
* `dataType=Frequency` — con qué frecuencia va a usar la cuenta ("2 al día", "3 al día"…).
|
|
43
|
+
*
|
|
44
|
+
* ⚠️ El nombre del campo engaña: `MXN_UsageMonthly` NO es "para qué usa el dinero". Es la FRECUENCIA
|
|
45
|
+
* de operaciones, y su catálogo es `Frequency`, no `MoneyUsageCategories`. Verificado contra la
|
|
46
|
+
* pantalla real de la app (`CreateAddressMxScreen`), que manda
|
|
47
|
+
* `MXN_UsageMonthly: selectedPaymentOrPurchaseFrequency.value`.
|
|
48
|
+
*/
|
|
49
|
+
exports.USAGE_MONTHLY_VALUES = ['60', '90', '150', '180', '210', '240', '270', '300'];
|
|
39
50
|
/** `dataType=PurchaseAmountMaxMXN` — monto máximo por operación. */
|
|
40
51
|
exports.MAXIMUM_TX_VALUES = ['10000', '100000', '300000'];
|
|
41
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* `dataType=ActMXN` — "¿Actúas por tu propia cuenta?" (`SELF` = "Sí, por mi propia cuenta").
|
|
54
|
+
*
|
|
55
|
+
* ⚠️ NO es `BeneficialOwnerMXN`. Los dos catálogos comparten los valores `SELF`/`OTHER`, pero la
|
|
56
|
+
* pregunta que la app le hace al cliente es la de `ActMXN` y esa es la redacción que debe mostrarse.
|
|
57
|
+
*/
|
|
42
58
|
exports.BENEFICIAL_OWNER_VALUES = ['SELF', 'OTHER'];
|
|
43
59
|
class ProfileQuestionsRequest {
|
|
44
60
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ShippingContentType } from '../enums/ShippingContentType';
|
|
2
|
+
import { DeliveryTypeEnum } from '../enums/DeliveryTypeEnum';
|
|
3
|
+
import { ShippingRecipient } from './ShippingRecipient';
|
|
4
|
+
import { ShippingDestinationAddress } from './ShippingDestinationAddress';
|
|
5
|
+
export declare class CreateShippingRequest {
|
|
6
|
+
sourceSystem: string;
|
|
7
|
+
/** Id de la operacion en el negocio origen. Clave de idempotencia. NO va al archivo. */
|
|
8
|
+
originReference: string;
|
|
9
|
+
/** Columna 12 del XLSX: referencia interna Fiado del envio. */
|
|
10
|
+
fiadoReference: string;
|
|
11
|
+
contentType: ShippingContentType;
|
|
12
|
+
deliveryType: DeliveryTypeEnum;
|
|
13
|
+
recipient: ShippingRecipient;
|
|
14
|
+
destinationAddress: ShippingDestinationAddress;
|
|
15
|
+
officeCode?: string;
|
|
16
|
+
officeName?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Columna 10 (REFERENCIAS), ya compuesta por el consumidor. El techo de 60 caracteres lo
|
|
19
|
+
* hace cumplir el conector con error tipado: si se validara aca, el rechazo saldria como
|
|
20
|
+
* error de validacion generico y DeliveryReferenceTooLongError seria inalcanzable.
|
|
21
|
+
*/
|
|
22
|
+
deliveryReference?: string;
|
|
23
|
+
/** Valores de las columnas 13+. Las claves matchean los extraColumns de la config. */
|
|
24
|
+
additionalData?: Record<string, string>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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.CreateShippingRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const ShippingContentType_1 = require("../enums/ShippingContentType");
|
|
16
|
+
const DeliveryTypeEnum_1 = require("../enums/DeliveryTypeEnum");
|
|
17
|
+
const ShippingRecipient_1 = require("./ShippingRecipient");
|
|
18
|
+
const ShippingDestinationAddress_1 = require("./ShippingDestinationAddress");
|
|
19
|
+
class CreateShippingRequest {
|
|
20
|
+
}
|
|
21
|
+
exports.CreateShippingRequest = CreateShippingRequest;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CreateShippingRequest.prototype, "sourceSystem", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CreateShippingRequest.prototype, "originReference", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CreateShippingRequest.prototype, "fiadoReference", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsEnum)(ShippingContentType_1.ShippingContentType),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], CreateShippingRequest.prototype, "contentType", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsEnum)(DeliveryTypeEnum_1.DeliveryTypeEnum),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], CreateShippingRequest.prototype, "deliveryType", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.ValidateNested)(),
|
|
47
|
+
(0, class_transformer_1.Type)(() => ShippingRecipient_1.ShippingRecipient),
|
|
48
|
+
__metadata("design:type", ShippingRecipient_1.ShippingRecipient)
|
|
49
|
+
], CreateShippingRequest.prototype, "recipient", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.ValidateNested)(),
|
|
52
|
+
(0, class_transformer_1.Type)(() => ShippingDestinationAddress_1.ShippingDestinationAddress),
|
|
53
|
+
__metadata("design:type", ShippingDestinationAddress_1.ShippingDestinationAddress)
|
|
54
|
+
], CreateShippingRequest.prototype, "destinationAddress", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.ValidateIf)(o => o.deliveryType === DeliveryTypeEnum_1.DeliveryTypeEnum.OFFICE),
|
|
57
|
+
(0, class_validator_1.IsString)(),
|
|
58
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], CreateShippingRequest.prototype, "officeCode", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_validator_1.ValidateIf)(o => o.deliveryType === DeliveryTypeEnum_1.DeliveryTypeEnum.OFFICE),
|
|
63
|
+
(0, class_validator_1.IsString)(),
|
|
64
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], CreateShippingRequest.prototype, "officeName", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_validator_1.IsOptional)(),
|
|
69
|
+
(0, class_validator_1.IsString)(),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], CreateShippingRequest.prototype, "deliveryReference", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, class_validator_1.IsOptional)(),
|
|
74
|
+
(0, class_validator_1.IsObject)(),
|
|
75
|
+
__metadata("design:type", Object)
|
|
76
|
+
], CreateShippingRequest.prototype, "additionalData", void 0);
|
|
@@ -0,0 +1,46 @@
|
|
|
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.ShippingDestinationAddress = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class ShippingDestinationAddress {
|
|
15
|
+
}
|
|
16
|
+
exports.ShippingDestinationAddress = ShippingDestinationAddress;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], ShippingDestinationAddress.prototype, "street", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], ShippingDestinationAddress.prototype, "addressNumber", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ShippingDestinationAddress.prototype, "neighborhood", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ShippingDestinationAddress.prototype, "municipality", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsString)(),
|
|
39
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], ShippingDestinationAddress.prototype, "region", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], ShippingDestinationAddress.prototype, "postalCode", void 0);
|
|
@@ -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.ShippingRecipient = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class ShippingRecipient {
|
|
15
|
+
}
|
|
16
|
+
exports.ShippingRecipient = ShippingRecipient;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], ShippingRecipient.prototype, "firstName", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsOptional)(),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], ShippingRecipient.prototype, "lastName", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ShippingRecipient.prototype, "phoneNumber", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ShippingRecipient.prototype, "phoneNumberSecondary", void 0);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExternalShippingStatus } from '../../card/enums/ExternalShippingStatus';
|
|
2
|
+
/**
|
|
3
|
+
* Notificacion conector -> negocio origen. Los 3 campos de tracking son opcionales porque un
|
|
4
|
+
* evento temprano de Estafeta puede no traer description y el consumidor no debe romper con un
|
|
5
|
+
* item degradado; el conector los manda siempre que los tenga.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UpdateShippingStatusRequest {
|
|
8
|
+
externalShippingId: string;
|
|
9
|
+
originReference: string;
|
|
10
|
+
externalShippingStatus: ExternalShippingStatus;
|
|
11
|
+
externalShippingStatusDetail?: string;
|
|
12
|
+
shippingTrackingNumber?: string;
|
|
13
|
+
shippingTrackingUrl?: string;
|
|
14
|
+
occurredAt: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.UpdateShippingStatusRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const ExternalShippingStatus_1 = require("../../card/enums/ExternalShippingStatus");
|
|
15
|
+
/**
|
|
16
|
+
* Notificacion conector -> negocio origen. Los 3 campos de tracking son opcionales porque un
|
|
17
|
+
* evento temprano de Estafeta puede no traer description y el consumidor no debe romper con un
|
|
18
|
+
* item degradado; el conector los manda siempre que los tenga.
|
|
19
|
+
*/
|
|
20
|
+
class UpdateShippingStatusRequest {
|
|
21
|
+
}
|
|
22
|
+
exports.UpdateShippingStatusRequest = UpdateShippingStatusRequest;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], UpdateShippingStatusRequest.prototype, "externalShippingId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], UpdateShippingStatusRequest.prototype, "originReference", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsEnum)(ExternalShippingStatus_1.ExternalShippingStatus),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], UpdateShippingStatusRequest.prototype, "externalShippingStatus", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], UpdateShippingStatusRequest.prototype, "externalShippingStatusDetail", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsString)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], UpdateShippingStatusRequest.prototype, "shippingTrackingNumber", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], UpdateShippingStatusRequest.prototype, "shippingTrackingUrl", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_validator_1.IsISO8601)(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], UpdateShippingStatusRequest.prototype, "occurredAt", void 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryTypeEnum = void 0;
|
|
4
|
+
var DeliveryTypeEnum;
|
|
5
|
+
(function (DeliveryTypeEnum) {
|
|
6
|
+
DeliveryTypeEnum["HOME"] = "HOME";
|
|
7
|
+
DeliveryTypeEnum["OFFICE"] = "OFFICE";
|
|
8
|
+
})(DeliveryTypeEnum || (exports.DeliveryTypeEnum = DeliveryTypeEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de contenido del envio. Determina la columna 11 del XLSX via el catalogo de labels,
|
|
3
|
+
* que vive en Dynamo: sumar un valor aca es un bump minor + una fila en el catalogo, sin
|
|
4
|
+
* deploy del conector.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ShippingContentType {
|
|
7
|
+
CARD = "CARD",
|
|
8
|
+
PHONE = "PHONE"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ShippingContentType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Tipo de contenido del envio. Determina la columna 11 del XLSX via el catalogo de labels,
|
|
6
|
+
* que vive en Dynamo: sumar un valor aca es un bump minor + una fila en el catalogo, sin
|
|
7
|
+
* deploy del conector.
|
|
8
|
+
*/
|
|
9
|
+
var ShippingContentType;
|
|
10
|
+
(function (ShippingContentType) {
|
|
11
|
+
ShippingContentType["CARD"] = "CARD";
|
|
12
|
+
ShippingContentType["PHONE"] = "PHONE";
|
|
13
|
+
})(ShippingContentType || (exports.ShippingContentType = ShippingContentType = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './dtos/ShippingRecipient';
|
|
2
|
+
export * from './dtos/ShippingDestinationAddress';
|
|
3
|
+
export * from './dtos/CreateShippingRequest';
|
|
4
|
+
export * from './dtos/CreateShippingResponse';
|
|
5
|
+
export * from './dtos/UpdateShippingStatusRequest';
|
|
6
|
+
export * from './enums/ShippingContentType';
|
|
7
|
+
export * from './enums/DeliveryTypeEnum';
|
|
8
|
+
export { ExternalShippingStatus } from '../card/enums/ExternalShippingStatus';
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
exports.ExternalShippingStatus = void 0;
|
|
18
|
+
//dtos
|
|
19
|
+
__exportStar(require("./dtos/ShippingRecipient"), exports);
|
|
20
|
+
__exportStar(require("./dtos/ShippingDestinationAddress"), exports);
|
|
21
|
+
__exportStar(require("./dtos/CreateShippingRequest"), exports);
|
|
22
|
+
__exportStar(require("./dtos/CreateShippingResponse"), exports);
|
|
23
|
+
__exportStar(require("./dtos/UpdateShippingStatusRequest"), exports);
|
|
24
|
+
//enums
|
|
25
|
+
__exportStar(require("./enums/ShippingContentType"), exports);
|
|
26
|
+
__exportStar(require("./enums/DeliveryTypeEnum"), exports);
|
|
27
|
+
// ExternalShippingStatus es agnostico al producto: se reexporta desde shipping SIN tocar el
|
|
28
|
+
// export de card, para que el dominio nuevo no importe del namespace de un producto y los
|
|
29
|
+
// consumidores actuales no se rompan.
|
|
30
|
+
var ExternalShippingStatus_1 = require("../card/enums/ExternalShippingStatus");
|
|
31
|
+
Object.defineProperty(exports, "ExternalShippingStatus", { enumerable: true, get: function () { return ExternalShippingStatus_1.ExternalShippingStatus; } });
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -144,3 +144,7 @@ export * from './complaint';
|
|
|
144
144
|
// PhoneSales: DTOs del lambda cell-phone-sales-business — variantes de dispositivo (modelo/color/
|
|
145
145
|
// storage/precio/stock), venta con delivery PICKUP|HOME y redención de código de referencia.
|
|
146
146
|
export * as PhoneSales from './phoneSales';
|
|
147
|
+
// Shipping: contrato genérico de envíos del fiado-estafeta-connector — agnóstico al producto
|
|
148
|
+
// (tarjetas, teléfonos, …). ExternalShippingStatus se reexporta acá desde `card/` sin moverlo,
|
|
149
|
+
// para no romper a los consumidores actuales del namespace Card.
|
|
150
|
+
export * as Shipping from './shipping';
|
|
@@ -13,6 +13,10 @@ import { IsIn, IsString } from 'class-validator';
|
|
|
13
13
|
* catálogos — mandar un valor fuera de catálogo deja un expediente que ningún backoffice sabe pintar,
|
|
14
14
|
* y nadie lo rechaza en runtime porque del otro lado son strings libres.
|
|
15
15
|
*
|
|
16
|
+
* ⚠️ Dos de los cinco NO usan el catálogo que su nombre sugiere. Está anotado en cada constante:
|
|
17
|
+
* `usageMonthly` sale de `Frequency` (no de `MoneyUsageCategories`) y `beneficialOwner` de `ActMXN`
|
|
18
|
+
* (no de `BeneficialOwnerMXN`). Sale de leer la pantalla real de la app, no de la doc.
|
|
19
|
+
*
|
|
16
20
|
* ⚠️ `beneficialOwner` debe ser `SELF` para que la cuenta pueda abrir: `fiado-card-business` valida
|
|
17
21
|
* exactamente ese valor. `OTHER` ("viene de otra persona") es una respuesta legítima del cliente que
|
|
18
22
|
* BLOQUEA la apertura — la pantalla tiene que advertirlo antes, no descubrirlo después.
|
|
@@ -26,13 +30,25 @@ export const MONTHLY_INCOME_VALUES = ['0', '10000', '20000', '50000', '100000',
|
|
|
26
30
|
/** `dataType=ExtraSupport` — apoyo económico extra mensual. */
|
|
27
31
|
export const EXTRA_SUPPORT_VALUES = ['0', '2000', '10000', '20000', '50000', '60000'] as const;
|
|
28
32
|
|
|
29
|
-
/**
|
|
30
|
-
|
|
33
|
+
/**
|
|
34
|
+
* `dataType=Frequency` — con qué frecuencia va a usar la cuenta ("2 al día", "3 al día"…).
|
|
35
|
+
*
|
|
36
|
+
* ⚠️ El nombre del campo engaña: `MXN_UsageMonthly` NO es "para qué usa el dinero". Es la FRECUENCIA
|
|
37
|
+
* de operaciones, y su catálogo es `Frequency`, no `MoneyUsageCategories`. Verificado contra la
|
|
38
|
+
* pantalla real de la app (`CreateAddressMxScreen`), que manda
|
|
39
|
+
* `MXN_UsageMonthly: selectedPaymentOrPurchaseFrequency.value`.
|
|
40
|
+
*/
|
|
41
|
+
export const USAGE_MONTHLY_VALUES = ['60', '90', '150', '180', '210', '240', '270', '300'] as const;
|
|
31
42
|
|
|
32
43
|
/** `dataType=PurchaseAmountMaxMXN` — monto máximo por operación. */
|
|
33
44
|
export const MAXIMUM_TX_VALUES = ['10000', '100000', '300000'] as const;
|
|
34
45
|
|
|
35
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* `dataType=ActMXN` — "¿Actúas por tu propia cuenta?" (`SELF` = "Sí, por mi propia cuenta").
|
|
48
|
+
*
|
|
49
|
+
* ⚠️ NO es `BeneficialOwnerMXN`. Los dos catálogos comparten los valores `SELF`/`OTHER`, pero la
|
|
50
|
+
* pregunta que la app le hace al cliente es la de `ActMXN` y esa es la redacción que debe mostrarse.
|
|
51
|
+
*/
|
|
36
52
|
export const BENEFICIAL_OWNER_VALUES = ['SELF', 'OTHER'] as const;
|
|
37
53
|
|
|
38
54
|
export class ProfileQuestionsRequest {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { IsEnum, IsNotEmpty, IsObject, IsOptional, IsString, ValidateIf, ValidateNested } from 'class-validator';
|
|
3
|
+
import { ShippingContentType } from '../enums/ShippingContentType';
|
|
4
|
+
import { DeliveryTypeEnum } from '../enums/DeliveryTypeEnum';
|
|
5
|
+
import { ShippingRecipient } from './ShippingRecipient';
|
|
6
|
+
import { ShippingDestinationAddress } from './ShippingDestinationAddress';
|
|
7
|
+
|
|
8
|
+
export class CreateShippingRequest {
|
|
9
|
+
@IsString()
|
|
10
|
+
@IsNotEmpty()
|
|
11
|
+
sourceSystem: string;
|
|
12
|
+
|
|
13
|
+
/** Id de la operacion en el negocio origen. Clave de idempotencia. NO va al archivo. */
|
|
14
|
+
@IsString()
|
|
15
|
+
@IsNotEmpty()
|
|
16
|
+
originReference: string;
|
|
17
|
+
|
|
18
|
+
/** Columna 12 del XLSX: referencia interna Fiado del envio. */
|
|
19
|
+
@IsString()
|
|
20
|
+
@IsNotEmpty()
|
|
21
|
+
fiadoReference: string;
|
|
22
|
+
|
|
23
|
+
@IsEnum(ShippingContentType)
|
|
24
|
+
contentType: ShippingContentType;
|
|
25
|
+
|
|
26
|
+
@IsEnum(DeliveryTypeEnum)
|
|
27
|
+
deliveryType: DeliveryTypeEnum;
|
|
28
|
+
|
|
29
|
+
@ValidateNested()
|
|
30
|
+
@Type(() => ShippingRecipient)
|
|
31
|
+
recipient: ShippingRecipient;
|
|
32
|
+
|
|
33
|
+
@ValidateNested()
|
|
34
|
+
@Type(() => ShippingDestinationAddress)
|
|
35
|
+
destinationAddress: ShippingDestinationAddress;
|
|
36
|
+
|
|
37
|
+
@ValidateIf(o => o.deliveryType === DeliveryTypeEnum.OFFICE)
|
|
38
|
+
@IsString()
|
|
39
|
+
@IsNotEmpty()
|
|
40
|
+
officeCode?: string;
|
|
41
|
+
|
|
42
|
+
@ValidateIf(o => o.deliveryType === DeliveryTypeEnum.OFFICE)
|
|
43
|
+
@IsString()
|
|
44
|
+
@IsNotEmpty()
|
|
45
|
+
officeName?: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Columna 10 (REFERENCIAS), ya compuesta por el consumidor. El techo de 60 caracteres lo
|
|
49
|
+
* hace cumplir el conector con error tipado: si se validara aca, el rechazo saldria como
|
|
50
|
+
* error de validacion generico y DeliveryReferenceTooLongError seria inalcanzable.
|
|
51
|
+
*/
|
|
52
|
+
@IsOptional()
|
|
53
|
+
@IsString()
|
|
54
|
+
deliveryReference?: string;
|
|
55
|
+
|
|
56
|
+
/** Valores de las columnas 13+. Las claves matchean los extraColumns de la config. */
|
|
57
|
+
@IsOptional()
|
|
58
|
+
@IsObject()
|
|
59
|
+
additionalData?: Record<string, string>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IsNotEmpty, IsString } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class ShippingDestinationAddress {
|
|
4
|
+
@IsString()
|
|
5
|
+
@IsNotEmpty()
|
|
6
|
+
street: string;
|
|
7
|
+
|
|
8
|
+
@IsString()
|
|
9
|
+
@IsNotEmpty()
|
|
10
|
+
addressNumber: string;
|
|
11
|
+
|
|
12
|
+
@IsString()
|
|
13
|
+
@IsNotEmpty()
|
|
14
|
+
neighborhood: string;
|
|
15
|
+
|
|
16
|
+
@IsString()
|
|
17
|
+
@IsNotEmpty()
|
|
18
|
+
municipality: string;
|
|
19
|
+
|
|
20
|
+
@IsString()
|
|
21
|
+
@IsNotEmpty()
|
|
22
|
+
region: string;
|
|
23
|
+
|
|
24
|
+
@IsString()
|
|
25
|
+
@IsNotEmpty()
|
|
26
|
+
postalCode: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class ShippingRecipient {
|
|
4
|
+
@IsString()
|
|
5
|
+
@IsNotEmpty()
|
|
6
|
+
firstName: string;
|
|
7
|
+
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@IsString()
|
|
10
|
+
lastName?: string;
|
|
11
|
+
|
|
12
|
+
@IsString()
|
|
13
|
+
@IsNotEmpty()
|
|
14
|
+
phoneNumber: string;
|
|
15
|
+
|
|
16
|
+
@IsOptional()
|
|
17
|
+
@IsString()
|
|
18
|
+
phoneNumberSecondary?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IsEnum, IsISO8601, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { ExternalShippingStatus } from '../../card/enums/ExternalShippingStatus';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Notificacion conector -> negocio origen. Los 3 campos de tracking son opcionales porque un
|
|
6
|
+
* evento temprano de Estafeta puede no traer description y el consumidor no debe romper con un
|
|
7
|
+
* item degradado; el conector los manda siempre que los tenga.
|
|
8
|
+
*/
|
|
9
|
+
export class UpdateShippingStatusRequest {
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
externalShippingId: string;
|
|
13
|
+
|
|
14
|
+
@IsString()
|
|
15
|
+
@IsNotEmpty()
|
|
16
|
+
originReference: string;
|
|
17
|
+
|
|
18
|
+
@IsEnum(ExternalShippingStatus)
|
|
19
|
+
externalShippingStatus: ExternalShippingStatus;
|
|
20
|
+
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsString()
|
|
23
|
+
externalShippingStatusDetail?: string;
|
|
24
|
+
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@IsString()
|
|
27
|
+
shippingTrackingNumber?: string;
|
|
28
|
+
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@IsString()
|
|
31
|
+
shippingTrackingUrl?: string;
|
|
32
|
+
|
|
33
|
+
@IsISO8601()
|
|
34
|
+
occurredAt: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de contenido del envio. Determina la columna 11 del XLSX via el catalogo de labels,
|
|
3
|
+
* que vive en Dynamo: sumar un valor aca es un bump minor + una fila en el catalogo, sin
|
|
4
|
+
* deploy del conector.
|
|
5
|
+
*/
|
|
6
|
+
export enum ShippingContentType {
|
|
7
|
+
CARD = 'CARD',
|
|
8
|
+
PHONE = 'PHONE',
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//dtos
|
|
2
|
+
export * from './dtos/ShippingRecipient';
|
|
3
|
+
export * from './dtos/ShippingDestinationAddress';
|
|
4
|
+
export * from './dtos/CreateShippingRequest';
|
|
5
|
+
export * from './dtos/CreateShippingResponse';
|
|
6
|
+
export * from './dtos/UpdateShippingStatusRequest';
|
|
7
|
+
|
|
8
|
+
//enums
|
|
9
|
+
export * from './enums/ShippingContentType';
|
|
10
|
+
export * from './enums/DeliveryTypeEnum';
|
|
11
|
+
|
|
12
|
+
// ExternalShippingStatus es agnostico al producto: se reexporta desde shipping SIN tocar el
|
|
13
|
+
// export de card, para que el dominio nuevo no importe del namespace de un producto y los
|
|
14
|
+
// consumidores actuales no se rompan.
|
|
15
|
+
export { ExternalShippingStatus } from '../card/enums/ExternalShippingStatus';
|