@fiado/type-kit 3.578.0 → 3.579.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/platformRbac/dtos/levelEntityAdminDtos.test.ts +14 -0
- package/_test_/unit/retailCatalog/catalogEnums.test.ts +2 -2
- package/_test_/unit/retailCatalog/centralSaleAccepted.test.ts +54 -0
- package/_test_/unit/retailCatalog/sellInventoryRequest.test.ts +25 -0
- package/_test_/unit/retailCatalog/stockRequests.test.ts +14 -4
- package/_test_/unit/retailCatalog/ventaSaga.test.ts +7 -0
- package/_test_/unit/retailIntegration/reconciliationContracts.test.ts +121 -0
- package/_test_/unit/retailIntegration/retailIntegrationErrorCodes.test.ts +37 -0
- package/_test_/unit/retailIntegration/retailOutboundRequests.test.ts +46 -15
- package/_test_/unit/retailIntegration/retailSaleContracts.test.ts +160 -0
- package/_test_/unit/retailIntegration/retailSystemEnums.test.ts +1 -1
- package/_test_/unit/retailOrg/dtos/retailerIntegration.test.ts +92 -0
- package/_test_/unit/retailWizard/centralOutboundAndLiveCheck.test.ts +63 -0
- package/_test_/unit/retailWizard/centralSaleStatus.test.ts +49 -0
- package/_test_/unit/retailWizard/multiItemShapes.test.ts +2 -2
- package/bin/platformRbac/dtos/UpdateLevelEntityRequest.d.ts +3 -1
- package/bin/platformRbac/dtos/UpdateLevelEntityRequest.js +8 -1
- package/bin/retailCatalog/dtos/requests/ReturnStockRequest.d.ts +2 -0
- package/bin/retailCatalog/dtos/requests/ReturnStockRequest.js +5 -0
- package/bin/retailCatalog/dtos/requests/SellInventoryRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/SellInventoryRequest.js +32 -0
- package/bin/retailCatalog/dtos/requests/SellStockRequest.d.ts +2 -2
- package/bin/retailCatalog/dtos/requests/SellStockRequest.js +1 -1
- package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.d.ts +2 -1
- package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.js +1 -0
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.d.ts +3 -1
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.js +2 -0
- package/bin/retailCatalog/events/InventoryCentralSaleAcceptedMessage.d.ts +13 -0
- package/bin/retailCatalog/events/InventoryCentralSaleAcceptedMessage.js +55 -0
- package/bin/retailCatalog/events/InventoryInboundMessage.d.ts +2 -1
- package/bin/retailCatalog/events/InventorySaleAppliedMessage.d.ts +0 -2
- package/bin/retailCatalog/events/InventorySaleAppliedMessage.js +0 -6
- package/bin/retailCatalog/index.d.ts +2 -0
- package/bin/retailCatalog/index.js +2 -0
- package/bin/retailIntegration/constants/retailIntegrationErrorHttpStatus.d.ts +3 -0
- package/bin/retailIntegration/constants/retailIntegrationErrorHttpStatus.js +19 -0
- package/bin/retailIntegration/constants/retailIntegrationLimits.d.ts +2 -0
- package/bin/retailIntegration/constants/retailIntegrationLimits.js +3 -1
- package/bin/retailIntegration/dtos/CancelRetailSaleRequest.d.ts +6 -0
- package/bin/retailIntegration/dtos/CancelRetailSaleRequest.js +32 -0
- package/bin/retailIntegration/dtos/CheckRetailInventoryRequest.d.ts +7 -0
- package/bin/retailIntegration/dtos/CheckRetailInventoryRequest.js +43 -0
- package/bin/retailIntegration/dtos/GetReconciliationResponses.d.ts +35 -0
- package/bin/retailIntegration/dtos/GetReconciliationResponses.js +2 -0
- package/bin/retailIntegration/dtos/GetRetailInventoryRequest.d.ts +2 -2
- package/bin/retailIntegration/dtos/GetRetailInventoryRequest.js +2 -2
- package/bin/retailIntegration/dtos/ReconciliationPageMessage.d.ts +13 -0
- package/bin/retailIntegration/dtos/ReconciliationPageMessage.js +48 -0
- package/bin/retailIntegration/dtos/ReconciliationRunCounts.d.ts +9 -0
- package/bin/retailIntegration/dtos/ReconciliationRunCounts.js +2 -0
- package/bin/retailIntegration/dtos/RetailListQuery.d.ts +5 -0
- package/bin/retailIntegration/dtos/RetailListQuery.js +24 -0
- package/bin/retailIntegration/dtos/RetailOutboundResponses.d.ts +9 -0
- package/bin/retailIntegration/dtos/RetailPagedQuery.d.ts +2 -2
- package/bin/retailIntegration/dtos/RetailPagedQuery.js +2 -2
- package/bin/retailIntegration/dtos/RetailTenantQuery.d.ts +2 -1
- package/bin/retailIntegration/dtos/RetailTenantQuery.js +6 -1
- package/bin/retailIntegration/dtos/StartCatalogReconciliationRequest.d.ts +11 -0
- package/bin/retailIntegration/dtos/StartCatalogReconciliationRequest.js +28 -0
- package/bin/retailIntegration/dtos/StartOrgReconciliationRequest.d.ts +9 -0
- package/bin/retailIntegration/dtos/StartOrgReconciliationRequest.js +22 -0
- package/bin/retailIntegration/enums/InactiveReasonEnum.d.ts +5 -0
- package/bin/retailIntegration/enums/InactiveReasonEnum.js +9 -0
- package/bin/retailIntegration/enums/ReconciliationEntityEnum.d.ts +7 -0
- package/bin/retailIntegration/enums/ReconciliationEntityEnum.js +11 -0
- package/bin/retailIntegration/enums/ReconciliationRunStatusEnum.d.ts +7 -0
- package/bin/retailIntegration/enums/ReconciliationRunStatusEnum.js +11 -0
- package/bin/retailIntegration/enums/ReconciliationTriggerEnum.d.ts +6 -0
- package/bin/retailIntegration/enums/ReconciliationTriggerEnum.js +10 -0
- package/bin/retailIntegration/enums/RetailEventRejectCodeEnum.d.ts +3 -1
- package/bin/retailIntegration/enums/RetailEventRejectCodeEnum.js +2 -0
- package/bin/retailIntegration/enums/RetailIntegrationErrorCodeEnum.d.ts +23 -0
- package/bin/retailIntegration/enums/RetailIntegrationErrorCodeEnum.js +27 -0
- package/bin/retailIntegration/enums/RetailSaleLineRoleEnum.d.ts +4 -0
- package/bin/retailIntegration/enums/RetailSaleLineRoleEnum.js +8 -0
- package/bin/retailIntegration/enums/index.d.ts +6 -0
- package/bin/retailIntegration/enums/index.js +6 -0
- package/bin/retailIntegration/index.d.ts +9 -0
- package/bin/retailIntegration/index.js +9 -0
- package/bin/retailIntegration/models/RetailSystemSale.d.ts +8 -7
- package/bin/retailIntegration/models/RetailSystemSale.js +186 -0
- package/bin/retailOrg/dtos/Retailer.d.ts +5 -0
- package/bin/retailOrg/dtos/Retailer.js +20 -0
- package/bin/retailOrg/dtos/requests/ActivateRetailerIntegrationRequest.d.ts +5 -0
- package/bin/retailOrg/dtos/requests/ActivateRetailerIntegrationRequest.js +24 -0
- package/bin/retailOrg/dtos/responses/ActivateRetailerIntegrationResponse.d.ts +3 -0
- package/bin/retailOrg/dtos/responses/ActivateRetailerIntegrationResponse.js +2 -0
- package/bin/retailOrg/dtos/validation/RetailerValidationDto.d.ts +4 -0
- package/bin/retailOrg/enums/RetailIntegrationSystemEnum.d.ts +4 -0
- package/bin/retailOrg/enums/RetailIntegrationSystemEnum.js +8 -0
- package/bin/retailOrg/index.d.ts +3 -0
- package/bin/retailOrg/index.js +3 -0
- package/bin/retailWizard/dtos/Sale.d.ts +25 -0
- package/bin/retailWizard/dtos/WizardReservedLine.d.ts +3 -0
- package/bin/retailWizard/dtos/WizardSession.d.ts +3 -0
- package/bin/retailWizard/enums/CentralCancelStatusEnum.d.ts +18 -0
- package/bin/retailWizard/enums/CentralCancelStatusEnum.js +22 -0
- package/bin/retailWizard/enums/CentralLiveCheckEnum.d.ts +10 -0
- package/bin/retailWizard/enums/CentralLiveCheckEnum.js +14 -0
- package/bin/retailWizard/enums/CentralSyncStatusEnum.d.ts +8 -2
- package/bin/retailWizard/enums/CentralSyncStatusEnum.js +7 -1
- package/bin/retailWizard/enums/RetailCentralOutboundMessageTypeEnum.d.ts +5 -0
- package/bin/retailWizard/enums/RetailCentralOutboundMessageTypeEnum.js +9 -0
- package/bin/retailWizard/enums/WizardLineStatusEnum.d.ts +3 -1
- package/bin/retailWizard/enums/WizardLineStatusEnum.js +2 -0
- package/bin/retailWizard/events/RetailCentralOutboundMessage.d.ts +9 -0
- package/bin/retailWizard/events/RetailCentralOutboundMessage.js +42 -0
- package/bin/retailWizard/index.d.ts +4 -0
- package/bin/retailWizard/index.js +4 -0
- package/package.json +1 -1
- package/src/platformRbac/dtos/UpdateLevelEntityRequest.ts +3 -1
- package/src/retailCatalog/dtos/requests/ReturnStockRequest.ts +6 -1
- package/src/retailCatalog/dtos/requests/SellInventoryRequest.ts +19 -0
- package/src/retailCatalog/dtos/requests/SellStockRequest.ts +4 -4
- package/src/retailCatalog/enums/InventoryInboundMessageTypeEnum.ts +1 -0
- package/src/retailCatalog/enums/InventoryItemStatusEnum.ts +2 -0
- package/src/retailCatalog/events/InventoryCentralSaleAcceptedMessage.ts +36 -0
- package/src/retailCatalog/events/InventoryInboundMessage.ts +5 -1
- package/src/retailCatalog/events/InventorySaleAppliedMessage.ts +1 -7
- package/src/retailCatalog/index.ts +2 -0
- package/src/retailIntegration/constants/retailIntegrationErrorHttpStatus.ts +17 -0
- package/src/retailIntegration/constants/retailIntegrationLimits.ts +3 -0
- package/src/retailIntegration/dtos/CancelRetailSaleRequest.ts +9 -0
- package/src/retailIntegration/dtos/CheckRetailInventoryRequest.ts +20 -0
- package/src/retailIntegration/dtos/GetReconciliationResponses.ts +37 -0
- package/src/retailIntegration/dtos/GetRetailInventoryRequest.ts +2 -2
- package/src/retailIntegration/dtos/ReconciliationPageMessage.ts +32 -0
- package/src/retailIntegration/dtos/ReconciliationRunCounts.ts +9 -0
- package/src/retailIntegration/dtos/RetailListQuery.ts +10 -0
- package/src/retailIntegration/dtos/RetailOutboundResponses.ts +11 -0
- package/src/retailIntegration/dtos/RetailPagedQuery.ts +2 -2
- package/src/retailIntegration/dtos/RetailTenantQuery.ts +5 -1
- package/src/retailIntegration/dtos/StartCatalogReconciliationRequest.ts +19 -0
- package/src/retailIntegration/dtos/StartOrgReconciliationRequest.ts +13 -0
- package/src/retailIntegration/enums/InactiveReasonEnum.ts +5 -0
- package/src/retailIntegration/enums/ReconciliationEntityEnum.ts +7 -0
- package/src/retailIntegration/enums/ReconciliationRunStatusEnum.ts +7 -0
- package/src/retailIntegration/enums/ReconciliationTriggerEnum.ts +6 -0
- package/src/retailIntegration/enums/RetailEventRejectCodeEnum.ts +2 -0
- package/src/retailIntegration/enums/RetailIntegrationErrorCodeEnum.ts +23 -0
- package/src/retailIntegration/enums/RetailSaleLineRoleEnum.ts +4 -0
- package/src/retailIntegration/enums/index.ts +6 -0
- package/src/retailIntegration/index.ts +9 -0
- package/src/retailIntegration/models/RetailSystemSale.ts +45 -37
- package/src/retailOrg/dtos/Retailer.ts +19 -1
- package/src/retailOrg/dtos/requests/ActivateRetailerIntegrationRequest.ts +10 -0
- package/src/retailOrg/dtos/responses/ActivateRetailerIntegrationResponse.ts +5 -0
- package/src/retailOrg/dtos/validation/RetailerValidationDto.ts +4 -0
- package/src/retailOrg/enums/RetailIntegrationSystemEnum.ts +4 -0
- package/src/retailOrg/index.ts +3 -0
- package/src/retailWizard/dtos/Sale.ts +25 -0
- package/src/retailWizard/dtos/WizardReservedLine.ts +3 -0
- package/src/retailWizard/dtos/WizardSession.ts +3 -0
- package/src/retailWizard/enums/CentralCancelStatusEnum.ts +18 -0
- package/src/retailWizard/enums/CentralLiveCheckEnum.ts +10 -0
- package/src/retailWizard/enums/CentralSyncStatusEnum.ts +7 -1
- package/src/retailWizard/enums/RetailCentralOutboundMessageTypeEnum.ts +5 -0
- package/src/retailWizard/enums/WizardLineStatusEnum.ts +2 -0
- package/src/retailWizard/events/RetailCentralOutboundMessage.ts +24 -0
- package/src/retailWizard/index.ts +4 -0
|
@@ -1,51 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import { ArrayNotEmpty, IsArray, IsIn, IsInt, IsObject, IsString, Matches, Min, Validate, ValidateIf, ValidateNested } from 'class-validator';
|
|
3
|
+
import { RETAIL_DECIMAL_PATTERN, RETAIL_ENTITY_ID_PATTERN, RETAIL_SKU_PATTERN } from '../constants/retailIntegrationLimits';
|
|
4
|
+
import { RetailCurrencyEnum, RetailLinePaymentTypeEnum, RetailPaymentMethodEnum, RetailSaleFinancierEnum, RetailSaleLineRoleEnum, RetailSaleTypeEnum } from '../enums';
|
|
5
|
+
import { IsIsoDateTimeWithZone } from '../validators/IsIsoDateTimeWithZone';
|
|
6
|
+
import { HasUniqueKeys, isNullOrValidated } from '../validators/payloadValidators';
|
|
2
7
|
import { RetailCurrency } from './RetailSystemProduct';
|
|
3
8
|
|
|
4
9
|
export type RetailSaleType = `${RetailSaleTypeEnum}`;
|
|
5
10
|
export type RetailSaleFinancier = `${RetailSaleFinancierEnum}`;
|
|
6
11
|
export type RetailPaymentMethod = `${RetailPaymentMethodEnum}`;
|
|
7
12
|
export type RetailLinePaymentType = `${RetailLinePaymentTypeEnum}`;
|
|
13
|
+
export type RetailSaleLineRole = `${RetailSaleLineRoleEnum}`;
|
|
8
14
|
|
|
9
|
-
export
|
|
10
|
-
customerId
|
|
11
|
-
names
|
|
12
|
-
paternalLastName
|
|
13
|
-
maternalLastName
|
|
14
|
-
phone
|
|
15
|
+
export class RetailSystemSaleCustomer {
|
|
16
|
+
@IsString() @Matches(/\S/) customerId!: string;
|
|
17
|
+
@IsString() @Matches(/\S/) names!: string;
|
|
18
|
+
@IsString() @Matches(/\S/) paternalLastName!: string;
|
|
19
|
+
@ValidateIf(isNullOrValidated) @IsString() maternalLastName!: string | null;
|
|
20
|
+
@IsString() @Matches(/\S/) phone!: string;
|
|
15
21
|
}
|
|
16
22
|
|
|
17
|
-
export
|
|
18
|
-
sku
|
|
19
|
-
qty
|
|
20
|
-
|
|
23
|
+
export class RetailSystemSaleComponent {
|
|
24
|
+
@IsString() @Matches(RETAIL_SKU_PATTERN) sku!: string;
|
|
25
|
+
@IsInt() @Min(1) qty!: number;
|
|
26
|
+
@IsArray() @IsString({ each: true }) @Matches(/\S/, { each: true }) identifiers!: string[];
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
export
|
|
24
|
-
lineId
|
|
25
|
-
sku
|
|
26
|
-
qty
|
|
27
|
-
basePrice
|
|
28
|
-
discount
|
|
29
|
-
paymentType
|
|
30
|
-
financedAmount
|
|
31
|
-
role
|
|
32
|
-
|
|
29
|
+
export class RetailSystemSaleLine {
|
|
30
|
+
@IsString() @Matches(/\S/) lineId!: string;
|
|
31
|
+
@IsString() @Matches(RETAIL_SKU_PATTERN) sku!: string;
|
|
32
|
+
@IsInt() @Min(1) qty!: number;
|
|
33
|
+
@IsString() @Matches(RETAIL_DECIMAL_PATTERN) basePrice!: string;
|
|
34
|
+
@IsString() @Matches(RETAIL_DECIMAL_PATTERN) discount!: string;
|
|
35
|
+
@IsIn(Object.values(RetailLinePaymentTypeEnum)) paymentType!: RetailLinePaymentType;
|
|
36
|
+
@IsString() @Matches(RETAIL_DECIMAL_PATTERN) financedAmount!: string;
|
|
37
|
+
@ValidateIf(isNullOrValidated) @IsIn(Object.values(RetailSaleLineRoleEnum)) role!: RetailSaleLineRole | null;
|
|
38
|
+
@IsArray() @ValidateNested({ each: true }) @Type(() => RetailSystemSaleComponent) components!: RetailSystemSaleComponent[];
|
|
33
39
|
}
|
|
34
40
|
|
|
35
|
-
/** Cuerpo de `POST /sales` de la doc
|
|
36
|
-
export
|
|
37
|
-
saleId
|
|
38
|
-
folio
|
|
39
|
-
storeId
|
|
40
|
-
sellerRetailUserId
|
|
41
|
-
soldAt
|
|
42
|
-
saleType
|
|
43
|
-
financier
|
|
44
|
-
creditId
|
|
45
|
-
currencyId
|
|
46
|
-
customer
|
|
47
|
-
equipmentPrice
|
|
48
|
-
amountPaid
|
|
49
|
-
paymentMethod
|
|
50
|
-
|
|
41
|
+
/** Cuerpo de `POST /sales` de la doc y de `privateRegisterRetailSale`; `saleId` es la llave de idempotencia. */
|
|
42
|
+
export class RetailSystemSale {
|
|
43
|
+
@IsString() @Matches(/\S/) saleId!: string;
|
|
44
|
+
@IsString() @Matches(/\S/) folio!: string;
|
|
45
|
+
@IsString() @Matches(RETAIL_ENTITY_ID_PATTERN) storeId!: string;
|
|
46
|
+
@IsString() @Matches(RETAIL_ENTITY_ID_PATTERN) sellerRetailUserId!: string;
|
|
47
|
+
@Validate(IsIsoDateTimeWithZone) soldAt!: string;
|
|
48
|
+
@IsIn(Object.values(RetailSaleTypeEnum)) saleType!: RetailSaleType;
|
|
49
|
+
@IsIn(Object.values(RetailSaleFinancierEnum)) financier!: RetailSaleFinancier;
|
|
50
|
+
@ValidateIf(isNullOrValidated) @IsString() @Matches(/\S/) creditId!: string | null;
|
|
51
|
+
@IsIn(Object.values(RetailCurrencyEnum)) currencyId!: RetailCurrency;
|
|
52
|
+
@IsObject() @ValidateNested() @Type(() => RetailSystemSaleCustomer) customer!: RetailSystemSaleCustomer;
|
|
53
|
+
@IsString() @Matches(RETAIL_DECIMAL_PATTERN) equipmentPrice!: string;
|
|
54
|
+
@IsString() @Matches(RETAIL_DECIMAL_PATTERN) amountPaid!: string;
|
|
55
|
+
@ValidateIf(isNullOrValidated) @IsIn(Object.values(RetailPaymentMethodEnum)) paymentMethod!: RetailPaymentMethod | null;
|
|
56
|
+
|
|
57
|
+
@IsArray() @ArrayNotEmpty() @ValidateNested({ each: true }) @Type(() => RetailSystemSaleLine) @Validate(HasUniqueKeys, ['lineId'])
|
|
58
|
+
lines!: RetailSystemSaleLine[];
|
|
51
59
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Expose, Type } from 'class-transformer';
|
|
2
|
-
import { IsEmail, IsEnum, IsObject, IsString, Length, Matches } from 'class-validator';
|
|
2
|
+
import { IsEmail, IsEnum, IsObject, IsOptional, IsString, Length, Matches } from 'class-validator';
|
|
3
3
|
import { LocationAddress } from '../../address/dtos/LocationAddress';
|
|
4
4
|
import { regexIso8601 } from '../../helpers/constans/regex';
|
|
5
5
|
import { RetailerStatusEnum } from '../enums/RetailerStatusEnum';
|
|
6
6
|
import { RetailerTypeEnum } from '../enums/RetailerTypeEnum';
|
|
7
|
+
import { RetailIntegrationSystemEnum } from '../enums/RetailIntegrationSystemEnum';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Retailer — nodo raíz de la organización comercial SureKeep (cadena / subdistribuidor / franquicia).
|
|
@@ -78,4 +79,21 @@ export class Retailer {
|
|
|
78
79
|
@Expose()
|
|
79
80
|
@IsString()
|
|
80
81
|
updatedBy!: string;
|
|
82
|
+
|
|
83
|
+
/** Bandera «integrado»: presente solo si el retailer ya se activó con un sistema externo. */
|
|
84
|
+
@Expose()
|
|
85
|
+
@IsOptional()
|
|
86
|
+
@IsEnum(RetailIntegrationSystemEnum)
|
|
87
|
+
integrationSystem?: RetailIntegrationSystemEnum;
|
|
88
|
+
|
|
89
|
+
@Expose()
|
|
90
|
+
@IsOptional()
|
|
91
|
+
@IsString()
|
|
92
|
+
@Matches(regexIso8601, { message: 'integrationActivatedAt debe ser una fecha ISO 8601' })
|
|
93
|
+
integrationActivatedAt?: string;
|
|
94
|
+
|
|
95
|
+
@Expose()
|
|
96
|
+
@IsOptional()
|
|
97
|
+
@IsString()
|
|
98
|
+
integrationActivatedBy?: string;
|
|
81
99
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Expose } from 'class-transformer';
|
|
2
|
+
import { IsEnum } from 'class-validator';
|
|
3
|
+
import { RetailIntegrationSystemEnum } from '../../enums/RetailIntegrationSystemEnum';
|
|
4
|
+
|
|
5
|
+
/** Body de POST /retailers/:retailerId/integration/activate. */
|
|
6
|
+
export class ActivateRetailerIntegrationRequest {
|
|
7
|
+
@Expose()
|
|
8
|
+
@IsEnum(RetailIntegrationSystemEnum)
|
|
9
|
+
integrationSystem!: RetailIntegrationSystemEnum;
|
|
10
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Retailer } from '../Retailer';
|
|
2
|
+
|
|
3
|
+
/** Respuesta de POST /retailers/:retailerId/integration/activate: el Retailer con la bandera ya sellada. */
|
|
4
|
+
export type ActivateRetailerIntegrationResponse = Retailer &
|
|
5
|
+
Required<Pick<Retailer, 'integrationSystem' | 'integrationActivatedAt' | 'integrationActivatedBy'>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RetailerStatusEnum } from '../../enums/RetailerStatusEnum';
|
|
2
2
|
import type { RetailerTypeEnum } from '../../enums/RetailerTypeEnum';
|
|
3
|
+
import type { RetailIntegrationSystemEnum } from '../../enums/RetailIntegrationSystemEnum';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Shape mínimo que devuelve el endpoint privado de validación de retailer (consumido por otros
|
|
@@ -12,4 +13,7 @@ export interface RetailerValidationDto {
|
|
|
12
13
|
type: RetailerTypeEnum;
|
|
13
14
|
status: RetailerStatusEnum;
|
|
14
15
|
parentId: string;
|
|
16
|
+
/** Bandera «integrado»; ausente si el retailer no está integrado. */
|
|
17
|
+
integrationSystem?: RetailIntegrationSystemEnum;
|
|
18
|
+
integrationActivatedAt?: string;
|
|
15
19
|
}
|
package/src/retailOrg/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './enums/RetailUserStatusEnum';
|
|
|
6
6
|
export * from './enums/EmploymentTypeEnum';
|
|
7
7
|
export * from './enums/CollectorSeniorityEnum';
|
|
8
8
|
export * from './enums/RetailUserWalletLinkMethodEnum';
|
|
9
|
+
export * from './enums/RetailIntegrationSystemEnum';
|
|
9
10
|
// F3 — Portal Admin VentasLuga (metas de venta del periodo)
|
|
10
11
|
export * from './enums/GoalTargetTypeEnum';
|
|
11
12
|
|
|
@@ -56,6 +57,7 @@ export * from './dtos/requests/GoalPathParams';
|
|
|
56
57
|
export * from './dtos/requests/PrivateGoalListQuery';
|
|
57
58
|
export * from './dtos/requests/KpiQuery';
|
|
58
59
|
export * from './dtos/requests/PrivateSellerListQuery';
|
|
60
|
+
export * from './dtos/requests/ActivateRetailerIntegrationRequest';
|
|
59
61
|
|
|
60
62
|
// Response DTOs
|
|
61
63
|
export * from './dtos/responses/RetailerHierarchyResponse';
|
|
@@ -66,3 +68,4 @@ export * from './dtos/responses/StoreKpiResponse';
|
|
|
66
68
|
export * from './dtos/responses/SellerKpiResponse';
|
|
67
69
|
export * from './dtos/responses/LookupRetailUserWalletResponse';
|
|
68
70
|
export * from './dtos/responses/PrivateRetailUserWalletResponse';
|
|
71
|
+
export * from './dtos/responses/ActivateRetailerIntegrationResponse';
|
|
@@ -4,6 +4,8 @@ import type { SalePaymentMethodEnum } from '../enums/SalePaymentMethodEnum';
|
|
|
4
4
|
import type { SaleChannelEnum } from '../enums/SaleChannelEnum';
|
|
5
5
|
import type { ExternalProviderEnum } from '../enums/ExternalProviderEnum';
|
|
6
6
|
import type { CentralSyncStatusEnum } from '../enums/CentralSyncStatusEnum';
|
|
7
|
+
import type { CentralCancelStatusEnum } from '../enums/CentralCancelStatusEnum';
|
|
8
|
+
import type { CentralLiveCheckEnum } from '../enums/CentralLiveCheckEnum';
|
|
7
9
|
import type { SalePaymentDetail } from './SalePaymentDetail';
|
|
8
10
|
import type { SaleLine } from './SaleLine';
|
|
9
11
|
import type { SalePromotionRef } from '../../retailPromotions/dtos/SalePromotionRef';
|
|
@@ -64,6 +66,29 @@ export interface Sale {
|
|
|
64
66
|
cardDeliveryId: string | null;
|
|
65
67
|
centralSyncStatus: CentralSyncStatusEnum;
|
|
66
68
|
centralTag: string | null;
|
|
69
|
+
/** Estado de la cancelación en Central; ausente si la venta no se ha cancelado. */
|
|
70
|
+
centralCancelStatus?: CentralCancelStatusEnum;
|
|
71
|
+
/** ISO; primer intento de envío, se sella una sola vez. */
|
|
72
|
+
centralFirstAttemptAt?: string;
|
|
73
|
+
/** ISO; inicio de la ventana de 24 h de reintentos, el reenvío la reinicia. */
|
|
74
|
+
centralRetryWindowStartAt?: string;
|
|
75
|
+
/** ISO; último intento de envío. */
|
|
76
|
+
centralLastAttemptAt?: string;
|
|
77
|
+
/** ISO; hasta cuándo el consumidor tiene tomada la venta. */
|
|
78
|
+
centralLeaseUntil?: string;
|
|
79
|
+
centralAttempts?: number;
|
|
80
|
+
/** Code del rechazo o del último error de Central. */
|
|
81
|
+
centralLastErrorCode?: string;
|
|
82
|
+
/** ISO; cuándo Central aceptó la venta. */
|
|
83
|
+
centralAcceptedAt?: string;
|
|
84
|
+
/** ISO; primer intento de la cancelación, se sella una sola vez. */
|
|
85
|
+
centralCancelFirstAttemptAt?: string;
|
|
86
|
+
/** ISO; inicio de la ventana de 24 h de la cancelación, el reenvío la reinicia. */
|
|
87
|
+
centralCancelRetryWindowStartAt?: string;
|
|
88
|
+
/** ISO; cuándo Central aceptó la cancelación. */
|
|
89
|
+
centralCancelAcceptedAt?: string;
|
|
90
|
+
/** Resultado de la consulta en vivo, copiado de la sesión al cerrar. */
|
|
91
|
+
centralLiveCheck?: CentralLiveCheckEnum;
|
|
67
92
|
status: SaleStatusEnum;
|
|
68
93
|
cancelledAt: string | null;
|
|
69
94
|
/** Reason OBLIGATORIO en cancelación (AuditTrail) — flujo C. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InventoryItemStatusEnum } from '../../retailCatalog/enums/InventoryItemStatusEnum';
|
|
1
2
|
import type { MdmProviderEnum } from '../../retailCatalog/enums/MdmProviderEnum';
|
|
2
3
|
import type { ReservedComponent } from '../../retailCatalog/dtos/responses/ReserveStockResponse';
|
|
3
4
|
import type { LinePaymentTypeEnum } from '../enums/LinePaymentTypeEnum';
|
|
@@ -12,6 +13,8 @@ export interface WizardReservedLine extends WizardLinePromotionFields {
|
|
|
12
13
|
sku: string;
|
|
13
14
|
qty: number;
|
|
14
15
|
status: WizardLineStatusEnum;
|
|
16
|
+
/** Solo en LOST: estado en que Central dejó la pieza (SOLD, IN_TRANSIT o DAMAGED). */
|
|
17
|
+
lostReason?: InventoryItemStatusEnum;
|
|
15
18
|
/** Llave de idempotencia de la reserva; una nueva por cada intento. */
|
|
16
19
|
reservationId: string;
|
|
17
20
|
/** Vencimiento de la reserva; una línea PENDING nace con ahora + 30 min. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SalePromotionRef } from '../../retailPromotions/dtos/SalePromotionRef';
|
|
2
|
+
import type { CentralLiveCheckEnum } from '../enums/CentralLiveCheckEnum';
|
|
2
3
|
import type { WizardStateEnum } from '../enums/WizardStateEnum';
|
|
3
4
|
import type { WizardStepEnum } from '../enums/WizardStepEnum';
|
|
4
5
|
import type { FiadoPhoneStatusEnum } from '../enums/FiadoPhoneStatusEnum';
|
|
@@ -152,6 +153,8 @@ export interface WizardSession {
|
|
|
152
153
|
/** Contexto de crédito (pista SOFOM, pasos 04-09): PUNTEROS al dominio loan-*. Null en contado/externa. */
|
|
153
154
|
loan: WizardLoan | null;
|
|
154
155
|
saleId: string | null;
|
|
156
|
+
/** Resultado de la consulta en vivo a Central; la TX de cierre lo copia a la venta. */
|
|
157
|
+
centralLiveCheck?: CentralLiveCheckEnum;
|
|
155
158
|
/** Prospecto vinculado (si la sesión se reanudó desde un prospecto): se cierra al cerrar la venta (D-prospecto). */
|
|
156
159
|
prospectId: string | null;
|
|
157
160
|
cancelReason: string | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de la cancelación de la venta en Central.
|
|
3
|
+
*
|
|
4
|
+
* PENDING - Por enviar o en reintento.
|
|
5
|
+
* SENDING - Tomada por el consumidor, envío en curso.
|
|
6
|
+
* ACCEPTED - Central aceptó la cancelación.
|
|
7
|
+
* REJECTED - Central rechazó la cancelación.
|
|
8
|
+
* FAILED - Se agotó la ventana de reintentos.
|
|
9
|
+
* NOT_SENT - No se envía: la venta nunca quedó en Central.
|
|
10
|
+
*/
|
|
11
|
+
export enum CentralCancelStatusEnum {
|
|
12
|
+
PENDING = 'PENDING',
|
|
13
|
+
SENDING = 'SENDING',
|
|
14
|
+
ACCEPTED = 'ACCEPTED',
|
|
15
|
+
REJECTED = 'REJECTED',
|
|
16
|
+
FAILED = 'FAILED',
|
|
17
|
+
NOT_SENT = 'NOT_SENT',
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resultado de la consulta en vivo a Central antes de cerrar la venta.
|
|
3
|
+
*
|
|
4
|
+
* VERIFIED - Central confirmó la pieza a tiempo.
|
|
5
|
+
* UNVERIFIED - Central no contestó a tiempo; la venta sigue igual.
|
|
6
|
+
*/
|
|
7
|
+
export enum CentralLiveCheckEnum {
|
|
8
|
+
VERIFIED = 'VERIFIED',
|
|
9
|
+
UNVERIFIED = 'UNVERIFIED',
|
|
10
|
+
}
|
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
* Estado de sincronización de la venta con Central (local-first; badge en BO). SureKeep Fase 2 — pista Retail.
|
|
3
3
|
*
|
|
4
4
|
* PENDING - Aún no sincronizada.
|
|
5
|
-
* SENT - Enviada a Central.
|
|
5
|
+
* SENT - Enviada a Central (sin uso: lo reemplazan SENDING y ACCEPTED).
|
|
6
6
|
* FAILED - Falló la sincronización.
|
|
7
7
|
* N_A - No aplica (p. ej. derivación externa).
|
|
8
|
+
* SENDING - Tomada por el consumidor, envío en curso.
|
|
9
|
+
* ACCEPTED - Central la aceptó.
|
|
10
|
+
* REJECTED - Central la rechazó con un 4xx de su catálogo.
|
|
8
11
|
*/
|
|
9
12
|
export enum CentralSyncStatusEnum {
|
|
10
13
|
PENDING = 'PENDING',
|
|
11
14
|
SENT = 'SENT',
|
|
12
15
|
FAILED = 'FAILED',
|
|
13
16
|
N_A = 'N_A',
|
|
17
|
+
SENDING = 'SENDING',
|
|
18
|
+
ACCEPTED = 'ACCEPTED',
|
|
19
|
+
REJECTED = 'REJECTED',
|
|
14
20
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
|
2
|
+
import { RetailCentralOutboundMessageTypeEnum } from '../enums/RetailCentralOutboundMessageTypeEnum';
|
|
3
|
+
|
|
4
|
+
/** Aviso a Central de una venta por registrar o cancelar; el consumidor lee la venta por saleId. */
|
|
5
|
+
export class RetailCentralOutboundMessage {
|
|
6
|
+
@IsEnum(RetailCentralOutboundMessageTypeEnum)
|
|
7
|
+
messageType!: RetailCentralOutboundMessageTypeEnum;
|
|
8
|
+
|
|
9
|
+
@IsString()
|
|
10
|
+
@IsNotEmpty()
|
|
11
|
+
tenantId!: string;
|
|
12
|
+
|
|
13
|
+
@IsString()
|
|
14
|
+
@IsNotEmpty()
|
|
15
|
+
retailerId!: string;
|
|
16
|
+
|
|
17
|
+
@IsString()
|
|
18
|
+
@IsNotEmpty()
|
|
19
|
+
storeId!: string;
|
|
20
|
+
|
|
21
|
+
@IsString()
|
|
22
|
+
@IsNotEmpty()
|
|
23
|
+
saleId!: string;
|
|
24
|
+
}
|
|
@@ -13,6 +13,8 @@ export * from './enums/SalePaymentMethodEnum';
|
|
|
13
13
|
export * from './enums/RefundStatusEnum';
|
|
14
14
|
export * from './enums/SaleStatusEnum';
|
|
15
15
|
export * from './enums/CentralSyncStatusEnum';
|
|
16
|
+
export * from './enums/CentralCancelStatusEnum';
|
|
17
|
+
export * from './enums/CentralLiveCheckEnum';
|
|
16
18
|
export * from './enums/ProspectStatusEnum';
|
|
17
19
|
export * from './enums/PendingReasonEnum';
|
|
18
20
|
export * from './enums/OccupationEnum';
|
|
@@ -199,11 +201,13 @@ export * from './events/SaleCancelledV2';
|
|
|
199
201
|
export * from './events/SessionExpiredV1';
|
|
200
202
|
export * from './enums/RetailPromotionInboundMessageTypeEnum';
|
|
201
203
|
export * from './enums/RetailCommissionInboundMessageTypeEnum';
|
|
204
|
+
export * from './enums/RetailCentralOutboundMessageTypeEnum';
|
|
202
205
|
export * from './events/RetailPromotionInboundMessage';
|
|
203
206
|
export * from './events/RetailPromotionAccountOpenedMessage';
|
|
204
207
|
export * from './events/RetailPromotionInstallmentPaidMessage';
|
|
205
208
|
export * from './events/RetailPromotionQueueMessage';
|
|
206
209
|
export * from './events/RetailCommissionInboundMessage';
|
|
210
|
+
export * from './events/RetailCentralOutboundMessage';
|
|
207
211
|
|
|
208
212
|
// Lookup privado por lote (GET /private/wizard-sessions/batch)
|
|
209
213
|
export * from './enums/WizardSessionLookupStatusEnum';
|