@fiado/type-kit 3.551.0 → 3.553.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/common/InputPatternValidators.test.ts +64 -0
- package/_test_/unit/common/InputPatterns.test.ts +104 -0
- package/_test_/unit/retailCatalog/backofficeRequests.test.ts +1 -1
- package/_test_/unit/retailCatalog/singlePriceFields.test.ts +48 -0
- package/_test_/unit/retailIntegration/eventPayloads.test.ts +1 -0
- package/_test_/unit/retailOrg/dtos/requests/inputPatternRequests.test.ts +93 -0
- package/_test_/unit/retailPromotions/giftOptionValue.test.ts +20 -0
- package/_test_/unit/retailWizard/linesWithoutListPrice.test.ts +40 -0
- package/bin/common/constants/InputPatterns.d.ts +25 -0
- package/bin/common/constants/InputPatterns.js +28 -0
- package/bin/common/decorators/UpperCase.d.ts +2 -0
- package/bin/common/decorators/UpperCase.js +7 -0
- package/bin/common/helpers/imeiChecksum.d.ts +2 -0
- package/bin/common/helpers/imeiChecksum.js +20 -0
- package/bin/common/index.d.ts +8 -0
- package/bin/common/index.js +10 -0
- package/bin/common/validators/IsMxPhone.d.ts +3 -0
- package/bin/common/validators/IsMxPhone.js +8 -0
- package/bin/common/validators/IsMxZipCode.d.ts +3 -0
- package/bin/common/validators/IsMxZipCode.js +8 -0
- package/bin/common/validators/IsRfc.d.ts +3 -0
- package/bin/common/validators/IsRfc.js +8 -0
- package/bin/common/validators/IsSku.d.ts +3 -0
- package/bin/common/validators/IsSku.js +8 -0
- package/bin/common/validators/matchesInputPattern.d.ts +3 -0
- package/bin/common/validators/matchesInputPattern.js +16 -0
- package/bin/helpers/constans/regex.js +2 -1
- package/bin/loanCredit/dtos/LoanContractDetails.js +2 -2
- package/bin/loanCredit/dtos/LoanDeviceEnrollItem.js +4 -4
- package/bin/retailCatalog/constants/SkuPattern.d.ts +2 -2
- package/bin/retailCatalog/constants/SkuPattern.js +5 -3
- package/bin/retailCatalog/dtos/Product.d.ts +2 -1
- package/bin/retailCatalog/dtos/ProductComponent.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeCreateKitRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeCreateServiceRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeCreateSkuPriceRequest.d.ts +1 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateTransferRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterEntryRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/CreateProductRequest.d.ts +1 -0
- package/bin/retailCatalog/dtos/requests/CreateProductRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/ReturnPieceCondition.js +1 -1
- package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.d.ts +1 -0
- package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.js +1 -1
- package/bin/retailCatalog/dtos/requests/UpdateProductRequest.d.ts +1 -0
- package/bin/retailCatalog/dtos/responses/InventoryLensResponse.d.ts +1 -1
- package/bin/retailCatalog/dtos/responses/ReserveStockResponse.d.ts +4 -1
- package/bin/retailCatalog/dtos/responses/SkuPriceEntry.d.ts +2 -1
- package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +1 -1
- package/bin/retailIntegration/constants/retailIntegrationLimits.d.ts +1 -1
- package/bin/retailIntegration/constants/retailIntegrationLimits.js +2 -2
- package/bin/retailOrg/dtos/requests/CreateRetailUserRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/CreateRetailerRequest.d.ts +1 -1
- package/bin/retailOrg/dtos/requests/CreateRetailerRequest.js +6 -2
- package/bin/retailOrg/dtos/requests/CreateStoreRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/CreateSubdistributorRequest.d.ts +1 -1
- package/bin/retailOrg/dtos/requests/CreateSubdistributorRequest.js +6 -2
- package/bin/retailOrg/dtos/requests/ProvisionRetailUserRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/RetailAddressInput.d.ts +1 -1
- package/bin/retailOrg/dtos/requests/RetailAddressInput.js +2 -2
- package/bin/retailOrg/dtos/requests/UpdateRetailUserRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/UpdateRetailerRequest.js +2 -1
- package/bin/retailOrg/dtos/requests/UpdateStoreRequest.js +2 -1
- package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.d.ts +4 -1
- package/bin/retailWizard/dtos/SaleLine.d.ts +2 -1
- package/bin/retailWizard/dtos/WizardGiftLine.d.ts +1 -1
- package/bin/retailWizard/dtos/WizardLinePromotionFields.d.ts +1 -1
- package/bin/retailWizard/dtos/WizardReservedLine.d.ts +2 -1
- package/bin/retailWizard/events/SaleCompletedV1.d.ts +1 -1
- package/bin/retailWizard/events/SaleCompletedV2.d.ts +1 -1
- package/package.json +1 -1
- package/src/common/constants/InputPatterns.ts +32 -0
- package/src/common/decorators/UpperCase.ts +5 -0
- package/src/common/helpers/imeiChecksum.ts +16 -0
- package/src/common/index.ts +12 -0
- package/src/common/validators/IsMxPhone.ts +7 -0
- package/src/common/validators/IsMxZipCode.ts +7 -0
- package/src/common/validators/IsRfc.ts +7 -0
- package/src/common/validators/IsSku.ts +7 -0
- package/src/common/validators/matchesInputPattern.ts +24 -0
- package/src/helpers/constans/regex.ts +2 -1
- package/src/loanCredit/dtos/LoanContractDetails.ts +1 -1
- package/src/loanCredit/dtos/LoanDeviceEnrollItem.ts +3 -3
- package/src/retailCatalog/constants/SkuPattern.ts +2 -2
- package/src/retailCatalog/dtos/Product.ts +2 -1
- package/src/retailCatalog/dtos/ProductComponent.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeCreateKitRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeCreateProductRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeCreateServiceRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeCreateSkuPriceRequest.ts +1 -0
- package/src/retailCatalog/dtos/requests/BackofficeCreateTransferRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/BackofficeRegisterEntryRequest.ts +2 -2
- package/src/retailCatalog/dtos/requests/CreateProductRequest.ts +3 -2
- package/src/retailCatalog/dtos/requests/ReturnPieceCondition.ts +2 -2
- package/src/retailCatalog/dtos/requests/SyncInventoryRequest.ts +3 -2
- package/src/retailCatalog/dtos/requests/UpdateProductRequest.ts +1 -0
- package/src/retailCatalog/dtos/responses/InventoryLensResponse.ts +1 -1
- package/src/retailCatalog/dtos/responses/ReserveStockResponse.ts +4 -1
- package/src/retailCatalog/dtos/responses/SkuPriceEntry.ts +2 -1
- package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +1 -1
- package/src/retailIntegration/constants/retailIntegrationLimits.ts +2 -2
- package/src/retailOrg/dtos/requests/CreateRetailUserRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/CreateRetailerRequest.ts +8 -4
- package/src/retailOrg/dtos/requests/CreateStoreRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/CreateSubdistributorRequest.ts +8 -4
- package/src/retailOrg/dtos/requests/ProvisionRetailUserRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/RetailAddressInput.ts +3 -3
- package/src/retailOrg/dtos/requests/UpdateRetailUserRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/UpdateRetailerRequest.ts +2 -1
- package/src/retailOrg/dtos/requests/UpdateStoreRequest.ts +2 -1
- package/src/retailPromotions/dtos/responses/WizardSalePromotionResponses.ts +4 -1
- package/src/retailWizard/dtos/SaleLine.ts +2 -1
- package/src/retailWizard/dtos/WizardGiftLine.ts +1 -1
- package/src/retailWizard/dtos/WizardLinePromotionFields.ts +1 -1
- package/src/retailWizard/dtos/WizardReservedLine.ts +2 -1
- package/src/retailWizard/events/SaleCompletedV1.ts +1 -1
- package/src/retailWizard/events/SaleCompletedV2.ts +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Expose, Type } from 'class-transformer';
|
|
2
2
|
import { IsEmail, IsOptional, IsString, ValidateNested } from 'class-validator';
|
|
3
3
|
import { RetailAddressInput } from './RetailAddressInput';
|
|
4
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Body de PUT /retailers/:retailerId — edición de campos comerciales del retailer.
|
|
@@ -25,7 +26,7 @@ export class UpdateRetailerRequest {
|
|
|
25
26
|
|
|
26
27
|
@Expose()
|
|
27
28
|
@IsOptional()
|
|
28
|
-
@
|
|
29
|
+
@IsMxPhone()
|
|
29
30
|
contactPhone?: string;
|
|
30
31
|
|
|
31
32
|
@Expose()
|
|
@@ -2,6 +2,7 @@ import { Expose, Type } from 'class-transformer';
|
|
|
2
2
|
import { IsNumber, IsOptional, IsString, Length, ValidateNested } from 'class-validator';
|
|
3
3
|
import { GeoLocation } from '../GeoLocation';
|
|
4
4
|
import { RetailAddressInput } from './RetailAddressInput';
|
|
5
|
+
import { IsMxPhone } from '../../../common/validators/IsMxPhone';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Body de PUT /stores/:storeId — edición de tienda (campos editables opcionales). El status se
|
|
@@ -39,7 +40,7 @@ export class UpdateStoreRequest {
|
|
|
39
40
|
|
|
40
41
|
@Expose()
|
|
41
42
|
@IsOptional()
|
|
42
|
-
@
|
|
43
|
+
@IsMxPhone()
|
|
43
44
|
phone?: string;
|
|
44
45
|
|
|
45
46
|
@Expose()
|
|
@@ -46,7 +46,10 @@ export interface ListStoreSalePromotionsResponse {
|
|
|
46
46
|
export interface GiftOption {
|
|
47
47
|
sku: string;
|
|
48
48
|
name: string;
|
|
49
|
-
|
|
49
|
+
/** Valor del regalo: su precio de venta. */
|
|
50
|
+
valueCents?: number;
|
|
51
|
+
/** @deprecated Usa `valueCents`; trae el mismo valor. */
|
|
52
|
+
listPriceCents?: number;
|
|
50
53
|
inStock: boolean;
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -9,7 +9,8 @@ export interface SaleLine extends WizardLinePromotionFields {
|
|
|
9
9
|
sku: string;
|
|
10
10
|
qty: number;
|
|
11
11
|
basePriceCents: number;
|
|
12
|
-
|
|
12
|
+
/** @deprecated Ya no se escribe; el valor de un regalo vive en `originalPriceCents`. */
|
|
13
|
+
listPriceCents?: number | null;
|
|
13
14
|
/** Llave del registro PRICE# del que salió el precio. */
|
|
14
15
|
priceSk: string;
|
|
15
16
|
paymentType: LinePaymentTypeEnum;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WizardLineRoleEnum } from '../enums/WizardLineRoleEnum';
|
|
2
2
|
import type { WizardReservedLine } from './WizardReservedLine';
|
|
3
3
|
|
|
4
|
-
/** Línea GIFT: ligada a un ancla, con su promo y el
|
|
4
|
+
/** Línea GIFT: ligada a un ancla, con su promo y el valor del regalo (su precio de venta). */
|
|
5
5
|
export type WizardGiftLine = WizardReservedLine & {
|
|
6
6
|
role: WizardLineRoleEnum.GIFT;
|
|
7
7
|
linkedLineId: string;
|
|
@@ -12,7 +12,7 @@ export interface WizardLinePromotionFields {
|
|
|
12
12
|
discountCode?: string;
|
|
13
13
|
/** Descuento total de la línea; neto = basePriceCents × qty − discountCents. */
|
|
14
14
|
discountCents?: number;
|
|
15
|
-
/** Precio antes del descuento; en un regalo,
|
|
15
|
+
/** Precio antes del descuento; en un regalo, su precio de venta con la línea a $0. */
|
|
16
16
|
originalPriceCents?: number;
|
|
17
17
|
/** Descuento de cada promo en la línea; sin el campo, la de `promotionId` lleva todo menos el código. */
|
|
18
18
|
promotionDiscounts?: LinePromotionAmount[];
|
|
@@ -18,7 +18,8 @@ export interface WizardReservedLine extends WizardLinePromotionFields {
|
|
|
18
18
|
expiresAt: string;
|
|
19
19
|
/** Precio fijado de la línea (el del kit si es kit). */
|
|
20
20
|
basePriceCents: number | null;
|
|
21
|
-
|
|
21
|
+
/** @deprecated Ya no se escribe; el valor de un regalo vive en `originalPriceCents`. */
|
|
22
|
+
listPriceCents?: number | null;
|
|
22
23
|
/** Llave del registro PRICE# del que salió el precio. */
|
|
23
24
|
priceSk: string | null;
|
|
24
25
|
eligibleFinanciers: string[];
|
|
@@ -24,7 +24,7 @@ export interface SaleCompletedV1 {
|
|
|
24
24
|
* sin `type` un crédito con $1,300 de enganche era indistinguible de un contado de $1,300.
|
|
25
25
|
*/
|
|
26
26
|
type?: SaleTypeEnum;
|
|
27
|
-
/** Precio
|
|
27
|
+
/** Precio neto del equipo: su precio de venta menos su descuento. Sin equipo se omite. */
|
|
28
28
|
equipmentPriceCents?: number;
|
|
29
29
|
/** Enganche cobrado (solo `type=CREDIT`). */
|
|
30
30
|
downPaymentCents?: number;
|
|
@@ -31,7 +31,7 @@ export interface SaleCompletedV2 {
|
|
|
31
31
|
imei: string | null;
|
|
32
32
|
/** Lo COBRADO en caja. En contado == precio del equipo; en CREDIT es SOLO el enganche. */
|
|
33
33
|
amountCents: number;
|
|
34
|
-
/** Precio
|
|
34
|
+
/** Precio neto del equipo (venta menos descuento), la base de comisión. `null` sin el dato. */
|
|
35
35
|
equipmentPriceCents: number | null;
|
|
36
36
|
downPaymentCents: number | null;
|
|
37
37
|
creditId: string | null;
|