@fiado/type-kit 3.235.0 → 3.236.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/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +11 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.js +15 -0
- package/bin/index.d.ts +0 -1
- package/bin/index.js +1 -5
- package/bin/loanConfig/enums/ModifiableByRoleEnum.d.ts +11 -0
- package/bin/loanConfig/enums/ModifiableByRoleEnum.js +15 -0
- package/bin/places/dtos/CashInFeeDto.d.ts +17 -0
- package/bin/places/dtos/CashInFeeDto.js +12 -0
- package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +22 -0
- package/bin/{shipping/dtos/ShippingRecipient.js → platformRbac/dtos/ResendOtpRequest.js} +16 -16
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
- package/bin/{shipping/dtos/ShippingDestinationAddress.js → platformRbac/dtos/ResendSelfRegisterOtpRequest.js} +16 -26
- package/bin/retailWizard/dtos/requests/ConfirmAddressRequest.d.ts +12 -4
- package/bin/retailWizard/dtos/requests/ConfirmAddressRequest.js +13 -5
- package/bin/retailWizard/dtos/requests/ProfileQuestionsRequest.d.ts +35 -0
- package/bin/retailWizard/dtos/requests/ProfileQuestionsRequest.js +75 -0
- package/bin/retailWizard/index.d.ts +1 -0
- package/bin/retailWizard/index.js +1 -0
- package/package.json +1 -1
- package/src/index.ts +0 -4
- package/src/retailWizard/dtos/requests/ConfirmAddressRequest.ts +13 -8
- package/src/retailWizard/dtos/requests/ProfileQuestionsRequest.ts +63 -0
- package/src/retailWizard/index.ts +1 -0
- package/_test_/unit/shipping/CreateShippingRequest.validation.test.ts +0 -71
- package/bin/identity/enums/SelfieSourceEnum.d.ts +0 -10
- package/bin/identity/enums/SelfieSourceEnum.js +0 -14
- package/bin/shipping/dtos/CreateShippingRequest.d.ts +0 -25
- package/bin/shipping/dtos/CreateShippingRequest.js +0 -76
- package/bin/shipping/dtos/CreateShippingResponse.d.ts +0 -5
- package/bin/shipping/dtos/CreateShippingResponse.js +0 -6
- package/bin/shipping/dtos/ShippingDestinationAddress.d.ts +0 -8
- package/bin/shipping/dtos/ShippingRecipient.d.ts +0 -6
- package/bin/shipping/dtos/UpdateShippingStatusRequest.d.ts +0 -15
- package/bin/shipping/dtos/UpdateShippingStatusRequest.js +0 -55
- package/bin/shipping/enums/DeliveryTypeEnum.d.ts +0 -4
- package/bin/shipping/enums/DeliveryTypeEnum.js +0 -8
- package/bin/shipping/enums/ShippingContentType.d.ts +0 -9
- package/bin/shipping/enums/ShippingContentType.js +0 -13
- package/bin/shipping/index.d.ts +0 -8
- package/bin/shipping/index.js +0 -31
- package/src/shipping/dtos/CreateShippingRequest.ts +0 -60
- package/src/shipping/dtos/CreateShippingResponse.ts +0 -6
- package/src/shipping/dtos/ShippingDestinationAddress.ts +0 -27
- package/src/shipping/dtos/ShippingRecipient.ts +0 -19
- package/src/shipping/dtos/UpdateShippingStatusRequest.ts +0 -35
- package/src/shipping/enums/DeliveryTypeEnum.ts +0 -4
- package/src/shipping/enums/ShippingContentType.ts +0 -9
- package/src/shipping/index.ts +0 -15
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum BenefitFlowEnum {
|
|
2
|
+
TOPUPS = "TOPUPS",
|
|
3
|
+
BILL_PAYMENT = "BILL_PAYMENT",
|
|
4
|
+
CREDIT = "CREDIT",
|
|
5
|
+
INSURANCE = "INSURANCE",
|
|
6
|
+
DONATION = "DONATION",
|
|
7
|
+
PHARMACY = "PHARMACY",
|
|
8
|
+
REMITTANCE = "REMITTANCE",
|
|
9
|
+
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
10
|
+
WALLET_FUNDING = "WALLET_FUNDING"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BenefitFlowEnum = void 0;
|
|
4
|
+
var BenefitFlowEnum;
|
|
5
|
+
(function (BenefitFlowEnum) {
|
|
6
|
+
BenefitFlowEnum["TOPUPS"] = "TOPUPS";
|
|
7
|
+
BenefitFlowEnum["BILL_PAYMENT"] = "BILL_PAYMENT";
|
|
8
|
+
BenefitFlowEnum["CREDIT"] = "CREDIT";
|
|
9
|
+
BenefitFlowEnum["INSURANCE"] = "INSURANCE";
|
|
10
|
+
BenefitFlowEnum["DONATION"] = "DONATION";
|
|
11
|
+
BenefitFlowEnum["PHARMACY"] = "PHARMACY";
|
|
12
|
+
BenefitFlowEnum["REMITTANCE"] = "REMITTANCE";
|
|
13
|
+
/** Fondeo de wallet PCF con efectivo via provider externo (Equality/Passport, OpenPay, …) — spec 13. */
|
|
14
|
+
BenefitFlowEnum["WALLET_FUNDING"] = "WALLET_FUNDING";
|
|
15
|
+
})(BenefitFlowEnum || (exports.BenefitFlowEnum = BenefitFlowEnum = {}));
|
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.
|
|
41
|
+
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,7 +185,3 @@ __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"));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rol RBAC mínimo que puede modificar un parámetro (RBAC a nivel de parámetro, modelo-datos §8).
|
|
3
|
+
* `retailer_admin` = "Admin VentasLuga" de M6 §8. Valores = identificadores de rol de RBAC F0.
|
|
4
|
+
* TD-004: confirmar mapeo super_admin ↔ platform_super_admin con el naming real de F0.
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ModifiableByRoleEnum {
|
|
8
|
+
SUPER_ADMIN = "super_admin",
|
|
9
|
+
SOFOM_ADMIN = "sofom_admin",
|
|
10
|
+
RETAILER_ADMIN = "retailer_admin"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModifiableByRoleEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Rol RBAC mínimo que puede modificar un parámetro (RBAC a nivel de parámetro, modelo-datos §8).
|
|
6
|
+
* `retailer_admin` = "Admin VentasLuga" de M6 §8. Valores = identificadores de rol de RBAC F0.
|
|
7
|
+
* TD-004: confirmar mapeo super_admin ↔ platform_super_admin con el naming real de F0.
|
|
8
|
+
* @enum {string}
|
|
9
|
+
*/
|
|
10
|
+
var ModifiableByRoleEnum;
|
|
11
|
+
(function (ModifiableByRoleEnum) {
|
|
12
|
+
ModifiableByRoleEnum["SUPER_ADMIN"] = "super_admin";
|
|
13
|
+
ModifiableByRoleEnum["SOFOM_ADMIN"] = "sofom_admin";
|
|
14
|
+
ModifiableByRoleEnum["RETAILER_ADMIN"] = "retailer_admin";
|
|
15
|
+
})(ModifiableByRoleEnum || (exports.ModifiableByRoleEnum = ModifiableByRoleEnum = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CurrencyId } from '../../currency/enums/CurrencyId';
|
|
2
|
+
/**
|
|
3
|
+
* Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
|
|
4
|
+
* - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
|
|
5
|
+
* - Passport (MX): por red → `fixed` + `percentage`.
|
|
6
|
+
* Response DTO — sin decoradores de validación.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CashInFeeDto {
|
|
9
|
+
/** Comisión fija, en la moneda del país. */
|
|
10
|
+
fixed?: number;
|
|
11
|
+
/** Porcentaje del monto depositado (0–100). */
|
|
12
|
+
percentage?: number;
|
|
13
|
+
/** Tope máximo de comisión (GreenDot: el asociado cobra hasta este cap). */
|
|
14
|
+
cap?: number;
|
|
15
|
+
/** Moneda del fee: USD (GreenDot) | MXN (Passport). */
|
|
16
|
+
currency: CurrencyId;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CashInFeeDto = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Comisión que cobra un punto de cash-in (lo que el lambda MUESTRA, no cobra).
|
|
6
|
+
* - GreenDot (US): representativo por cadena → `fixed` + `cap` (cada tienda cobra hasta el tope).
|
|
7
|
+
* - Passport (MX): por red → `fixed` + `percentage`.
|
|
8
|
+
* Response DTO — sin decoradores de validación.
|
|
9
|
+
*/
|
|
10
|
+
class CashInFeeDto {
|
|
11
|
+
}
|
|
12
|
+
exports.CashInFeeDto = CashInFeeDto;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MfaMethodEnum } from '../enums/MfaMethodEnum';
|
|
2
|
+
/**
|
|
3
|
+
* Body del POST /auth/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
4
|
+
* Reenvía el OTP del login re-disparando el challenge real CUSTOM_AUTH (EMAIL_OTP) para la
|
|
5
|
+
* identidad SIN password. `tenantId` obligatorio (DEC-064 — el picker ya lo resolvió, NO "solo email").
|
|
6
|
+
* El email se normaliza lowercase server-side. Postura anti-enumeración: respuesta 200 genérica
|
|
7
|
+
* siempre, sin filtrar existencia (ver AuthLoginManager.resendChallengeOtp).
|
|
8
|
+
*/
|
|
9
|
+
export declare class ResendOtpRequest {
|
|
10
|
+
email: string;
|
|
11
|
+
tenantId: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Respuesta del resend-otp. `session`/`mfaMethod` frescos del nuevo challenge CUSTOM_AUTH.
|
|
15
|
+
* Plain sin validators (no validamos lo que mandamos al cliente — fiado-validation-and-dtos § 7).
|
|
16
|
+
* Ambos opcionales: en los caminos de rechazo silencioso (anti-enumeración) o ramas sin CUSTOM_AUTH
|
|
17
|
+
* el server responde 200 genérico sin session ni método.
|
|
18
|
+
*/
|
|
19
|
+
export interface ResendOtpResponse {
|
|
20
|
+
session?: string;
|
|
21
|
+
mfaMethod?: MfaMethodEnum;
|
|
22
|
+
}
|
|
@@ -9,28 +9,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.ResendOtpRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
13
14
|
const class_validator_1 = require("class-validator");
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Body del POST /auth/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
17
|
+
* Reenvía el OTP del login re-disparando el challenge real CUSTOM_AUTH (EMAIL_OTP) para la
|
|
18
|
+
* identidad SIN password. `tenantId` obligatorio (DEC-064 — el picker ya lo resolvió, NO "solo email").
|
|
19
|
+
* El email se normaliza lowercase server-side. Postura anti-enumeración: respuesta 200 genérica
|
|
20
|
+
* siempre, sin filtrar existencia (ver AuthLoginManager.resendChallengeOtp).
|
|
21
|
+
*/
|
|
22
|
+
class ResendOtpRequest {
|
|
15
23
|
}
|
|
16
|
-
exports.
|
|
24
|
+
exports.ResendOtpRequest = ResendOtpRequest;
|
|
17
25
|
__decorate([
|
|
18
|
-
(0,
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsEmail)(),
|
|
19
28
|
(0, class_validator_1.IsNotEmpty)(),
|
|
20
29
|
__metadata("design:type", String)
|
|
21
|
-
],
|
|
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);
|
|
30
|
+
], ResendOtpRequest.prototype, "email", void 0);
|
|
27
31
|
__decorate([
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
28
33
|
(0, class_validator_1.IsString)(),
|
|
29
34
|
(0, class_validator_1.IsNotEmpty)(),
|
|
30
35
|
__metadata("design:type", String)
|
|
31
|
-
],
|
|
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);
|
|
36
|
+
], ResendOtpRequest.prototype, "tenantId", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
3
|
+
* Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
|
|
4
|
+
* `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
|
|
5
|
+
* server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
|
|
6
|
+
* scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
|
|
7
|
+
*/
|
|
8
|
+
export declare class ResendSelfRegisterOtpRequest {
|
|
9
|
+
tenantId: string;
|
|
10
|
+
email: string;
|
|
11
|
+
}
|
|
@@ -9,38 +9,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.ResendSelfRegisterOtpRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
13
14
|
const class_validator_1 = require("class-validator");
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Body del POST /self-register/resend-otp (público, anónimo). DEC-RBAC-054.
|
|
17
|
+
* Re-envía el OTP del autoregistro (mecanismo messages-business, NO Cognito) tras validar un
|
|
18
|
+
* `pending` existente. Misma postura anti-enumeración del start. El email se normaliza lowercase
|
|
19
|
+
* server-side. DTO propio por endpoint (NO reusa SelfRegisterStartRequest, que exige roleId/scope/
|
|
20
|
+
* scopeRef, ni SelfRegisterVerifyOtpRequest, que exige otp).
|
|
21
|
+
*/
|
|
22
|
+
class ResendSelfRegisterOtpRequest {
|
|
15
23
|
}
|
|
16
|
-
exports.
|
|
24
|
+
exports.ResendSelfRegisterOtpRequest = ResendSelfRegisterOtpRequest;
|
|
17
25
|
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
18
27
|
(0, class_validator_1.IsString)(),
|
|
19
28
|
(0, class_validator_1.IsNotEmpty)(),
|
|
20
29
|
__metadata("design:type", String)
|
|
21
|
-
],
|
|
30
|
+
], ResendSelfRegisterOtpRequest.prototype, "tenantId", void 0);
|
|
22
31
|
__decorate([
|
|
23
|
-
(0,
|
|
24
|
-
(0, class_validator_1.
|
|
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)(),
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
(0, class_validator_1.IsEmail)(),
|
|
44
34
|
(0, class_validator_1.IsNotEmpty)(),
|
|
45
35
|
__metadata("design:type", String)
|
|
46
|
-
],
|
|
36
|
+
], ResendSelfRegisterOtpRequest.prototype, "email", void 0);
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RetailAddress } from '../../../retailCustomer/dtos/RetailAddress';
|
|
2
2
|
/**
|
|
3
|
-
* POST /wizard/sessions/:id/address/confirm — el cliente ratifica
|
|
4
|
-
*
|
|
3
|
+
* POST /wizard/sessions/:id/address/confirm — el cliente ratifica el domicilio del INE o captura uno
|
|
4
|
+
* nuevo en el paso 10. Setea `addressConfirmed` y lo persiste en `fiado-address-lambda`.
|
|
5
|
+
* SureKeep Fase 2 — pista Retail.
|
|
6
|
+
*
|
|
7
|
+
* `address` usa el espejo ligero `RetailAddress` (todos los campos opcionales), NO el `AddressBase`
|
|
8
|
+
* canónico: cierra TD-ADDRESSBASE-OCR en este boundary. `AddressBase` exige ~12 campos (`tenantId`,
|
|
9
|
+
* `provider`, `validFrom`, `addressStatus`, `countryId`, `typeOfAddressId`…) que ni el OCR del INE ni
|
|
10
|
+
* el vendedor tienen, así que con `@ValidateNested` un domicilio perfectamente válido se rechazaba en
|
|
11
|
+
* runtime con 400. Es la MISMA deuda que ya había vaciado el domicilio en el upsert-from-kyc, y el
|
|
12
|
+
* único consumidor de este DTO es SureKeep.
|
|
5
13
|
*/
|
|
6
14
|
export declare class ConfirmAddressRequest {
|
|
7
|
-
address?:
|
|
15
|
+
address?: RetailAddress;
|
|
8
16
|
confirmed: boolean;
|
|
9
17
|
}
|
|
@@ -12,10 +12,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ConfirmAddressRequest = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
-
const
|
|
15
|
+
const RetailAddress_1 = require("../../../retailCustomer/dtos/RetailAddress");
|
|
16
16
|
/**
|
|
17
|
-
* POST /wizard/sessions/:id/address/confirm — el cliente ratifica
|
|
18
|
-
*
|
|
17
|
+
* POST /wizard/sessions/:id/address/confirm — el cliente ratifica el domicilio del INE o captura uno
|
|
18
|
+
* nuevo en el paso 10. Setea `addressConfirmed` y lo persiste en `fiado-address-lambda`.
|
|
19
|
+
* SureKeep Fase 2 — pista Retail.
|
|
20
|
+
*
|
|
21
|
+
* `address` usa el espejo ligero `RetailAddress` (todos los campos opcionales), NO el `AddressBase`
|
|
22
|
+
* canónico: cierra TD-ADDRESSBASE-OCR en este boundary. `AddressBase` exige ~12 campos (`tenantId`,
|
|
23
|
+
* `provider`, `validFrom`, `addressStatus`, `countryId`, `typeOfAddressId`…) que ni el OCR del INE ni
|
|
24
|
+
* el vendedor tienen, así que con `@ValidateNested` un domicilio perfectamente válido se rechazaba en
|
|
25
|
+
* runtime con 400. Es la MISMA deuda que ya había vaciado el domicilio en el upsert-from-kyc, y el
|
|
26
|
+
* único consumidor de este DTO es SureKeep.
|
|
19
27
|
*/
|
|
20
28
|
class ConfirmAddressRequest {
|
|
21
29
|
}
|
|
@@ -23,9 +31,9 @@ exports.ConfirmAddressRequest = ConfirmAddressRequest;
|
|
|
23
31
|
__decorate([
|
|
24
32
|
(0, class_transformer_1.Expose)(),
|
|
25
33
|
(0, class_validator_1.IsOptional)(),
|
|
26
|
-
(0, class_transformer_1.Type)(() =>
|
|
34
|
+
(0, class_transformer_1.Type)(() => RetailAddress_1.RetailAddress),
|
|
27
35
|
(0, class_validator_1.ValidateNested)(),
|
|
28
|
-
__metadata("design:type",
|
|
36
|
+
__metadata("design:type", RetailAddress_1.RetailAddress)
|
|
29
37
|
], ConfirmAddressRequest.prototype, "address", void 0);
|
|
30
38
|
__decorate([
|
|
31
39
|
(0, class_transformer_1.Expose)(),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /wizard/sessions/:id/profile-questions — el perfil transaccional del cliente (paso 10).
|
|
3
|
+
*
|
|
4
|
+
* Son las preguntas de PLD que el expediente PagoConFiado exige para el Nivel 2: de dónde sale su
|
|
5
|
+
* dinero, cuánto mueve y si actúa por cuenta propia. Viven en People de Fiado, igual que la ocupación
|
|
6
|
+
* (D17); SureKeep no las duplica.
|
|
7
|
+
*
|
|
8
|
+
* Los valores NO son libres: salen del catálogo de Fiado (`AppSelectionData_GT`), el mismo que
|
|
9
|
+
* alimenta los dropdowns de la app del cliente. El wizard los expone al front por su proxy de
|
|
10
|
+
* catálogos — mandar un valor fuera de catálogo deja un expediente que ningún backoffice sabe pintar,
|
|
11
|
+
* y nadie lo rechaza en runtime porque del otro lado son strings libres.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ `beneficialOwner` debe ser `SELF` para que la cuenta pueda abrir: `fiado-card-business` valida
|
|
14
|
+
* exactamente ese valor. `OTHER` ("viene de otra persona") es una respuesta legítima del cliente que
|
|
15
|
+
* BLOQUEA la apertura — la pantalla tiene que advertirlo antes, no descubrirlo después.
|
|
16
|
+
*
|
|
17
|
+
* SureKeep Fase 2 — pista Retail.
|
|
18
|
+
*/
|
|
19
|
+
/** `dataType=MonthlyIncomeMXN` — ingreso mensual declarado. */
|
|
20
|
+
export declare const MONTHLY_INCOME_VALUES: readonly ["0", "10000", "20000", "50000", "100000", "150000"];
|
|
21
|
+
/** `dataType=ExtraSupport` — apoyo económico extra mensual. */
|
|
22
|
+
export declare const EXTRA_SUPPORT_VALUES: readonly ["0", "2000", "10000", "20000", "50000", "60000"];
|
|
23
|
+
/** `dataType=MoneyUsageCategories` — para qué usará el dinero. */
|
|
24
|
+
export declare const USAGE_MONTHLY_VALUES: readonly ["DAILY_EXPENSES", "SAVINGS", "OTHER"];
|
|
25
|
+
/** `dataType=PurchaseAmountMaxMXN` — monto máximo por operación. */
|
|
26
|
+
export declare const MAXIMUM_TX_VALUES: readonly ["10000", "100000", "300000"];
|
|
27
|
+
/** `dataType=BeneficialOwnerMXN` — de quién es el dinero. */
|
|
28
|
+
export declare const BENEFICIAL_OWNER_VALUES: readonly ["SELF", "OTHER"];
|
|
29
|
+
export declare class ProfileQuestionsRequest {
|
|
30
|
+
monthlyIncome: string;
|
|
31
|
+
monthlyExtraSupport: string;
|
|
32
|
+
usageMonthly: string;
|
|
33
|
+
maximumTx: string;
|
|
34
|
+
beneficialOwner: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProfileQuestionsRequest = exports.BENEFICIAL_OWNER_VALUES = exports.MAXIMUM_TX_VALUES = exports.USAGE_MONTHLY_VALUES = exports.EXTRA_SUPPORT_VALUES = exports.MONTHLY_INCOME_VALUES = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* POST /wizard/sessions/:id/profile-questions — el perfil transaccional del cliente (paso 10).
|
|
17
|
+
*
|
|
18
|
+
* Son las preguntas de PLD que el expediente PagoConFiado exige para el Nivel 2: de dónde sale su
|
|
19
|
+
* dinero, cuánto mueve y si actúa por cuenta propia. Viven en People de Fiado, igual que la ocupación
|
|
20
|
+
* (D17); SureKeep no las duplica.
|
|
21
|
+
*
|
|
22
|
+
* Los valores NO son libres: salen del catálogo de Fiado (`AppSelectionData_GT`), el mismo que
|
|
23
|
+
* alimenta los dropdowns de la app del cliente. El wizard los expone al front por su proxy de
|
|
24
|
+
* catálogos — mandar un valor fuera de catálogo deja un expediente que ningún backoffice sabe pintar,
|
|
25
|
+
* y nadie lo rechaza en runtime porque del otro lado son strings libres.
|
|
26
|
+
*
|
|
27
|
+
* ⚠️ `beneficialOwner` debe ser `SELF` para que la cuenta pueda abrir: `fiado-card-business` valida
|
|
28
|
+
* exactamente ese valor. `OTHER` ("viene de otra persona") es una respuesta legítima del cliente que
|
|
29
|
+
* BLOQUEA la apertura — la pantalla tiene que advertirlo antes, no descubrirlo después.
|
|
30
|
+
*
|
|
31
|
+
* SureKeep Fase 2 — pista Retail.
|
|
32
|
+
*/
|
|
33
|
+
/** `dataType=MonthlyIncomeMXN` — ingreso mensual declarado. */
|
|
34
|
+
exports.MONTHLY_INCOME_VALUES = ['0', '10000', '20000', '50000', '100000', '150000'];
|
|
35
|
+
/** `dataType=ExtraSupport` — apoyo económico extra mensual. */
|
|
36
|
+
exports.EXTRA_SUPPORT_VALUES = ['0', '2000', '10000', '20000', '50000', '60000'];
|
|
37
|
+
/** `dataType=MoneyUsageCategories` — para qué usará el dinero. */
|
|
38
|
+
exports.USAGE_MONTHLY_VALUES = ['DAILY_EXPENSES', 'SAVINGS', 'OTHER'];
|
|
39
|
+
/** `dataType=PurchaseAmountMaxMXN` — monto máximo por operación. */
|
|
40
|
+
exports.MAXIMUM_TX_VALUES = ['10000', '100000', '300000'];
|
|
41
|
+
/** `dataType=BeneficialOwnerMXN` — de quién es el dinero. */
|
|
42
|
+
exports.BENEFICIAL_OWNER_VALUES = ['SELF', 'OTHER'];
|
|
43
|
+
class ProfileQuestionsRequest {
|
|
44
|
+
}
|
|
45
|
+
exports.ProfileQuestionsRequest = ProfileQuestionsRequest;
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_transformer_1.Expose)(),
|
|
48
|
+
(0, class_validator_1.IsString)(),
|
|
49
|
+
(0, class_validator_1.IsIn)(exports.MONTHLY_INCOME_VALUES),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], ProfileQuestionsRequest.prototype, "monthlyIncome", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_transformer_1.Expose)(),
|
|
54
|
+
(0, class_validator_1.IsString)(),
|
|
55
|
+
(0, class_validator_1.IsIn)(exports.EXTRA_SUPPORT_VALUES),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], ProfileQuestionsRequest.prototype, "monthlyExtraSupport", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_transformer_1.Expose)(),
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
(0, class_validator_1.IsIn)(exports.USAGE_MONTHLY_VALUES),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], ProfileQuestionsRequest.prototype, "usageMonthly", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, class_transformer_1.Expose)(),
|
|
66
|
+
(0, class_validator_1.IsString)(),
|
|
67
|
+
(0, class_validator_1.IsIn)(exports.MAXIMUM_TX_VALUES),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], ProfileQuestionsRequest.prototype, "maximumTx", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_transformer_1.Expose)(),
|
|
72
|
+
(0, class_validator_1.IsString)(),
|
|
73
|
+
(0, class_validator_1.IsIn)(exports.BENEFICIAL_OWNER_VALUES),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], ProfileQuestionsRequest.prototype, "beneficialOwner", void 0);
|
|
@@ -45,6 +45,7 @@ export * from './dtos/requests/CompleteSaleRequest';
|
|
|
45
45
|
export * from './dtos/requests/AppInstallLinkRequest';
|
|
46
46
|
export * from './dtos/requests/MarkPcfCardDeliveredRequest';
|
|
47
47
|
export * from './dtos/requests/ConfirmAddressRequest';
|
|
48
|
+
export * from './dtos/requests/ProfileQuestionsRequest';
|
|
48
49
|
export * from './dtos/requests/SaveBeneficiaryRequest';
|
|
49
50
|
export * from './dtos/requests/SignBeneficiaryAnnexRequest';
|
|
50
51
|
export * from './dtos/requests/WelcomeTopupRequest';
|
|
@@ -66,6 +66,7 @@ __exportStar(require("./dtos/requests/CompleteSaleRequest"), exports);
|
|
|
66
66
|
__exportStar(require("./dtos/requests/AppInstallLinkRequest"), exports);
|
|
67
67
|
__exportStar(require("./dtos/requests/MarkPcfCardDeliveredRequest"), exports);
|
|
68
68
|
__exportStar(require("./dtos/requests/ConfirmAddressRequest"), exports);
|
|
69
|
+
__exportStar(require("./dtos/requests/ProfileQuestionsRequest"), exports);
|
|
69
70
|
__exportStar(require("./dtos/requests/SaveBeneficiaryRequest"), exports);
|
|
70
71
|
__exportStar(require("./dtos/requests/SignBeneficiaryAnnexRequest"), exports);
|
|
71
72
|
__exportStar(require("./dtos/requests/WelcomeTopupRequest"), exports);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -144,7 +144,3 @@ 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';
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { Expose, Type } from 'class-transformer';
|
|
2
2
|
import { IsBoolean, IsOptional, ValidateNested } from 'class-validator';
|
|
3
|
-
import {
|
|
3
|
+
import { RetailAddress } from '../../../retailCustomer/dtos/RetailAddress';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* POST /wizard/sessions/:id/address/confirm — el cliente ratifica
|
|
7
|
-
*
|
|
6
|
+
* POST /wizard/sessions/:id/address/confirm — el cliente ratifica el domicilio del INE o captura uno
|
|
7
|
+
* nuevo en el paso 10. Setea `addressConfirmed` y lo persiste en `fiado-address-lambda`.
|
|
8
|
+
* SureKeep Fase 2 — pista Retail.
|
|
9
|
+
*
|
|
10
|
+
* `address` usa el espejo ligero `RetailAddress` (todos los campos opcionales), NO el `AddressBase`
|
|
11
|
+
* canónico: cierra TD-ADDRESSBASE-OCR en este boundary. `AddressBase` exige ~12 campos (`tenantId`,
|
|
12
|
+
* `provider`, `validFrom`, `addressStatus`, `countryId`, `typeOfAddressId`…) que ni el OCR del INE ni
|
|
13
|
+
* el vendedor tienen, así que con `@ValidateNested` un domicilio perfectamente válido se rechazaba en
|
|
14
|
+
* runtime con 400. Es la MISMA deuda que ya había vaciado el domicilio en el upsert-from-kyc, y el
|
|
15
|
+
* único consumidor de este DTO es SureKeep.
|
|
8
16
|
*/
|
|
9
17
|
export class ConfirmAddressRequest {
|
|
10
|
-
// TD-ADDRESSBASE-OCR: reusa el `AddressBase` canónico por decisión de Andrés (apego al spec + modelo-datos).
|
|
11
|
-
// La dirección OCR/editada puede NO llenar los ~12 campos requeridos de AddressBase → posible rechazo en
|
|
12
|
-
// runtime con @ValidateNested. Ajustar después (ver RetailCustomer.address).
|
|
13
18
|
@Expose()
|
|
14
19
|
@IsOptional()
|
|
15
|
-
@Type(() =>
|
|
20
|
+
@Type(() => RetailAddress)
|
|
16
21
|
@ValidateNested()
|
|
17
|
-
address?:
|
|
22
|
+
address?: RetailAddress;
|
|
18
23
|
|
|
19
24
|
@Expose()
|
|
20
25
|
@IsBoolean()
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsIn, IsString } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* POST /wizard/sessions/:id/profile-questions — el perfil transaccional del cliente (paso 10).
|
|
6
|
+
*
|
|
7
|
+
* Son las preguntas de PLD que el expediente PagoConFiado exige para el Nivel 2: de dónde sale su
|
|
8
|
+
* dinero, cuánto mueve y si actúa por cuenta propia. Viven en People de Fiado, igual que la ocupación
|
|
9
|
+
* (D17); SureKeep no las duplica.
|
|
10
|
+
*
|
|
11
|
+
* Los valores NO son libres: salen del catálogo de Fiado (`AppSelectionData_GT`), el mismo que
|
|
12
|
+
* alimenta los dropdowns de la app del cliente. El wizard los expone al front por su proxy de
|
|
13
|
+
* catálogos — mandar un valor fuera de catálogo deja un expediente que ningún backoffice sabe pintar,
|
|
14
|
+
* y nadie lo rechaza en runtime porque del otro lado son strings libres.
|
|
15
|
+
*
|
|
16
|
+
* ⚠️ `beneficialOwner` debe ser `SELF` para que la cuenta pueda abrir: `fiado-card-business` valida
|
|
17
|
+
* exactamente ese valor. `OTHER` ("viene de otra persona") es una respuesta legítima del cliente que
|
|
18
|
+
* BLOQUEA la apertura — la pantalla tiene que advertirlo antes, no descubrirlo después.
|
|
19
|
+
*
|
|
20
|
+
* SureKeep Fase 2 — pista Retail.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** `dataType=MonthlyIncomeMXN` — ingreso mensual declarado. */
|
|
24
|
+
export const MONTHLY_INCOME_VALUES = ['0', '10000', '20000', '50000', '100000', '150000'] as const;
|
|
25
|
+
|
|
26
|
+
/** `dataType=ExtraSupport` — apoyo económico extra mensual. */
|
|
27
|
+
export const EXTRA_SUPPORT_VALUES = ['0', '2000', '10000', '20000', '50000', '60000'] as const;
|
|
28
|
+
|
|
29
|
+
/** `dataType=MoneyUsageCategories` — para qué usará el dinero. */
|
|
30
|
+
export const USAGE_MONTHLY_VALUES = ['DAILY_EXPENSES', 'SAVINGS', 'OTHER'] as const;
|
|
31
|
+
|
|
32
|
+
/** `dataType=PurchaseAmountMaxMXN` — monto máximo por operación. */
|
|
33
|
+
export const MAXIMUM_TX_VALUES = ['10000', '100000', '300000'] as const;
|
|
34
|
+
|
|
35
|
+
/** `dataType=BeneficialOwnerMXN` — de quién es el dinero. */
|
|
36
|
+
export const BENEFICIAL_OWNER_VALUES = ['SELF', 'OTHER'] as const;
|
|
37
|
+
|
|
38
|
+
export class ProfileQuestionsRequest {
|
|
39
|
+
@Expose()
|
|
40
|
+
@IsString()
|
|
41
|
+
@IsIn(MONTHLY_INCOME_VALUES as unknown as string[])
|
|
42
|
+
monthlyIncome!: string;
|
|
43
|
+
|
|
44
|
+
@Expose()
|
|
45
|
+
@IsString()
|
|
46
|
+
@IsIn(EXTRA_SUPPORT_VALUES as unknown as string[])
|
|
47
|
+
monthlyExtraSupport!: string;
|
|
48
|
+
|
|
49
|
+
@Expose()
|
|
50
|
+
@IsString()
|
|
51
|
+
@IsIn(USAGE_MONTHLY_VALUES as unknown as string[])
|
|
52
|
+
usageMonthly!: string;
|
|
53
|
+
|
|
54
|
+
@Expose()
|
|
55
|
+
@IsString()
|
|
56
|
+
@IsIn(MAXIMUM_TX_VALUES as unknown as string[])
|
|
57
|
+
maximumTx!: string;
|
|
58
|
+
|
|
59
|
+
@Expose()
|
|
60
|
+
@IsString()
|
|
61
|
+
@IsIn(BENEFICIAL_OWNER_VALUES as unknown as string[])
|
|
62
|
+
beneficialOwner!: string;
|
|
63
|
+
}
|
|
@@ -54,6 +54,7 @@ export * from './dtos/requests/CompleteSaleRequest';
|
|
|
54
54
|
export * from './dtos/requests/AppInstallLinkRequest';
|
|
55
55
|
export * from './dtos/requests/MarkPcfCardDeliveredRequest';
|
|
56
56
|
export * from './dtos/requests/ConfirmAddressRequest';
|
|
57
|
+
export * from './dtos/requests/ProfileQuestionsRequest';
|
|
57
58
|
export * from './dtos/requests/SaveBeneficiaryRequest';
|
|
58
59
|
export * from './dtos/requests/SignBeneficiaryAnnexRequest';
|
|
59
60
|
export * from './dtos/requests/WelcomeTopupRequest';
|
|
@@ -1,71 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Con qué criterio se resolvió cuál archivo de S3 es la selfie del usuario.
|
|
3
|
-
* Le dice al consumidor qué tan confiable es el match antes de mandarla a un facematch.
|
|
4
|
-
*/
|
|
5
|
-
export declare enum SelfieSourceEnum {
|
|
6
|
-
/** Matcheó el verificationId de la verificación vigente en People. */
|
|
7
|
-
VERIFICATION = "VERIFICATION",
|
|
8
|
-
/** No hubo match por verificación: se tomó el archivo de selfie más reciente del bucket. */
|
|
9
|
-
LATEST = "LATEST"
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SelfieSourceEnum = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Con qué criterio se resolvió cuál archivo de S3 es la selfie del usuario.
|
|
6
|
-
* Le dice al consumidor qué tan confiable es el match antes de mandarla a un facematch.
|
|
7
|
-
*/
|
|
8
|
-
var SelfieSourceEnum;
|
|
9
|
-
(function (SelfieSourceEnum) {
|
|
10
|
-
/** Matcheó el verificationId de la verificación vigente en People. */
|
|
11
|
-
SelfieSourceEnum["VERIFICATION"] = "VERIFICATION";
|
|
12
|
-
/** No hubo match por verificación: se tomó el archivo de selfie más reciente del bucket. */
|
|
13
|
-
SelfieSourceEnum["LATEST"] = "LATEST";
|
|
14
|
-
})(SelfieSourceEnum || (exports.SelfieSourceEnum = SelfieSourceEnum = {}));
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
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);
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
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);
|
|
@@ -1,8 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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 = {}));
|
package/bin/shipping/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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';
|
package/bin/shipping/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
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; } });
|
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
package/src/shipping/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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';
|