@fiado/type-kit 3.494.0 → 3.496.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/loanCredit/dtos/createSellerPaymentRequest.test.ts +63 -0
- package/_test_/unit/loanCredit/dtos/originateLoanCreditRequest.test.ts +56 -0
- package/_test_/unit/loanCredit/inStorePaymentDtos.test.ts +141 -0
- package/_test_/unit/loanCredit/sellerCreditDtos.test.ts +119 -0
- package/_test_/unit/retailIntegration/applyRetailEventRequest.test.ts +43 -0
- package/_test_/unit/retailIntegration/isIsoDateTimeWithZone.test.ts +85 -0
- package/_test_/unit/retailIntegration/receiveRetailEventRequest.test.ts +93 -0
- package/_test_/unit/retailIntegration/retailOutboundRequests.test.ts +69 -0
- package/_test_/unit/retailIntegration/retailSystemEnums.test.ts +42 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +3 -1
- package/bin/loanCredit/dtos/requests/CreateSellerPaymentRequest.d.ts +15 -0
- package/bin/loanCredit/dtos/requests/CreateSellerPaymentRequest.js +56 -0
- package/bin/loanCredit/dtos/requests/InStorePaymentDetail.d.ts +12 -0
- package/bin/loanCredit/dtos/requests/InStorePaymentDetail.js +40 -0
- package/bin/loanCredit/dtos/requests/OriginateLoanCreditRequest.d.ts +7 -3
- package/bin/loanCredit/dtos/requests/OriginateLoanCreditRequest.js +8 -1
- package/bin/loanCredit/dtos/responses/CreditCustomerListItem.d.ts +46 -0
- package/bin/loanCredit/dtos/responses/CreditCustomerListItem.js +2 -0
- package/bin/loanCredit/dtos/responses/CreditSaleContext.d.ts +2 -0
- package/bin/loanCredit/dtos/responses/InStorePaymentListItem.d.ts +19 -0
- package/bin/loanCredit/dtos/responses/InStorePaymentListItem.js +2 -0
- package/bin/loanCredit/dtos/responses/LoanPaymentListItem.d.ts +14 -1
- package/bin/loanCredit/dtos/responses/SellerCreditDetailResponse.d.ts +10 -0
- package/bin/loanCredit/dtos/responses/SellerCreditDetailResponse.js +2 -0
- package/bin/loanCredit/dtos/responses/SellerCreditListResponse.d.ts +7 -0
- package/bin/loanCredit/dtos/responses/SellerCreditListResponse.js +2 -0
- package/bin/loanCredit/dtos/responses/SellerCreditLookupResult.d.ts +10 -0
- package/bin/loanCredit/dtos/responses/SellerCreditLookupResult.js +2 -0
- package/bin/loanCredit/dtos/responses/SellerCreditRow.d.ts +25 -0
- package/bin/loanCredit/dtos/responses/SellerCreditRow.js +2 -0
- package/bin/loanCredit/dtos/responses/SellerPaymentOptions.d.ts +36 -0
- package/bin/loanCredit/dtos/responses/SellerPaymentOptions.js +2 -0
- package/bin/loanCredit/dtos/responses/SellerPaymentResult.d.ts +39 -0
- package/bin/loanCredit/dtos/responses/SellerPaymentResult.js +2 -0
- package/bin/loanCredit/enums/CreditCustomerStateEnum.d.ts +6 -0
- package/bin/loanCredit/enums/CreditCustomerStateEnum.js +10 -0
- package/bin/loanCredit/enums/InStorePaymentMethodEnum.d.ts +6 -0
- package/bin/loanCredit/enums/InStorePaymentMethodEnum.js +10 -0
- package/bin/loanCredit/enums/LoanPaymentOriginEnum.d.ts +5 -0
- package/bin/loanCredit/enums/LoanPaymentOriginEnum.js +9 -0
- package/bin/loanCredit/index.d.ts +13 -0
- package/bin/loanCredit/index.js +15 -0
- package/bin/retailIntegration/constants/retailIntegrationLimits.d.ts +7 -0
- package/bin/retailIntegration/constants/retailIntegrationLimits.js +10 -0
- package/bin/retailIntegration/dtos/ApplyRetailEventRequest.d.ts +29 -0
- package/bin/retailIntegration/dtos/ApplyRetailEventRequest.js +54 -0
- package/bin/retailIntegration/dtos/GetRetailInventoryRequest.d.ts +5 -0
- package/bin/retailIntegration/dtos/GetRetailInventoryRequest.js +23 -0
- package/bin/retailIntegration/dtos/ListRetailCatalogRequest.d.ts +4 -0
- package/bin/retailIntegration/dtos/ListRetailCatalogRequest.js +8 -0
- package/bin/retailIntegration/dtos/ListRetailStoresRequest.d.ts +4 -0
- package/bin/retailIntegration/dtos/ListRetailStoresRequest.js +8 -0
- package/bin/retailIntegration/dtos/ListRetailUsersRequest.d.ts +5 -0
- package/bin/retailIntegration/dtos/ListRetailUsersRequest.js +24 -0
- package/bin/retailIntegration/dtos/ReceiveInventoryEventRequest.d.ts +6 -0
- package/bin/retailIntegration/dtos/ReceiveInventoryEventRequest.js +23 -0
- package/bin/retailIntegration/dtos/ReceiveProductEventRequest.d.ts +6 -0
- package/bin/retailIntegration/dtos/ReceiveProductEventRequest.js +23 -0
- package/bin/retailIntegration/dtos/ReceiveRetailEventRequest.d.ts +12 -0
- package/bin/retailIntegration/dtos/ReceiveRetailEventRequest.js +2 -0
- package/bin/retailIntegration/dtos/ReceiveRetailUserEventRequest.d.ts +6 -0
- package/bin/retailIntegration/dtos/ReceiveRetailUserEventRequest.js +23 -0
- package/bin/retailIntegration/dtos/ReceiveStoreEventRequest.d.ts +6 -0
- package/bin/retailIntegration/dtos/ReceiveStoreEventRequest.js +23 -0
- package/bin/retailIntegration/dtos/RegisterRetailSaleRequest.d.ts +4 -0
- package/bin/retailIntegration/dtos/RegisterRetailSaleRequest.js +8 -0
- package/bin/retailIntegration/dtos/RetailEventEnvelope.d.ts +8 -0
- package/bin/retailIntegration/dtos/RetailEventEnvelope.js +33 -0
- package/bin/retailIntegration/dtos/RetailEventResult.d.ts +12 -0
- package/bin/retailIntegration/dtos/RetailEventResult.js +2 -0
- package/bin/retailIntegration/dtos/RetailOutboundResponses.d.ts +30 -0
- package/bin/retailIntegration/dtos/RetailOutboundResponses.js +2 -0
- package/bin/retailIntegration/dtos/RetailPagedQuery.d.ts +6 -0
- package/bin/retailIntegration/dtos/RetailPagedQuery.js +34 -0
- package/bin/retailIntegration/dtos/RetailTenantQuery.d.ts +4 -0
- package/bin/retailIntegration/dtos/RetailTenantQuery.js +23 -0
- package/bin/retailIntegration/enums/InventoryEventTypeEnum.d.ts +4 -0
- package/bin/retailIntegration/enums/InventoryEventTypeEnum.js +8 -0
- package/bin/retailIntegration/enums/ProductEventTypeEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/ProductEventTypeEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailCurrencyEnum.d.ts +5 -0
- package/bin/retailIntegration/enums/RetailCurrencyEnum.js +9 -0
- package/bin/retailIntegration/enums/RetailEventResultEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/RetailEventResultEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailFinancierEnum.d.ts +8 -0
- package/bin/retailIntegration/enums/RetailFinancierEnum.js +12 -0
- package/bin/retailIntegration/enums/RetailLinePaymentTypeEnum.d.ts +5 -0
- package/bin/retailIntegration/enums/RetailLinePaymentTypeEnum.js +9 -0
- package/bin/retailIntegration/enums/RetailMdmProviderEnum.d.ts +5 -0
- package/bin/retailIntegration/enums/RetailMdmProviderEnum.js +9 -0
- package/bin/retailIntegration/enums/RetailPaymentMethodEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/RetailPaymentMethodEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailPieceReasonEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/RetailPieceReasonEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailPieceStatusEnum.d.ts +7 -0
- package/bin/retailIntegration/enums/RetailPieceStatusEnum.js +11 -0
- package/bin/retailIntegration/enums/RetailProductCategoryEnum.d.ts +7 -0
- package/bin/retailIntegration/enums/RetailProductCategoryEnum.js +11 -0
- package/bin/retailIntegration/enums/RetailProductStatusEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/RetailProductStatusEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailProductTierEnum.d.ts +7 -0
- package/bin/retailIntegration/enums/RetailProductTierEnum.js +11 -0
- package/bin/retailIntegration/enums/RetailSaleFinancierEnum.d.ts +9 -0
- package/bin/retailIntegration/enums/RetailSaleFinancierEnum.js +13 -0
- package/bin/retailIntegration/enums/RetailSaleTypeEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/RetailSaleTypeEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailStoreStatusEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/RetailStoreStatusEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailTrackingModeEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/RetailTrackingModeEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailUserAccessStatusEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/RetailUserAccessStatusEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailUserEventTypeEnum.d.ts +7 -0
- package/bin/retailIntegration/enums/RetailUserEventTypeEnum.js +11 -0
- package/bin/retailIntegration/enums/RetailUserRoleEnum.d.ts +7 -0
- package/bin/retailIntegration/enums/RetailUserRoleEnum.js +11 -0
- package/bin/retailIntegration/enums/StoreEventTypeEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/StoreEventTypeEnum.js +10 -0
- package/bin/retailIntegration/enums/index.d.ts +21 -0
- package/bin/retailIntegration/enums/index.js +37 -0
- package/bin/retailIntegration/index.d.ts +25 -0
- package/bin/retailIntegration/index.js +41 -0
- package/bin/retailIntegration/models/RetailPageMeta.d.ts +10 -0
- package/bin/retailIntegration/models/RetailPageMeta.js +2 -0
- package/bin/retailIntegration/models/RetailSystemInventory.d.ts +17 -0
- package/bin/retailIntegration/models/RetailSystemInventory.js +2 -0
- package/bin/retailIntegration/models/RetailSystemProduct.d.ts +32 -0
- package/bin/retailIntegration/models/RetailSystemProduct.js +2 -0
- package/bin/retailIntegration/models/RetailSystemSale.d.ts +46 -0
- package/bin/retailIntegration/models/RetailSystemSale.js +2 -0
- package/bin/retailIntegration/models/RetailSystemStore.d.ts +29 -0
- package/bin/retailIntegration/models/RetailSystemStore.js +2 -0
- package/bin/retailIntegration/models/RetailSystemUser.d.ts +14 -0
- package/bin/retailIntegration/models/RetailSystemUser.js +2 -0
- package/bin/retailIntegration/validators/IsIsoDateTimeWithZone.d.ts +6 -0
- package/bin/retailIntegration/validators/IsIsoDateTimeWithZone.js +29 -0
- package/bin/retailWizard/dtos/WizardSessionLookupEntry.d.ts +2 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/loanCredit/dtos/requests/CreateSellerPaymentRequest.ts +40 -0
- package/src/loanCredit/dtos/requests/InStorePaymentDetail.ts +27 -0
- package/src/loanCredit/dtos/requests/OriginateLoanCreditRequest.ts +12 -3
- package/src/loanCredit/dtos/responses/CreditCustomerListItem.ts +51 -0
- package/src/loanCredit/dtos/responses/CreditSaleContext.ts +2 -0
- package/src/loanCredit/dtos/responses/InStorePaymentListItem.ts +21 -0
- package/src/loanCredit/dtos/responses/LoanPaymentListItem.ts +11 -1
- package/src/loanCredit/dtos/responses/SellerCreditDetailResponse.ts +11 -0
- package/src/loanCredit/dtos/responses/SellerCreditListResponse.ts +8 -0
- package/src/loanCredit/dtos/responses/SellerCreditLookupResult.ts +11 -0
- package/src/loanCredit/dtos/responses/SellerCreditRow.ts +26 -0
- package/src/loanCredit/dtos/responses/SellerPaymentOptions.ts +29 -0
- package/src/loanCredit/dtos/responses/SellerPaymentResult.ts +43 -0
- package/src/loanCredit/enums/CreditCustomerStateEnum.ts +6 -0
- package/src/loanCredit/enums/InStorePaymentMethodEnum.ts +6 -0
- package/src/loanCredit/enums/LoanPaymentOriginEnum.ts +5 -0
- package/src/loanCredit/index.ts +16 -0
- package/src/retailIntegration/constants/retailIntegrationLimits.ts +9 -0
- package/src/retailIntegration/dtos/ApplyRetailEventRequest.ts +49 -0
- package/src/retailIntegration/dtos/GetRetailInventoryRequest.ts +9 -0
- package/src/retailIntegration/dtos/ListRetailCatalogRequest.ts +4 -0
- package/src/retailIntegration/dtos/ListRetailStoresRequest.ts +4 -0
- package/src/retailIntegration/dtos/ListRetailUsersRequest.ts +10 -0
- package/src/retailIntegration/dtos/ReceiveInventoryEventRequest.ts +9 -0
- package/src/retailIntegration/dtos/ReceiveProductEventRequest.ts +9 -0
- package/src/retailIntegration/dtos/ReceiveRetailEventRequest.ts +18 -0
- package/src/retailIntegration/dtos/ReceiveRetailUserEventRequest.ts +9 -0
- package/src/retailIntegration/dtos/ReceiveStoreEventRequest.ts +9 -0
- package/src/retailIntegration/dtos/RegisterRetailSaleRequest.ts +4 -0
- package/src/retailIntegration/dtos/RetailEventEnvelope.ts +20 -0
- package/src/retailIntegration/dtos/RetailEventResult.ts +14 -0
- package/src/retailIntegration/dtos/RetailOutboundResponses.ts +35 -0
- package/src/retailIntegration/dtos/RetailPagedQuery.ts +19 -0
- package/src/retailIntegration/dtos/RetailTenantQuery.ts +9 -0
- package/src/retailIntegration/enums/InventoryEventTypeEnum.ts +4 -0
- package/src/retailIntegration/enums/ProductEventTypeEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailCurrencyEnum.ts +5 -0
- package/src/retailIntegration/enums/RetailEventResultEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailFinancierEnum.ts +8 -0
- package/src/retailIntegration/enums/RetailLinePaymentTypeEnum.ts +5 -0
- package/src/retailIntegration/enums/RetailMdmProviderEnum.ts +5 -0
- package/src/retailIntegration/enums/RetailPaymentMethodEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailPieceReasonEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailPieceStatusEnum.ts +7 -0
- package/src/retailIntegration/enums/RetailProductCategoryEnum.ts +7 -0
- package/src/retailIntegration/enums/RetailProductStatusEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailProductTierEnum.ts +7 -0
- package/src/retailIntegration/enums/RetailSaleFinancierEnum.ts +9 -0
- package/src/retailIntegration/enums/RetailSaleTypeEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailStoreStatusEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailTrackingModeEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailUserAccessStatusEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailUserEventTypeEnum.ts +7 -0
- package/src/retailIntegration/enums/RetailUserRoleEnum.ts +7 -0
- package/src/retailIntegration/enums/StoreEventTypeEnum.ts +6 -0
- package/src/retailIntegration/enums/index.ts +21 -0
- package/src/retailIntegration/index.ts +25 -0
- package/src/retailIntegration/models/RetailPageMeta.ts +11 -0
- package/src/retailIntegration/models/RetailSystemInventory.ts +20 -0
- package/src/retailIntegration/models/RetailSystemProduct.ts +43 -0
- package/src/retailIntegration/models/RetailSystemSale.ts +51 -0
- package/src/retailIntegration/models/RetailSystemStore.ts +33 -0
- package/src/retailIntegration/models/RetailSystemUser.ts +16 -0
- package/src/retailIntegration/validators/IsIsoDateTimeWithZone.ts +21 -0
- package/src/retailWizard/dtos/WizardSessionLookupEntry.ts +2 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IsObject, IsString, Matches, MaxLength, Validate } from 'class-validator';
|
|
2
|
+
import { RETAIL_EVENT_ID_MAX_LENGTH } from '../constants/retailIntegrationLimits';
|
|
3
|
+
import { IsIsoDateTimeWithZone } from '../validators/IsIsoDateTimeWithZone';
|
|
4
|
+
|
|
5
|
+
/** Payload del evento: el connector no lo valida, lo valida el lambda destino. */
|
|
6
|
+
export type RetailEventPayload = Record<string, unknown>;
|
|
7
|
+
|
|
8
|
+
/** Campos comunes del sobre de un webhook; cada ruta agrega su `eventType`. */
|
|
9
|
+
export abstract class RetailEventEnvelope {
|
|
10
|
+
@IsString()
|
|
11
|
+
@Matches(/\S/)
|
|
12
|
+
@MaxLength(RETAIL_EVENT_ID_MAX_LENGTH)
|
|
13
|
+
eventId!: string;
|
|
14
|
+
|
|
15
|
+
@Validate(IsIsoDateTimeWithZone)
|
|
16
|
+
occurredAt!: string;
|
|
17
|
+
|
|
18
|
+
@IsObject()
|
|
19
|
+
payload!: RetailEventPayload;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RetailEventResultEnum } from '../enums/RetailEventResultEnum';
|
|
2
|
+
|
|
3
|
+
/** Resultado de un evento; `code` explica un `REJECTED` y es `null` en los demás. */
|
|
4
|
+
export interface RetailEventResult {
|
|
5
|
+
eventId: string;
|
|
6
|
+
result: RetailEventResultEnum;
|
|
7
|
+
code: string | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type ReceiveStoreEventResponse = RetailEventResult;
|
|
11
|
+
export type ReceiveRetailUserEventResponse = RetailEventResult;
|
|
12
|
+
export type ReceiveProductEventResponse = RetailEventResult;
|
|
13
|
+
export type ReceiveInventoryEventResponse = RetailEventResult;
|
|
14
|
+
export type ReceiveRetailEventResponse = RetailEventResult;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RetailInventoryMeta, RetailPageMeta } from '../models/RetailPageMeta';
|
|
2
|
+
import { RetailSystemPiece, RetailSystemStock } from '../models/RetailSystemInventory';
|
|
3
|
+
import { RetailSystemProduct } from '../models/RetailSystemProduct';
|
|
4
|
+
import { RetailSystemStore } from '../models/RetailSystemStore';
|
|
5
|
+
import { RetailSystemUser } from '../models/RetailSystemUser';
|
|
6
|
+
|
|
7
|
+
/** `data` de `GET /private/retail/stores`. */
|
|
8
|
+
export interface ListRetailStoresResponse {
|
|
9
|
+
items: RetailSystemStore[];
|
|
10
|
+
meta: RetailPageMeta;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** `data` de `GET /private/retail/catalog`. */
|
|
14
|
+
export interface ListRetailCatalogResponse {
|
|
15
|
+
items: RetailSystemProduct[];
|
|
16
|
+
meta: RetailPageMeta;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** `data` de `GET /private/retail/inventory`. */
|
|
20
|
+
export interface GetRetailInventoryResponse {
|
|
21
|
+
pieces: RetailSystemPiece[];
|
|
22
|
+
stock: RetailSystemStock[];
|
|
23
|
+
meta: RetailInventoryMeta;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** `data` de `GET /private/retail/users`. */
|
|
27
|
+
export interface ListRetailUsersResponse {
|
|
28
|
+
items: RetailSystemUser[];
|
|
29
|
+
meta: RetailPageMeta;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** `data` de `POST /private/retail/sales`: el id de la venta en el sistema del retailer. */
|
|
33
|
+
export interface RegisterRetailSaleResponse {
|
|
34
|
+
externalSaleId: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { IsInt, IsOptional, IsString, Matches, Max, Min } from 'class-validator';
|
|
3
|
+
import { RETAIL_LIST_LIMIT_MAX, RETAIL_LIST_LIMIT_MIN } from '../constants/retailIntegrationLimits';
|
|
4
|
+
import { RetailTenantQuery } from './RetailTenantQuery';
|
|
5
|
+
|
|
6
|
+
/** Base de las listas paginadas; `nextToken` es opaco y viaja tal cual. */
|
|
7
|
+
export class RetailPagedQuery extends RetailTenantQuery {
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@Type(() => Number)
|
|
10
|
+
@IsInt()
|
|
11
|
+
@Min(RETAIL_LIST_LIMIT_MIN)
|
|
12
|
+
@Max(RETAIL_LIST_LIMIT_MAX)
|
|
13
|
+
limit?: number;
|
|
14
|
+
|
|
15
|
+
@IsOptional()
|
|
16
|
+
@IsString()
|
|
17
|
+
@Matches(/\S/)
|
|
18
|
+
nextToken?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IsString, Matches } from 'class-validator';
|
|
2
|
+
import { RETAIL_TENANT_ID_PATTERN } from '../constants/retailIntegrationLimits';
|
|
3
|
+
|
|
4
|
+
/** Base de toda llamada de salida: el tenant cuyo retailer se consulta. */
|
|
5
|
+
export class RetailTenantQuery {
|
|
6
|
+
@IsString()
|
|
7
|
+
@Matches(RETAIL_TENANT_ID_PATTERN)
|
|
8
|
+
tenantId!: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** `eventType` válidos en `POST /webhooks/users`. */
|
|
2
|
+
export enum RetailUserEventTypeEnum {
|
|
3
|
+
RETAIL_USER_CREATED_V1 = 'RetailUserCreatedV1',
|
|
4
|
+
RETAIL_USER_UPDATED_V1 = 'RetailUserUpdatedV1',
|
|
5
|
+
RETAIL_USER_TRANSFERRED_V1 = 'RetailUserTransferredV1',
|
|
6
|
+
RETAIL_USER_STATUS_CHANGED_V1 = 'RetailUserStatusChangedV1',
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './RetailEventResultEnum';
|
|
2
|
+
export * from './StoreEventTypeEnum';
|
|
3
|
+
export * from './RetailUserEventTypeEnum';
|
|
4
|
+
export * from './ProductEventTypeEnum';
|
|
5
|
+
export * from './InventoryEventTypeEnum';
|
|
6
|
+
export * from './RetailStoreStatusEnum';
|
|
7
|
+
export * from './RetailProductCategoryEnum';
|
|
8
|
+
export * from './RetailTrackingModeEnum';
|
|
9
|
+
export * from './RetailProductTierEnum';
|
|
10
|
+
export * from './RetailCurrencyEnum';
|
|
11
|
+
export * from './RetailFinancierEnum';
|
|
12
|
+
export * from './RetailMdmProviderEnum';
|
|
13
|
+
export * from './RetailProductStatusEnum';
|
|
14
|
+
export * from './RetailPieceStatusEnum';
|
|
15
|
+
export * from './RetailPieceReasonEnum';
|
|
16
|
+
export * from './RetailUserRoleEnum';
|
|
17
|
+
export * from './RetailUserAccessStatusEnum';
|
|
18
|
+
export * from './RetailSaleTypeEnum';
|
|
19
|
+
export * from './RetailSaleFinancierEnum';
|
|
20
|
+
export * from './RetailPaymentMethodEnum';
|
|
21
|
+
export * from './RetailLinePaymentTypeEnum';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './constants/retailIntegrationLimits';
|
|
2
|
+
export * from './enums';
|
|
3
|
+
export * from './validators/IsIsoDateTimeWithZone';
|
|
4
|
+
export * from './dtos/RetailEventEnvelope';
|
|
5
|
+
export * from './dtos/ReceiveStoreEventRequest';
|
|
6
|
+
export * from './dtos/ReceiveRetailUserEventRequest';
|
|
7
|
+
export * from './dtos/ReceiveProductEventRequest';
|
|
8
|
+
export * from './dtos/ReceiveInventoryEventRequest';
|
|
9
|
+
export * from './dtos/ReceiveRetailEventRequest';
|
|
10
|
+
export * from './dtos/RetailEventResult';
|
|
11
|
+
export * from './dtos/ApplyRetailEventRequest';
|
|
12
|
+
export * from './dtos/RetailTenantQuery';
|
|
13
|
+
export * from './dtos/RetailPagedQuery';
|
|
14
|
+
export * from './dtos/ListRetailStoresRequest';
|
|
15
|
+
export * from './dtos/ListRetailCatalogRequest';
|
|
16
|
+
export * from './dtos/GetRetailInventoryRequest';
|
|
17
|
+
export * from './dtos/ListRetailUsersRequest';
|
|
18
|
+
export * from './dtos/RegisterRetailSaleRequest';
|
|
19
|
+
export * from './dtos/RetailOutboundResponses';
|
|
20
|
+
export * from './models/RetailPageMeta';
|
|
21
|
+
export * from './models/RetailSystemStore';
|
|
22
|
+
export * from './models/RetailSystemProduct';
|
|
23
|
+
export * from './models/RetailSystemInventory';
|
|
24
|
+
export * from './models/RetailSystemUser';
|
|
25
|
+
export * from './models/RetailSystemSale';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** `meta` de una lista paginada del retailer; `nextToken` en `null` cierra la lectura. */
|
|
2
|
+
export interface RetailPageMeta {
|
|
3
|
+
count: number;
|
|
4
|
+
nextToken: string | null;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** `meta` del inventario de una tienda. */
|
|
8
|
+
export interface RetailInventoryMeta {
|
|
9
|
+
storeId: string;
|
|
10
|
+
generatedAt: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RetailPieceReasonEnum, RetailPieceStatusEnum } from '../enums';
|
|
2
|
+
|
|
3
|
+
export type RetailPieceStatus = `${RetailPieceStatusEnum}`;
|
|
4
|
+
export type RetailPieceReason = `${RetailPieceReasonEnum}`;
|
|
5
|
+
|
|
6
|
+
/** Pieza con IMEI o número de serie. */
|
|
7
|
+
export interface RetailSystemPiece {
|
|
8
|
+
sku: string;
|
|
9
|
+
identifier: string;
|
|
10
|
+
storeId: string;
|
|
11
|
+
status: RetailPieceStatus;
|
|
12
|
+
reason: RetailPieceReason | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Existencia de un producto sin identificador por unidad. */
|
|
16
|
+
export interface RetailSystemStock {
|
|
17
|
+
sku: string;
|
|
18
|
+
storeId: string;
|
|
19
|
+
qty: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RetailCurrencyEnum,
|
|
3
|
+
RetailFinancierEnum,
|
|
4
|
+
RetailMdmProviderEnum,
|
|
5
|
+
RetailProductCategoryEnum,
|
|
6
|
+
RetailProductStatusEnum,
|
|
7
|
+
RetailProductTierEnum,
|
|
8
|
+
RetailTrackingModeEnum,
|
|
9
|
+
} from '../enums';
|
|
10
|
+
|
|
11
|
+
export type RetailProductCategory = `${RetailProductCategoryEnum}`;
|
|
12
|
+
export type RetailTrackingMode = `${RetailTrackingModeEnum}`;
|
|
13
|
+
export type RetailProductTier = `${RetailProductTierEnum}`;
|
|
14
|
+
export type RetailCurrency = `${RetailCurrencyEnum}`;
|
|
15
|
+
export type RetailFinancier = `${RetailFinancierEnum}`;
|
|
16
|
+
export type RetailMdmProvider = `${RetailMdmProviderEnum}`;
|
|
17
|
+
export type RetailProductStatus = `${RetailProductStatusEnum}`;
|
|
18
|
+
|
|
19
|
+
/** Precios como decimal en string con dos decimales. */
|
|
20
|
+
export interface RetailSystemProductPrice {
|
|
21
|
+
basePrice: string;
|
|
22
|
+
listPrice: string | null;
|
|
23
|
+
effectiveFrom: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Producto tal como lo define la doc de integración. */
|
|
27
|
+
export interface RetailSystemProduct {
|
|
28
|
+
sku: string;
|
|
29
|
+
externalId: string;
|
|
30
|
+
brand: string;
|
|
31
|
+
model: string;
|
|
32
|
+
color: string | null;
|
|
33
|
+
capacity: string | null;
|
|
34
|
+
description: string | null;
|
|
35
|
+
category: RetailProductCategory;
|
|
36
|
+
trackingMode: RetailTrackingMode;
|
|
37
|
+
tier: RetailProductTier | null;
|
|
38
|
+
currencyId: RetailCurrency;
|
|
39
|
+
price: RetailSystemProductPrice;
|
|
40
|
+
eligibleFinanciers: RetailFinancier[];
|
|
41
|
+
mdmProvider: RetailMdmProvider | null;
|
|
42
|
+
status: RetailProductStatus;
|
|
43
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { RetailLinePaymentTypeEnum, RetailPaymentMethodEnum, RetailSaleFinancierEnum, RetailSaleTypeEnum } from '../enums';
|
|
2
|
+
import { RetailCurrency } from './RetailSystemProduct';
|
|
3
|
+
|
|
4
|
+
export type RetailSaleType = `${RetailSaleTypeEnum}`;
|
|
5
|
+
export type RetailSaleFinancier = `${RetailSaleFinancierEnum}`;
|
|
6
|
+
export type RetailPaymentMethod = `${RetailPaymentMethodEnum}`;
|
|
7
|
+
export type RetailLinePaymentType = `${RetailLinePaymentTypeEnum}`;
|
|
8
|
+
|
|
9
|
+
export interface RetailSystemSaleCustomer {
|
|
10
|
+
customerId: string;
|
|
11
|
+
names: string;
|
|
12
|
+
paternalLastName: string;
|
|
13
|
+
maternalLastName: string | null;
|
|
14
|
+
phone: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface RetailSystemSaleComponent {
|
|
18
|
+
sku: string;
|
|
19
|
+
qty: number;
|
|
20
|
+
identifiers: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface RetailSystemSaleLine {
|
|
24
|
+
lineId: string;
|
|
25
|
+
sku: string;
|
|
26
|
+
qty: number;
|
|
27
|
+
basePrice: string;
|
|
28
|
+
discount: string;
|
|
29
|
+
paymentType: RetailLinePaymentType;
|
|
30
|
+
financedAmount: string;
|
|
31
|
+
role: 'GIFT' | null;
|
|
32
|
+
components: RetailSystemSaleComponent[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Cuerpo de `POST /sales` de la doc; `saleId` es la llave de idempotencia. */
|
|
36
|
+
export interface RetailSystemSale {
|
|
37
|
+
saleId: string;
|
|
38
|
+
folio: string;
|
|
39
|
+
storeId: string;
|
|
40
|
+
sellerRetailUserId: string;
|
|
41
|
+
soldAt: string;
|
|
42
|
+
saleType: RetailSaleType;
|
|
43
|
+
financier: RetailSaleFinancier;
|
|
44
|
+
creditId: string | null;
|
|
45
|
+
currencyId: RetailCurrency;
|
|
46
|
+
customer: RetailSystemSaleCustomer;
|
|
47
|
+
equipmentPrice: string;
|
|
48
|
+
amountPaid: string;
|
|
49
|
+
paymentMethod: RetailPaymentMethod | null;
|
|
50
|
+
lines: RetailSystemSaleLine[];
|
|
51
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RetailStoreStatusEnum } from '../enums';
|
|
2
|
+
|
|
3
|
+
export type RetailStoreStatus = `${RetailStoreStatusEnum}`;
|
|
4
|
+
|
|
5
|
+
export interface RetailSystemStoreAddress {
|
|
6
|
+
address1: string;
|
|
7
|
+
externalNumber: string | null;
|
|
8
|
+
internalNumber: string | null;
|
|
9
|
+
neighborhood: string | null;
|
|
10
|
+
city: string;
|
|
11
|
+
state: string;
|
|
12
|
+
zipCode: string;
|
|
13
|
+
country: string | null;
|
|
14
|
+
reference: string | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface RetailSystemStoreLocation {
|
|
18
|
+
lat: number | null;
|
|
19
|
+
lng: number | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Tienda tal como la define la doc de integración. */
|
|
23
|
+
export interface RetailSystemStore {
|
|
24
|
+
storeId: string;
|
|
25
|
+
code: string;
|
|
26
|
+
name: string;
|
|
27
|
+
zoneId: string | null;
|
|
28
|
+
address: RetailSystemStoreAddress;
|
|
29
|
+
location: RetailSystemStoreLocation;
|
|
30
|
+
phone: string;
|
|
31
|
+
schedule: string | null;
|
|
32
|
+
status: RetailStoreStatus;
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RetailUserAccessStatusEnum, RetailUserRoleEnum } from '../enums';
|
|
2
|
+
|
|
3
|
+
export type RetailUserRole = `${RetailUserRoleEnum}`;
|
|
4
|
+
export type RetailUserAccessStatus = `${RetailUserAccessStatusEnum}`;
|
|
5
|
+
|
|
6
|
+
/** Usuario de la operación del retailer, tal como lo define la doc de integración. */
|
|
7
|
+
export interface RetailSystemUser {
|
|
8
|
+
retailUserId: string;
|
|
9
|
+
displayName: string;
|
|
10
|
+
email: string;
|
|
11
|
+
phone: string | null;
|
|
12
|
+
homeStoreId: string;
|
|
13
|
+
zoneId: string | null;
|
|
14
|
+
role: RetailUserRole;
|
|
15
|
+
status: RetailUserAccessStatus;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ValidatorConstraint, ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
const ISO_DATE_TIME_WITH_ZONE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?(Z|[+-]\d{2}:\d{2})$/;
|
|
4
|
+
|
|
5
|
+
/** Descarta fechas que `Date` recorre en silencio, como el 31 de febrero. */
|
|
6
|
+
function isRealCalendarDate(value: string): boolean {
|
|
7
|
+
const [year, month, day] = value.slice(0, 10).split('-').map(Number);
|
|
8
|
+
return !Number.isNaN(Date.parse(value)) && new Date(Date.UTC(year, month - 1, day)).getUTCDate() === day;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Acepta fecha y hora ISO-8601 con segundos y zona; sin zona se rechaza, como dice la doc. */
|
|
12
|
+
@ValidatorConstraint({ name: 'isIsoDateTimeWithZone', async: false })
|
|
13
|
+
export class IsIsoDateTimeWithZone implements ValidatorConstraintInterface {
|
|
14
|
+
validate(value: unknown): boolean {
|
|
15
|
+
return typeof value === 'string' && ISO_DATE_TIME_WITH_ZONE.test(value) && isRealCalendarDate(value);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
defaultMessage(): string {
|
|
19
|
+
return 'debe ser fecha y hora ISO-8601 con zona, por ejemplo 2026-08-17T20:32:05Z';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -25,4 +25,6 @@ export interface WizardSessionLookupEntry {
|
|
|
25
25
|
/** La venta que cerro esta sesion; `null` si todavia no cerro. */
|
|
26
26
|
saleId?: string | null;
|
|
27
27
|
folio?: string | null;
|
|
28
|
+
/** Vendedor de la sesión (`retailUserId` de retail-org). `null` si la sesión no lo tiene. */
|
|
29
|
+
sellerRetailUserId?: string | null;
|
|
28
30
|
}
|