@fiado/type-kit 3.189.0 → 3.191.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/retailOrg/dtos/validation/validationDtos.test.ts +27 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +11 -0
- package/bin/benefitCenter/enums/BenefitFlowEnum.js +15 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +7 -1
- 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/platformRbac/dtos/ResendOtpRequest.js +36 -0
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.js +36 -0
- package/bin/retailCards/dtos/requests/AssignCardRequest.d.ts +6 -0
- package/bin/retailCards/dtos/requests/AssignCardRequest.js +30 -0
- package/bin/retailCards/dtos/requests/CancelCardRequest.d.ts +5 -0
- package/bin/retailCards/dtos/requests/CancelCardRequest.js +22 -0
- package/bin/retailCards/dtos/requests/RegisterCardBatchRequest.d.ts +7 -0
- package/bin/retailCards/dtos/requests/RegisterCardBatchRequest.js +38 -0
- package/bin/retailCards/dtos/responses/CardBatchResponse.d.ts +17 -0
- package/bin/retailCards/dtos/responses/CardBatchResponse.js +2 -0
- package/bin/retailCards/dtos/responses/RetailCardResponse.d.ts +12 -0
- package/bin/retailCards/dtos/responses/RetailCardResponse.js +2 -0
- package/bin/retailCards/dtos/responses/StockAlertItem.d.ts +7 -0
- package/bin/retailCards/dtos/responses/StockAlertItem.js +2 -0
- package/bin/retailCards/dtos/responses/StockAlertsResponse.d.ts +5 -0
- package/bin/retailCards/dtos/responses/StockAlertsResponse.js +2 -0
- package/bin/retailCards/enums/CardBatchStatusEnum.d.ts +17 -0
- package/bin/retailCards/enums/CardBatchStatusEnum.js +21 -0
- package/bin/retailCards/enums/CardCancelReasonEnum.d.ts +13 -0
- package/bin/retailCards/enums/CardCancelReasonEnum.js +17 -0
- package/bin/retailCards/enums/RetailCardStatusEnum.d.ts +13 -0
- package/bin/retailCards/enums/RetailCardStatusEnum.js +17 -0
- package/bin/retailCards/events/CardBatchReceivedV1.d.ts +9 -0
- package/bin/retailCards/events/CardBatchReceivedV1.js +2 -0
- package/bin/retailCards/events/RetailCardAssignedV1.d.ts +10 -0
- package/bin/retailCards/events/RetailCardAssignedV1.js +2 -0
- package/bin/retailCards/events/RetailCardCancelledV1.d.ts +9 -0
- package/bin/retailCards/events/RetailCardCancelledV1.js +2 -0
- package/bin/retailCards/events/RetailCardReleasedV1.d.ts +7 -0
- package/bin/retailCards/events/RetailCardReleasedV1.js +2 -0
- package/bin/retailCards/index.d.ts +14 -0
- package/bin/retailCards/index.js +33 -0
- package/bin/retailCatalog/constants/SkuPattern.d.ts +2 -0
- package/bin/retailCatalog/constants/SkuPattern.js +5 -0
- package/bin/retailCatalog/dtos/InventoryItem.d.ts +20 -0
- package/bin/retailCatalog/dtos/InventoryItem.js +11 -0
- package/bin/retailCatalog/dtos/Product.d.ts +34 -0
- package/bin/retailCatalog/dtos/Product.js +11 -0
- package/bin/retailCatalog/dtos/requests/ChangeInventoryStatusRequest.d.ts +8 -0
- package/bin/retailCatalog/dtos/requests/ChangeInventoryStatusRequest.js +25 -0
- package/bin/retailCatalog/dtos/requests/CreateProductRequest.d.ts +22 -0
- package/bin/retailCatalog/dtos/requests/CreateProductRequest.js +98 -0
- package/bin/retailCatalog/dtos/requests/ListProductsQuery.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/ListProductsQuery.js +39 -0
- package/bin/retailCatalog/dtos/requests/RegisterInventoryRequest.d.ts +5 -0
- package/bin/retailCatalog/dtos/requests/RegisterInventoryRequest.js +27 -0
- package/bin/retailCatalog/dtos/requests/TransferInventoryRequest.d.ts +4 -0
- package/bin/retailCatalog/dtos/requests/TransferInventoryRequest.js +21 -0
- package/bin/retailCatalog/dtos/requests/UpdateProductRequest.d.ts +21 -0
- package/bin/retailCatalog/dtos/requests/UpdateProductRequest.js +100 -0
- package/bin/retailCatalog/dtos/requests/UpdateProductStatusRequest.d.ts +5 -0
- package/bin/retailCatalog/dtos/requests/UpdateProductStatusRequest.js +22 -0
- package/bin/retailCatalog/dtos/responses/ImportCsvFailure.d.ts +5 -0
- package/bin/retailCatalog/dtos/responses/ImportCsvFailure.js +7 -0
- package/bin/retailCatalog/dtos/responses/ImportCsvResult.d.ts +6 -0
- package/bin/retailCatalog/dtos/responses/ImportCsvResult.js +7 -0
- package/bin/retailCatalog/dtos/responses/InventoryItemResponse.d.ts +3 -0
- package/bin/retailCatalog/dtos/responses/InventoryItemResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/ProductResponse.d.ts +3 -0
- package/bin/retailCatalog/dtos/responses/ProductResponse.js +2 -0
- package/bin/retailCatalog/dtos/validation/ValidateInventoryResponse.d.ts +11 -0
- package/bin/retailCatalog/dtos/validation/ValidateInventoryResponse.js +10 -0
- package/bin/retailCatalog/dtos/validation/ValidateProductResponse.d.ts +20 -0
- package/bin/retailCatalog/dtos/validation/ValidateProductResponse.js +11 -0
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.d.ts +18 -0
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.js +22 -0
- package/bin/retailCatalog/enums/MdmLockModeEnum.d.ts +17 -0
- package/bin/retailCatalog/enums/MdmLockModeEnum.js +21 -0
- package/bin/retailCatalog/enums/MdmProviderEnum.d.ts +11 -0
- package/bin/retailCatalog/enums/MdmProviderEnum.js +15 -0
- package/bin/retailCatalog/enums/ProductStatusEnum.d.ts +13 -0
- package/bin/retailCatalog/enums/ProductStatusEnum.js +17 -0
- package/bin/retailCatalog/enums/ProductTierEnum.d.ts +15 -0
- package/bin/retailCatalog/enums/ProductTierEnum.js +19 -0
- package/bin/retailCatalog/index.d.ts +22 -0
- package/bin/retailCatalog/index.js +44 -0
- package/bin/retailCatalog/validators/IsMdmCoherentConstraint.d.ts +10 -0
- package/bin/retailCatalog/validators/IsMdmCoherentConstraint.js +31 -0
- package/bin/retailOrg/dtos/validation/CollectorValidationDto.d.ts +21 -0
- package/bin/retailOrg/dtos/validation/CollectorValidationDto.js +2 -0
- package/bin/retailOrg/index.d.ts +1 -0
- package/bin/retailOrg/index.js +1 -0
- package/package.json +1 -1
- package/src/index.ts +6 -0
- package/src/retailCards/dtos/requests/AssignCardRequest.ts +14 -0
- package/src/retailCards/dtos/requests/CancelCardRequest.ts +8 -0
- package/src/retailCards/dtos/requests/RegisterCardBatchRequest.ts +21 -0
- package/src/retailCards/dtos/responses/CardBatchResponse.ts +18 -0
- package/src/retailCards/dtos/responses/RetailCardResponse.ts +13 -0
- package/src/retailCards/dtos/responses/StockAlertItem.ts +7 -0
- package/src/retailCards/dtos/responses/StockAlertsResponse.ts +6 -0
- package/src/retailCards/enums/CardBatchStatusEnum.ts +17 -0
- package/src/retailCards/enums/CardCancelReasonEnum.ts +13 -0
- package/src/retailCards/enums/RetailCardStatusEnum.ts +13 -0
- package/src/retailCards/events/CardBatchReceivedV1.ts +9 -0
- package/src/retailCards/events/RetailCardAssignedV1.ts +10 -0
- package/src/retailCards/events/RetailCardCancelledV1.ts +10 -0
- package/src/retailCards/events/RetailCardReleasedV1.ts +7 -0
- package/src/retailCards/index.ts +20 -0
- package/src/retailCatalog/constants/SkuPattern.ts +2 -0
- package/src/retailCatalog/dtos/InventoryItem.ts +21 -0
- package/src/retailCatalog/dtos/Product.ts +35 -0
- package/src/retailCatalog/dtos/requests/ChangeInventoryStatusRequest.ts +11 -0
- package/src/retailCatalog/dtos/requests/CreateProductRequest.ts +81 -0
- package/src/retailCatalog/dtos/requests/ListProductsQuery.ts +22 -0
- package/src/retailCatalog/dtos/requests/RegisterInventoryRequest.ts +12 -0
- package/src/retailCatalog/dtos/requests/TransferInventoryRequest.ts +7 -0
- package/src/retailCatalog/dtos/requests/UpdateProductRequest.ts +82 -0
- package/src/retailCatalog/dtos/requests/UpdateProductStatusRequest.ts +8 -0
- package/src/retailCatalog/dtos/responses/ImportCsvFailure.ts +5 -0
- package/src/retailCatalog/dtos/responses/ImportCsvResult.ts +7 -0
- package/src/retailCatalog/dtos/responses/InventoryItemResponse.ts +4 -0
- package/src/retailCatalog/dtos/responses/ProductResponse.ts +4 -0
- package/src/retailCatalog/dtos/validation/ValidateInventoryResponse.ts +12 -0
- package/src/retailCatalog/dtos/validation/ValidateProductResponse.ts +21 -0
- package/src/retailCatalog/enums/InventoryItemStatusEnum.ts +18 -0
- package/src/retailCatalog/enums/MdmLockModeEnum.ts +17 -0
- package/src/retailCatalog/enums/MdmProviderEnum.ts +11 -0
- package/src/retailCatalog/enums/ProductStatusEnum.ts +13 -0
- package/src/retailCatalog/enums/ProductTierEnum.ts +15 -0
- package/src/retailCatalog/index.ts +34 -0
- package/src/retailCatalog/validators/IsMdmCoherentConstraint.ts +25 -0
- package/src/retailOrg/dtos/validation/CollectorValidationDto.ts +22 -0
- package/src/retailOrg/index.ts +1 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
|
|
2
|
+
import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
3
|
+
import { ProductStatusEnum } from '../../enums/ProductStatusEnum';
|
|
4
|
+
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
5
|
+
/**
|
|
6
|
+
* Response de GET /private/products/:retailerId/:sku — validar que el producto existe + status.
|
|
7
|
+
* Incluye los campos que los downstream consumen: `eligibleFinanciers` (wizard F2 paso 4)
|
|
8
|
+
* y la config MDM (device router F4+). Shape de salida → sin class-validator.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ValidateProductResponse {
|
|
11
|
+
productId: string;
|
|
12
|
+
retailerId: string;
|
|
13
|
+
sku: string;
|
|
14
|
+
status: ProductStatusEnum;
|
|
15
|
+
tier: ProductTierEnum;
|
|
16
|
+
eligibleFinanciers: string[];
|
|
17
|
+
mdmEnabled: boolean;
|
|
18
|
+
mdmProvider: MdmProviderEnum | null;
|
|
19
|
+
mdmLockMode: MdmLockModeEnum | null;
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidateProductResponse = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Response de GET /private/products/:retailerId/:sku — validar que el producto existe + status.
|
|
6
|
+
* Incluye los campos que los downstream consumen: `eligibleFinanciers` (wizard F2 paso 4)
|
|
7
|
+
* y la config MDM (device router F4+). Shape de salida → sin class-validator.
|
|
8
|
+
*/
|
|
9
|
+
class ValidateProductResponse {
|
|
10
|
+
}
|
|
11
|
+
exports.ValidateProductResponse = ValidateProductResponse;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de una unidad física (IMEI) en inventario.
|
|
3
|
+
* Transiciones: AVAILABLE → RESERVED → SOLD/AVAILABLE (release); RETURNED desde SOLD; DAMAGED.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*
|
|
6
|
+
* @property {string} AVAILABLE - Disponible en stock.
|
|
7
|
+
* @property {string} RESERVED - Reservada para una venta en curso.
|
|
8
|
+
* @property {string} SOLD - Vendida.
|
|
9
|
+
* @property {string} RETURNED - Devuelta por el cliente.
|
|
10
|
+
* @property {string} DAMAGED - Dañada, fuera de stock vendible.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum InventoryItemStatusEnum {
|
|
13
|
+
AVAILABLE = "AVAILABLE",
|
|
14
|
+
RESERVED = "RESERVED",
|
|
15
|
+
SOLD = "SOLD",
|
|
16
|
+
RETURNED = "RETURNED",
|
|
17
|
+
DAMAGED = "DAMAGED"
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InventoryItemStatusEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estado de una unidad física (IMEI) en inventario.
|
|
6
|
+
* Transiciones: AVAILABLE → RESERVED → SOLD/AVAILABLE (release); RETURNED desde SOLD; DAMAGED.
|
|
7
|
+
* @enum {string}
|
|
8
|
+
*
|
|
9
|
+
* @property {string} AVAILABLE - Disponible en stock.
|
|
10
|
+
* @property {string} RESERVED - Reservada para una venta en curso.
|
|
11
|
+
* @property {string} SOLD - Vendida.
|
|
12
|
+
* @property {string} RETURNED - Devuelta por el cliente.
|
|
13
|
+
* @property {string} DAMAGED - Dañada, fuera de stock vendible.
|
|
14
|
+
*/
|
|
15
|
+
var InventoryItemStatusEnum;
|
|
16
|
+
(function (InventoryItemStatusEnum) {
|
|
17
|
+
InventoryItemStatusEnum["AVAILABLE"] = "AVAILABLE";
|
|
18
|
+
InventoryItemStatusEnum["RESERVED"] = "RESERVED";
|
|
19
|
+
InventoryItemStatusEnum["SOLD"] = "SOLD";
|
|
20
|
+
InventoryItemStatusEnum["RETURNED"] = "RETURNED";
|
|
21
|
+
InventoryItemStatusEnum["DAMAGED"] = "DAMAGED";
|
|
22
|
+
})(InventoryItemStatusEnum || (exports.InventoryItemStatusEnum = InventoryItemStatusEnum = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modo de bloqueo MDM. Valores del flow 04 de F1 (ONDEMAND/SCHEDULED).
|
|
3
|
+
*
|
|
4
|
+
* TD-007: el `DeviceLockModeEnum` del dominio `mdm` hoy tiene TEMPORARY/FIRM (semántica
|
|
5
|
+
* distinta: qué tan firme es el lock, no cuándo se dispara). Reconciliación pendiente con
|
|
6
|
+
* el dueño del dominio `mdm` (decidir reuso vs enum nuevo). En F1 el campo es pasivo
|
|
7
|
+
* (se guarda, no se ejerce) → no bloqueante.
|
|
8
|
+
*
|
|
9
|
+
* @enum {string}
|
|
10
|
+
*
|
|
11
|
+
* @property {string} ONDEMAND - El bloqueo se dispara bajo demanda.
|
|
12
|
+
* @property {string} SCHEDULED - El bloqueo se dispara de forma programada.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum MdmLockModeEnum {
|
|
15
|
+
ONDEMAND = "ONDEMAND",
|
|
16
|
+
SCHEDULED = "SCHEDULED"
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MdmLockModeEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Modo de bloqueo MDM. Valores del flow 04 de F1 (ONDEMAND/SCHEDULED).
|
|
6
|
+
*
|
|
7
|
+
* TD-007: el `DeviceLockModeEnum` del dominio `mdm` hoy tiene TEMPORARY/FIRM (semántica
|
|
8
|
+
* distinta: qué tan firme es el lock, no cuándo se dispara). Reconciliación pendiente con
|
|
9
|
+
* el dueño del dominio `mdm` (decidir reuso vs enum nuevo). En F1 el campo es pasivo
|
|
10
|
+
* (se guarda, no se ejerce) → no bloqueante.
|
|
11
|
+
*
|
|
12
|
+
* @enum {string}
|
|
13
|
+
*
|
|
14
|
+
* @property {string} ONDEMAND - El bloqueo se dispara bajo demanda.
|
|
15
|
+
* @property {string} SCHEDULED - El bloqueo se dispara de forma programada.
|
|
16
|
+
*/
|
|
17
|
+
var MdmLockModeEnum;
|
|
18
|
+
(function (MdmLockModeEnum) {
|
|
19
|
+
MdmLockModeEnum["ONDEMAND"] = "ONDEMAND";
|
|
20
|
+
MdmLockModeEnum["SCHEDULED"] = "SCHEDULED";
|
|
21
|
+
})(MdmLockModeEnum || (exports.MdmLockModeEnum = MdmLockModeEnum = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proveedor MDM (Mobile Device Management) para el enrolamiento de dispositivos (F4+).
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} TRUSTONIC - Proveedor Trustonic.
|
|
6
|
+
* @property {string} DATACULTR - Proveedor Datacultr.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum MdmProviderEnum {
|
|
9
|
+
TRUSTONIC = "TRUSTONIC",
|
|
10
|
+
DATACULTR = "DATACULTR"
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MdmProviderEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Proveedor MDM (Mobile Device Management) para el enrolamiento de dispositivos (F4+).
|
|
6
|
+
* @enum {string}
|
|
7
|
+
*
|
|
8
|
+
* @property {string} TRUSTONIC - Proveedor Trustonic.
|
|
9
|
+
* @property {string} DATACULTR - Proveedor Datacultr.
|
|
10
|
+
*/
|
|
11
|
+
var MdmProviderEnum;
|
|
12
|
+
(function (MdmProviderEnum) {
|
|
13
|
+
MdmProviderEnum["TRUSTONIC"] = "TRUSTONIC";
|
|
14
|
+
MdmProviderEnum["DATACULTR"] = "DATACULTR";
|
|
15
|
+
})(MdmProviderEnum || (exports.MdmProviderEnum = MdmProviderEnum = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado del producto en el catálogo.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} ACTIVE - Producto activo y vendible.
|
|
6
|
+
* @property {string} INACTIVE - Producto inactivo temporalmente.
|
|
7
|
+
* @property {string} DISCONTINUED - Producto descontinuado.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ProductStatusEnum {
|
|
10
|
+
ACTIVE = "ACTIVE",
|
|
11
|
+
INACTIVE = "INACTIVE",
|
|
12
|
+
DISCONTINUED = "DISCONTINUED"
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductStatusEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Estado del producto en el catálogo.
|
|
6
|
+
* @enum {string}
|
|
7
|
+
*
|
|
8
|
+
* @property {string} ACTIVE - Producto activo y vendible.
|
|
9
|
+
* @property {string} INACTIVE - Producto inactivo temporalmente.
|
|
10
|
+
* @property {string} DISCONTINUED - Producto descontinuado.
|
|
11
|
+
*/
|
|
12
|
+
var ProductStatusEnum;
|
|
13
|
+
(function (ProductStatusEnum) {
|
|
14
|
+
ProductStatusEnum["ACTIVE"] = "ACTIVE";
|
|
15
|
+
ProductStatusEnum["INACTIVE"] = "INACTIVE";
|
|
16
|
+
ProductStatusEnum["DISCONTINUED"] = "DISCONTINUED";
|
|
17
|
+
})(ProductStatusEnum || (exports.ProductStatusEnum = ProductStatusEnum = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tier comercial del producto (segmenta catálogo por rango de precio/posicionamiento).
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} LOW - Gama de entrada.
|
|
6
|
+
* @property {string} MID - Gama media.
|
|
7
|
+
* @property {string} HIGH - Gama alta.
|
|
8
|
+
* @property {string} PREMIUM - Gama premium.
|
|
9
|
+
*/
|
|
10
|
+
export declare enum ProductTierEnum {
|
|
11
|
+
LOW = "LOW",
|
|
12
|
+
MID = "MID",
|
|
13
|
+
HIGH = "HIGH",
|
|
14
|
+
PREMIUM = "PREMIUM"
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductTierEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Tier comercial del producto (segmenta catálogo por rango de precio/posicionamiento).
|
|
6
|
+
* @enum {string}
|
|
7
|
+
*
|
|
8
|
+
* @property {string} LOW - Gama de entrada.
|
|
9
|
+
* @property {string} MID - Gama media.
|
|
10
|
+
* @property {string} HIGH - Gama alta.
|
|
11
|
+
* @property {string} PREMIUM - Gama premium.
|
|
12
|
+
*/
|
|
13
|
+
var ProductTierEnum;
|
|
14
|
+
(function (ProductTierEnum) {
|
|
15
|
+
ProductTierEnum["LOW"] = "LOW";
|
|
16
|
+
ProductTierEnum["MID"] = "MID";
|
|
17
|
+
ProductTierEnum["HIGH"] = "HIGH";
|
|
18
|
+
ProductTierEnum["PREMIUM"] = "PREMIUM";
|
|
19
|
+
})(ProductTierEnum || (exports.ProductTierEnum = ProductTierEnum = {}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './enums/ProductTierEnum';
|
|
2
|
+
export * from './enums/ProductStatusEnum';
|
|
3
|
+
export * from './enums/InventoryItemStatusEnum';
|
|
4
|
+
export * from './enums/MdmProviderEnum';
|
|
5
|
+
export * from './enums/MdmLockModeEnum';
|
|
6
|
+
export * from './constants/SkuPattern';
|
|
7
|
+
export * from './validators/IsMdmCoherentConstraint';
|
|
8
|
+
export * from './dtos/Product';
|
|
9
|
+
export * from './dtos/InventoryItem';
|
|
10
|
+
export * from './dtos/requests/CreateProductRequest';
|
|
11
|
+
export * from './dtos/requests/UpdateProductRequest';
|
|
12
|
+
export * from './dtos/requests/UpdateProductStatusRequest';
|
|
13
|
+
export * from './dtos/requests/ListProductsQuery';
|
|
14
|
+
export * from './dtos/requests/RegisterInventoryRequest';
|
|
15
|
+
export * from './dtos/requests/TransferInventoryRequest';
|
|
16
|
+
export * from './dtos/requests/ChangeInventoryStatusRequest';
|
|
17
|
+
export * from './dtos/responses/ProductResponse';
|
|
18
|
+
export * from './dtos/responses/InventoryItemResponse';
|
|
19
|
+
export * from './dtos/responses/ImportCsvFailure';
|
|
20
|
+
export * from './dtos/responses/ImportCsvResult';
|
|
21
|
+
export * from './dtos/validation/ValidateProductResponse';
|
|
22
|
+
export * from './dtos/validation/ValidateInventoryResponse';
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
__exportStar(require("./enums/ProductTierEnum"), exports);
|
|
18
|
+
__exportStar(require("./enums/ProductStatusEnum"), exports);
|
|
19
|
+
__exportStar(require("./enums/InventoryItemStatusEnum"), exports);
|
|
20
|
+
__exportStar(require("./enums/MdmProviderEnum"), exports);
|
|
21
|
+
__exportStar(require("./enums/MdmLockModeEnum"), exports);
|
|
22
|
+
// Constantes del dominio
|
|
23
|
+
__exportStar(require("./constants/SkuPattern"), exports);
|
|
24
|
+
// Validators custom
|
|
25
|
+
__exportStar(require("./validators/IsMdmCoherentConstraint"), exports);
|
|
26
|
+
// Entity DTOs
|
|
27
|
+
__exportStar(require("./dtos/Product"), exports);
|
|
28
|
+
__exportStar(require("./dtos/InventoryItem"), exports);
|
|
29
|
+
// Request DTOs (input validado por endpoint)
|
|
30
|
+
__exportStar(require("./dtos/requests/CreateProductRequest"), exports);
|
|
31
|
+
__exportStar(require("./dtos/requests/UpdateProductRequest"), exports);
|
|
32
|
+
__exportStar(require("./dtos/requests/UpdateProductStatusRequest"), exports);
|
|
33
|
+
__exportStar(require("./dtos/requests/ListProductsQuery"), exports);
|
|
34
|
+
__exportStar(require("./dtos/requests/RegisterInventoryRequest"), exports);
|
|
35
|
+
__exportStar(require("./dtos/requests/TransferInventoryRequest"), exports);
|
|
36
|
+
__exportStar(require("./dtos/requests/ChangeInventoryStatusRequest"), exports);
|
|
37
|
+
// Response DTOs
|
|
38
|
+
__exportStar(require("./dtos/responses/ProductResponse"), exports);
|
|
39
|
+
__exportStar(require("./dtos/responses/InventoryItemResponse"), exports);
|
|
40
|
+
__exportStar(require("./dtos/responses/ImportCsvFailure"), exports);
|
|
41
|
+
__exportStar(require("./dtos/responses/ImportCsvResult"), exports);
|
|
42
|
+
// Validation DTOs (shapes de endpoints privados)
|
|
43
|
+
__exportStar(require("./dtos/validation/ValidateProductResponse"), exports);
|
|
44
|
+
__exportStar(require("./dtos/validation/ValidateInventoryResponse"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ValidationArguments, type ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Coherencia de la config MDM del producto:
|
|
4
|
+
* - mdmEnabled === true → mdmProvider y mdmLockMode obligatorios.
|
|
5
|
+
* - mdmEnabled !== true → mdmProvider y mdmLockMode deben omitirse (null/undefined).
|
|
6
|
+
*/
|
|
7
|
+
export declare class IsMdmCoherentConstraint implements ValidatorConstraintInterface {
|
|
8
|
+
validate(_value: unknown, args: ValidationArguments): boolean;
|
|
9
|
+
defaultMessage(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IsMdmCoherentConstraint = void 0;
|
|
10
|
+
const class_validator_1 = require("class-validator");
|
|
11
|
+
/**
|
|
12
|
+
* Coherencia de la config MDM del producto:
|
|
13
|
+
* - mdmEnabled === true → mdmProvider y mdmLockMode obligatorios.
|
|
14
|
+
* - mdmEnabled !== true → mdmProvider y mdmLockMode deben omitirse (null/undefined).
|
|
15
|
+
*/
|
|
16
|
+
let IsMdmCoherentConstraint = class IsMdmCoherentConstraint {
|
|
17
|
+
validate(_value, args) {
|
|
18
|
+
const o = args.object;
|
|
19
|
+
if (o.mdmEnabled === true) {
|
|
20
|
+
return o.mdmProvider != null && o.mdmLockMode != null;
|
|
21
|
+
}
|
|
22
|
+
return o.mdmProvider == null && o.mdmLockMode == null;
|
|
23
|
+
}
|
|
24
|
+
defaultMessage() {
|
|
25
|
+
return 'Configuración MDM incoherente: con mdmEnabled=true se requieren mdmProvider y mdmLockMode; con mdmEnabled=false deben omitirse';
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.IsMdmCoherentConstraint = IsMdmCoherentConstraint;
|
|
29
|
+
exports.IsMdmCoherentConstraint = IsMdmCoherentConstraint = __decorate([
|
|
30
|
+
(0, class_validator_1.ValidatorConstraint)({ name: 'isMdmCoherent', async: false })
|
|
31
|
+
], IsMdmCoherentConstraint);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
|
|
2
|
+
import type { RetailUserStatusEnum } from '../../enums/RetailUserStatusEnum';
|
|
3
|
+
/**
|
|
4
|
+
* Shape mínimo de un cobrador retail que devuelve el endpoint privado de validación de cobradores
|
|
5
|
+
* (consumido por loan-collector-assignment-business vía @fiado/api-invoker) para alimentar el
|
|
6
|
+
* algoritmo de asignación de cartera.
|
|
7
|
+
*
|
|
8
|
+
* `coverageStoreIds` va requerido (siempre presente; si el cobrador aún no cubre tiendas, `[]`).
|
|
9
|
+
*
|
|
10
|
+
* `collectorSeniority` es OPCIONAL: el modelo de datos no obliga a que un usuario con
|
|
11
|
+
* `commissionTier === 'collector'` tenga seniority poblado, así que un cobrador sin seniority es
|
|
12
|
+
* válido. Las estrategias de asignación BY_STORE / BY_LOAD / ROUND_ROBIN no lo necesitan; solo
|
|
13
|
+
* BY_SENIORITY lo usa para rankear (y ahí un cobrador sin seniority simplemente no rankea).
|
|
14
|
+
*/
|
|
15
|
+
export interface CollectorValidationDto {
|
|
16
|
+
retailUserId: string;
|
|
17
|
+
coverageStoreIds: string[];
|
|
18
|
+
collectorSeniority?: CollectorSeniorityEnum;
|
|
19
|
+
status: RetailUserStatusEnum;
|
|
20
|
+
commissionTier: string;
|
|
21
|
+
}
|
package/bin/retailOrg/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './dtos/RetailUser';
|
|
|
13
13
|
export * from './dtos/validation/RetailerValidationDto';
|
|
14
14
|
export * from './dtos/validation/StoreValidationDto';
|
|
15
15
|
export * from './dtos/validation/RetailUserValidationDto';
|
|
16
|
+
export * from './dtos/validation/CollectorValidationDto';
|
|
16
17
|
export * from './dtos/PaginatedResult';
|
|
17
18
|
export * from './dtos/requests/RetailAddressInput';
|
|
18
19
|
export * from './dtos/requests/CreateRetailerRequest';
|
package/bin/retailOrg/index.js
CHANGED
|
@@ -31,6 +31,7 @@ __exportStar(require("./dtos/RetailUser"), exports);
|
|
|
31
31
|
__exportStar(require("./dtos/validation/RetailerValidationDto"), exports);
|
|
32
32
|
__exportStar(require("./dtos/validation/StoreValidationDto"), exports);
|
|
33
33
|
__exportStar(require("./dtos/validation/RetailUserValidationDto"), exports);
|
|
34
|
+
__exportStar(require("./dtos/validation/CollectorValidationDto"), exports);
|
|
34
35
|
// Paginación genérica
|
|
35
36
|
__exportStar(require("./dtos/PaginatedResult"), exports);
|
|
36
37
|
// Request DTOs (input validado por endpoint)
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -103,6 +103,12 @@ export * as EmailVerification from './emailVerification';
|
|
|
103
103
|
// RetailOrg: DTOs/enums del lambda retail-org-business (SureKeep Fase 1 — pista Retail).
|
|
104
104
|
// Dominio de retailers → zonas → tiendas → usuarios retail.
|
|
105
105
|
export * as RetailOrg from './retailOrg';
|
|
106
|
+
// RetailCatalog: DTOs/enums del lambda retail-catalog-business (comp 05 — catálogo de productos
|
|
107
|
+
// por SKU + inventario por IMEI; SureKeep Fase 1 — pista Retail).
|
|
108
|
+
export * as RetailCatalog from './retailCatalog';
|
|
109
|
+
// RetailCards: DTOs/enums del lambda retail-cards-business (comp 06 — tarjetas físicas PCF:
|
|
110
|
+
// lotes, stock y asignación; SureKeep Fase 1 — pista Retail).
|
|
111
|
+
export * as RetailCards from './retailCards';
|
|
106
112
|
// LoanConfig: DTOs/enums del lambda loan-config-business (comp 09 — parámetros operativos del SOFOM).
|
|
107
113
|
export * as LoanConfig from './loanConfig';
|
|
108
114
|
// LoanOfferings: DTOs/enums del lambda loan-offerings-business (comp 07 — planes de crédito,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IsOptional, IsString } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
/** Body de la asignación de una tarjeta física a un cliente. */
|
|
4
|
+
export class AssignCardRequest {
|
|
5
|
+
@IsString()
|
|
6
|
+
assignedToCustomerId!: string;
|
|
7
|
+
|
|
8
|
+
@IsString()
|
|
9
|
+
assignedByUserId!: string;
|
|
10
|
+
|
|
11
|
+
@IsOptional()
|
|
12
|
+
@IsString()
|
|
13
|
+
creditId?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IsEnum } from 'class-validator';
|
|
2
|
+
import { CardCancelReasonEnum } from '../../enums/CardCancelReasonEnum';
|
|
3
|
+
|
|
4
|
+
/** Body de la cancelación (anulación) de una tarjeta física. */
|
|
5
|
+
export class CancelCardRequest {
|
|
6
|
+
@IsEnum(CardCancelReasonEnum)
|
|
7
|
+
reason!: CardCancelReasonEnum;
|
|
8
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ArrayMaxSize, IsArray, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
/** Body del registro (recepción) de un lote de tarjetas para una tienda. */
|
|
4
|
+
export class RegisterCardBatchRequest {
|
|
5
|
+
@IsString()
|
|
6
|
+
storeId!: string;
|
|
7
|
+
|
|
8
|
+
@IsInt()
|
|
9
|
+
@Min(1)
|
|
10
|
+
@Max(1000)
|
|
11
|
+
totalCards!: number;
|
|
12
|
+
|
|
13
|
+
@IsArray()
|
|
14
|
+
@ArrayMaxSize(1000)
|
|
15
|
+
@IsString({ each: true })
|
|
16
|
+
cardNumbers!: string[];
|
|
17
|
+
|
|
18
|
+
@IsOptional()
|
|
19
|
+
@IsString()
|
|
20
|
+
notes?: string | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CardBatchStatusEnum } from '../../enums/CardBatchStatusEnum';
|
|
2
|
+
|
|
3
|
+
/** Representación de un lote de tarjetas hacia el cliente. */
|
|
4
|
+
export interface CardBatchResponse {
|
|
5
|
+
batchId: string;
|
|
6
|
+
retailerId: string;
|
|
7
|
+
storeId: string;
|
|
8
|
+
totalCards: number;
|
|
9
|
+
expectedCardCount: number;
|
|
10
|
+
loadedCount: number;
|
|
11
|
+
availableCount: number;
|
|
12
|
+
assignedCount: number;
|
|
13
|
+
cancelledCount: number;
|
|
14
|
+
status: CardBatchStatusEnum;
|
|
15
|
+
receivedAt: string;
|
|
16
|
+
receivedByUserId: string;
|
|
17
|
+
notes: string | null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RetailCardStatusEnum } from '../../enums/RetailCardStatusEnum';
|
|
2
|
+
|
|
3
|
+
/** Representación de una tarjeta física hacia el cliente. */
|
|
4
|
+
export interface RetailCardResponse {
|
|
5
|
+
cardNumber: string;
|
|
6
|
+
retailerId: string;
|
|
7
|
+
batchId: string;
|
|
8
|
+
storeId: string;
|
|
9
|
+
status: RetailCardStatusEnum;
|
|
10
|
+
assignedToCustomerId: string | null;
|
|
11
|
+
assignedAt: string | null;
|
|
12
|
+
assignedByUserId: string | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de un lote de tarjetas.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} RECEIVING - Transitorio, carga en curso (DEC-004/DEC-008).
|
|
6
|
+
* @property {string} RECEIVED - Carga completada, lote atado a una tienda (happy-path F1).
|
|
7
|
+
* @property {string} FAILED - Terminal, la carga del lote falló (DEC-004/DEC-008).
|
|
8
|
+
* @property {string} DISTRIBUTED - Reservado F1 — lote centralizado repartido a varias tiendas (TD-008).
|
|
9
|
+
* @property {string} CLOSED - Reservado F1 — cierre manual del lote (TD-008).
|
|
10
|
+
*/
|
|
11
|
+
export enum CardBatchStatusEnum {
|
|
12
|
+
RECEIVING = 'RECEIVING',
|
|
13
|
+
RECEIVED = 'RECEIVED',
|
|
14
|
+
FAILED = 'FAILED',
|
|
15
|
+
DISTRIBUTED = 'DISTRIBUTED',
|
|
16
|
+
CLOSED = 'CLOSED',
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motivo de cancelación de una tarjeta física.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} PLASTIC_DAMAGED - Plástico dañado.
|
|
6
|
+
* @property {string} LOST - Tarjeta perdida.
|
|
7
|
+
* @property {string} THEFT_REPORTED - Robo reportado.
|
|
8
|
+
*/
|
|
9
|
+
export enum CardCancelReasonEnum {
|
|
10
|
+
PLASTIC_DAMAGED = 'PLASTIC_DAMAGED',
|
|
11
|
+
LOST = 'LOST',
|
|
12
|
+
THEFT_REPORTED = 'THEFT_REPORTED',
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de una tarjeta física individual.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*
|
|
5
|
+
* @property {string} AVAILABLE - Cargada en stock, disponible para asignar.
|
|
6
|
+
* @property {string} ASSIGNED - Asignada a un cliente.
|
|
7
|
+
* @property {string} CANCELLED - Anulada (plástico dañado, pérdida o robo). Estado terminal.
|
|
8
|
+
*/
|
|
9
|
+
export enum RetailCardStatusEnum {
|
|
10
|
+
AVAILABLE = 'AVAILABLE',
|
|
11
|
+
ASSIGNED = 'ASSIGNED',
|
|
12
|
+
CANCELLED = 'CANCELLED',
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Emitido cuando una tarjeta se asigna a un cliente. */
|
|
2
|
+
export interface RetailCardAssignedV1 {
|
|
3
|
+
cardNumber: string;
|
|
4
|
+
retailerId: string;
|
|
5
|
+
storeId: string;
|
|
6
|
+
assignedToCustomerId: string;
|
|
7
|
+
assignedByUserId: string;
|
|
8
|
+
creditId?: string;
|
|
9
|
+
occurredAt: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CardCancelReasonEnum } from '../enums/CardCancelReasonEnum';
|
|
2
|
+
|
|
3
|
+
/** Emitido cuando una tarjeta se cancela (anula). */
|
|
4
|
+
export interface RetailCardCancelledV1 {
|
|
5
|
+
cardNumber: string;
|
|
6
|
+
retailerId: string;
|
|
7
|
+
storeId: string;
|
|
8
|
+
reason: CardCancelReasonEnum;
|
|
9
|
+
occurredAt: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './enums/RetailCardStatusEnum';
|
|
2
|
+
export * from './enums/CardBatchStatusEnum';
|
|
3
|
+
export * from './enums/CardCancelReasonEnum';
|
|
4
|
+
|
|
5
|
+
// Request DTOs (input validado por endpoint)
|
|
6
|
+
export * from './dtos/requests/RegisterCardBatchRequest';
|
|
7
|
+
export * from './dtos/requests/CancelCardRequest';
|
|
8
|
+
export * from './dtos/requests/AssignCardRequest';
|
|
9
|
+
|
|
10
|
+
// Response DTOs
|
|
11
|
+
export * from './dtos/responses/CardBatchResponse';
|
|
12
|
+
export * from './dtos/responses/RetailCardResponse';
|
|
13
|
+
export * from './dtos/responses/StockAlertItem';
|
|
14
|
+
export * from './dtos/responses/StockAlertsResponse';
|
|
15
|
+
|
|
16
|
+
// Contratos de eventos (PascalCase + sufijo V1)
|
|
17
|
+
export * from './events/CardBatchReceivedV1';
|
|
18
|
+
export * from './events/RetailCardAssignedV1';
|
|
19
|
+
export * from './events/RetailCardReleasedV1';
|
|
20
|
+
export * from './events/RetailCardCancelledV1';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InventoryItemStatusEnum } from '../enums/InventoryItemStatusEnum';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* InventoryItem — unidad física de inventario identificada por IMEI
|
|
5
|
+
* (lambda retail-catalog-business, SureKeep Fase 1 — pista Retail).
|
|
6
|
+
* Representación de salida/datos: sin decoradores class-validator.
|
|
7
|
+
*/
|
|
8
|
+
export class InventoryItem {
|
|
9
|
+
imei!: string;
|
|
10
|
+
retailerId!: string;
|
|
11
|
+
productId!: string;
|
|
12
|
+
storeId!: string;
|
|
13
|
+
status!: InventoryItemStatusEnum;
|
|
14
|
+
receivedAt!: string;
|
|
15
|
+
soldAt!: string | null;
|
|
16
|
+
soldToCustomerId!: string | null;
|
|
17
|
+
createdBy!: string;
|
|
18
|
+
updatedBy!: string;
|
|
19
|
+
createdAt!: string;
|
|
20
|
+
updatedAt!: string;
|
|
21
|
+
}
|