@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.
Files changed (135) hide show
  1. package/_test_/unit/retailOrg/dtos/validation/validationDtos.test.ts +27 -0
  2. package/bin/benefitCenter/enums/BenefitFlowEnum.d.ts +11 -0
  3. package/bin/benefitCenter/enums/BenefitFlowEnum.js +15 -0
  4. package/bin/index.d.ts +2 -0
  5. package/bin/index.js +7 -1
  6. package/bin/loanConfig/enums/ModifiableByRoleEnum.d.ts +11 -0
  7. package/bin/loanConfig/enums/ModifiableByRoleEnum.js +15 -0
  8. package/bin/places/dtos/CashInFeeDto.d.ts +17 -0
  9. package/bin/places/dtos/CashInFeeDto.js +12 -0
  10. package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +22 -0
  11. package/bin/platformRbac/dtos/ResendOtpRequest.js +36 -0
  12. package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
  13. package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.js +36 -0
  14. package/bin/retailCards/dtos/requests/AssignCardRequest.d.ts +6 -0
  15. package/bin/retailCards/dtos/requests/AssignCardRequest.js +30 -0
  16. package/bin/retailCards/dtos/requests/CancelCardRequest.d.ts +5 -0
  17. package/bin/retailCards/dtos/requests/CancelCardRequest.js +22 -0
  18. package/bin/retailCards/dtos/requests/RegisterCardBatchRequest.d.ts +7 -0
  19. package/bin/retailCards/dtos/requests/RegisterCardBatchRequest.js +38 -0
  20. package/bin/retailCards/dtos/responses/CardBatchResponse.d.ts +17 -0
  21. package/bin/retailCards/dtos/responses/CardBatchResponse.js +2 -0
  22. package/bin/retailCards/dtos/responses/RetailCardResponse.d.ts +12 -0
  23. package/bin/retailCards/dtos/responses/RetailCardResponse.js +2 -0
  24. package/bin/retailCards/dtos/responses/StockAlertItem.d.ts +7 -0
  25. package/bin/retailCards/dtos/responses/StockAlertItem.js +2 -0
  26. package/bin/retailCards/dtos/responses/StockAlertsResponse.d.ts +5 -0
  27. package/bin/retailCards/dtos/responses/StockAlertsResponse.js +2 -0
  28. package/bin/retailCards/enums/CardBatchStatusEnum.d.ts +17 -0
  29. package/bin/retailCards/enums/CardBatchStatusEnum.js +21 -0
  30. package/bin/retailCards/enums/CardCancelReasonEnum.d.ts +13 -0
  31. package/bin/retailCards/enums/CardCancelReasonEnum.js +17 -0
  32. package/bin/retailCards/enums/RetailCardStatusEnum.d.ts +13 -0
  33. package/bin/retailCards/enums/RetailCardStatusEnum.js +17 -0
  34. package/bin/retailCards/events/CardBatchReceivedV1.d.ts +9 -0
  35. package/bin/retailCards/events/CardBatchReceivedV1.js +2 -0
  36. package/bin/retailCards/events/RetailCardAssignedV1.d.ts +10 -0
  37. package/bin/retailCards/events/RetailCardAssignedV1.js +2 -0
  38. package/bin/retailCards/events/RetailCardCancelledV1.d.ts +9 -0
  39. package/bin/retailCards/events/RetailCardCancelledV1.js +2 -0
  40. package/bin/retailCards/events/RetailCardReleasedV1.d.ts +7 -0
  41. package/bin/retailCards/events/RetailCardReleasedV1.js +2 -0
  42. package/bin/retailCards/index.d.ts +14 -0
  43. package/bin/retailCards/index.js +33 -0
  44. package/bin/retailCatalog/constants/SkuPattern.d.ts +2 -0
  45. package/bin/retailCatalog/constants/SkuPattern.js +5 -0
  46. package/bin/retailCatalog/dtos/InventoryItem.d.ts +20 -0
  47. package/bin/retailCatalog/dtos/InventoryItem.js +11 -0
  48. package/bin/retailCatalog/dtos/Product.d.ts +34 -0
  49. package/bin/retailCatalog/dtos/Product.js +11 -0
  50. package/bin/retailCatalog/dtos/requests/ChangeInventoryStatusRequest.d.ts +8 -0
  51. package/bin/retailCatalog/dtos/requests/ChangeInventoryStatusRequest.js +25 -0
  52. package/bin/retailCatalog/dtos/requests/CreateProductRequest.d.ts +22 -0
  53. package/bin/retailCatalog/dtos/requests/CreateProductRequest.js +98 -0
  54. package/bin/retailCatalog/dtos/requests/ListProductsQuery.d.ts +9 -0
  55. package/bin/retailCatalog/dtos/requests/ListProductsQuery.js +39 -0
  56. package/bin/retailCatalog/dtos/requests/RegisterInventoryRequest.d.ts +5 -0
  57. package/bin/retailCatalog/dtos/requests/RegisterInventoryRequest.js +27 -0
  58. package/bin/retailCatalog/dtos/requests/TransferInventoryRequest.d.ts +4 -0
  59. package/bin/retailCatalog/dtos/requests/TransferInventoryRequest.js +21 -0
  60. package/bin/retailCatalog/dtos/requests/UpdateProductRequest.d.ts +21 -0
  61. package/bin/retailCatalog/dtos/requests/UpdateProductRequest.js +100 -0
  62. package/bin/retailCatalog/dtos/requests/UpdateProductStatusRequest.d.ts +5 -0
  63. package/bin/retailCatalog/dtos/requests/UpdateProductStatusRequest.js +22 -0
  64. package/bin/retailCatalog/dtos/responses/ImportCsvFailure.d.ts +5 -0
  65. package/bin/retailCatalog/dtos/responses/ImportCsvFailure.js +7 -0
  66. package/bin/retailCatalog/dtos/responses/ImportCsvResult.d.ts +6 -0
  67. package/bin/retailCatalog/dtos/responses/ImportCsvResult.js +7 -0
  68. package/bin/retailCatalog/dtos/responses/InventoryItemResponse.d.ts +3 -0
  69. package/bin/retailCatalog/dtos/responses/InventoryItemResponse.js +2 -0
  70. package/bin/retailCatalog/dtos/responses/ProductResponse.d.ts +3 -0
  71. package/bin/retailCatalog/dtos/responses/ProductResponse.js +2 -0
  72. package/bin/retailCatalog/dtos/validation/ValidateInventoryResponse.d.ts +11 -0
  73. package/bin/retailCatalog/dtos/validation/ValidateInventoryResponse.js +10 -0
  74. package/bin/retailCatalog/dtos/validation/ValidateProductResponse.d.ts +20 -0
  75. package/bin/retailCatalog/dtos/validation/ValidateProductResponse.js +11 -0
  76. package/bin/retailCatalog/enums/InventoryItemStatusEnum.d.ts +18 -0
  77. package/bin/retailCatalog/enums/InventoryItemStatusEnum.js +22 -0
  78. package/bin/retailCatalog/enums/MdmLockModeEnum.d.ts +17 -0
  79. package/bin/retailCatalog/enums/MdmLockModeEnum.js +21 -0
  80. package/bin/retailCatalog/enums/MdmProviderEnum.d.ts +11 -0
  81. package/bin/retailCatalog/enums/MdmProviderEnum.js +15 -0
  82. package/bin/retailCatalog/enums/ProductStatusEnum.d.ts +13 -0
  83. package/bin/retailCatalog/enums/ProductStatusEnum.js +17 -0
  84. package/bin/retailCatalog/enums/ProductTierEnum.d.ts +15 -0
  85. package/bin/retailCatalog/enums/ProductTierEnum.js +19 -0
  86. package/bin/retailCatalog/index.d.ts +22 -0
  87. package/bin/retailCatalog/index.js +44 -0
  88. package/bin/retailCatalog/validators/IsMdmCoherentConstraint.d.ts +10 -0
  89. package/bin/retailCatalog/validators/IsMdmCoherentConstraint.js +31 -0
  90. package/bin/retailOrg/dtos/validation/CollectorValidationDto.d.ts +21 -0
  91. package/bin/retailOrg/dtos/validation/CollectorValidationDto.js +2 -0
  92. package/bin/retailOrg/index.d.ts +1 -0
  93. package/bin/retailOrg/index.js +1 -0
  94. package/package.json +1 -1
  95. package/src/index.ts +6 -0
  96. package/src/retailCards/dtos/requests/AssignCardRequest.ts +14 -0
  97. package/src/retailCards/dtos/requests/CancelCardRequest.ts +8 -0
  98. package/src/retailCards/dtos/requests/RegisterCardBatchRequest.ts +21 -0
  99. package/src/retailCards/dtos/responses/CardBatchResponse.ts +18 -0
  100. package/src/retailCards/dtos/responses/RetailCardResponse.ts +13 -0
  101. package/src/retailCards/dtos/responses/StockAlertItem.ts +7 -0
  102. package/src/retailCards/dtos/responses/StockAlertsResponse.ts +6 -0
  103. package/src/retailCards/enums/CardBatchStatusEnum.ts +17 -0
  104. package/src/retailCards/enums/CardCancelReasonEnum.ts +13 -0
  105. package/src/retailCards/enums/RetailCardStatusEnum.ts +13 -0
  106. package/src/retailCards/events/CardBatchReceivedV1.ts +9 -0
  107. package/src/retailCards/events/RetailCardAssignedV1.ts +10 -0
  108. package/src/retailCards/events/RetailCardCancelledV1.ts +10 -0
  109. package/src/retailCards/events/RetailCardReleasedV1.ts +7 -0
  110. package/src/retailCards/index.ts +20 -0
  111. package/src/retailCatalog/constants/SkuPattern.ts +2 -0
  112. package/src/retailCatalog/dtos/InventoryItem.ts +21 -0
  113. package/src/retailCatalog/dtos/Product.ts +35 -0
  114. package/src/retailCatalog/dtos/requests/ChangeInventoryStatusRequest.ts +11 -0
  115. package/src/retailCatalog/dtos/requests/CreateProductRequest.ts +81 -0
  116. package/src/retailCatalog/dtos/requests/ListProductsQuery.ts +22 -0
  117. package/src/retailCatalog/dtos/requests/RegisterInventoryRequest.ts +12 -0
  118. package/src/retailCatalog/dtos/requests/TransferInventoryRequest.ts +7 -0
  119. package/src/retailCatalog/dtos/requests/UpdateProductRequest.ts +82 -0
  120. package/src/retailCatalog/dtos/requests/UpdateProductStatusRequest.ts +8 -0
  121. package/src/retailCatalog/dtos/responses/ImportCsvFailure.ts +5 -0
  122. package/src/retailCatalog/dtos/responses/ImportCsvResult.ts +7 -0
  123. package/src/retailCatalog/dtos/responses/InventoryItemResponse.ts +4 -0
  124. package/src/retailCatalog/dtos/responses/ProductResponse.ts +4 -0
  125. package/src/retailCatalog/dtos/validation/ValidateInventoryResponse.ts +12 -0
  126. package/src/retailCatalog/dtos/validation/ValidateProductResponse.ts +21 -0
  127. package/src/retailCatalog/enums/InventoryItemStatusEnum.ts +18 -0
  128. package/src/retailCatalog/enums/MdmLockModeEnum.ts +17 -0
  129. package/src/retailCatalog/enums/MdmProviderEnum.ts +11 -0
  130. package/src/retailCatalog/enums/ProductStatusEnum.ts +13 -0
  131. package/src/retailCatalog/enums/ProductTierEnum.ts +15 -0
  132. package/src/retailCatalog/index.ts +34 -0
  133. package/src/retailCatalog/validators/IsMdmCoherentConstraint.ts +25 -0
  134. package/src/retailOrg/dtos/validation/CollectorValidationDto.ts +22 -0
  135. package/src/retailOrg/index.ts +1 -0
@@ -0,0 +1,35 @@
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
+ /**
7
+ * Product — aggregate root del catálogo del dominio `retailCatalog`
8
+ * (lambda retail-catalog-business, SureKeep Fase 1 — pista Retail).
9
+ * Representación de salida/datos: sin decoradores class-validator.
10
+ */
11
+ export class Product {
12
+ productId!: string;
13
+ retailerId!: string;
14
+ sku!: string;
15
+ externalId!: string | null;
16
+ brand!: string;
17
+ model!: string;
18
+ capacity!: string;
19
+ color!: string;
20
+ description!: string;
21
+ specs!: Record<string, unknown> | null;
22
+ imageUrl!: string | null;
23
+ tier!: ProductTierEnum;
24
+ basePriceCents!: number;
25
+ listPriceCents!: number | null;
26
+ eligibleFinanciers!: string[];
27
+ mdmEnabled!: boolean;
28
+ mdmProvider!: MdmProviderEnum | null;
29
+ mdmLockMode!: MdmLockModeEnum | null;
30
+ status!: ProductStatusEnum;
31
+ createdBy!: string;
32
+ updatedBy!: string;
33
+ createdAt!: string;
34
+ updatedAt!: string;
35
+ }
@@ -0,0 +1,11 @@
1
+ import { IsIn } from 'class-validator';
2
+ import { InventoryItemStatusEnum } from '../../enums/InventoryItemStatusEnum';
3
+
4
+ /**
5
+ * Body de PUT /retailers/:retailerId/inventory/:imei/status — cambio manual de estado.
6
+ * Acotado a RETURNED | DAMAGED (los otros estados los mueve la máquina de venta, no el operador).
7
+ */
8
+ export class ChangeInventoryStatusRequest {
9
+ @IsIn([InventoryItemStatusEnum.RETURNED, InventoryItemStatusEnum.DAMAGED])
10
+ status!: InventoryItemStatusEnum.RETURNED | InventoryItemStatusEnum.DAMAGED;
11
+ }
@@ -0,0 +1,81 @@
1
+ import {
2
+ IsArray,
3
+ IsBoolean,
4
+ IsEnum,
5
+ IsInt,
6
+ IsObject,
7
+ IsOptional,
8
+ IsString,
9
+ Length,
10
+ Matches,
11
+ Min,
12
+ Validate,
13
+ } from 'class-validator';
14
+ import { SKU_PATTERN } from '../../constants/SkuPattern';
15
+ import { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
16
+ import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
17
+ import { ProductTierEnum } from '../../enums/ProductTierEnum';
18
+ import { IsMdmCoherentConstraint } from '../../validators/IsMdmCoherentConstraint';
19
+
20
+ /** Body de POST /retailers/:retailerId/products — alta de producto (retailerId/status/audit son server-set). */
21
+ export class CreateProductRequest {
22
+ @Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
23
+ @Length(1, 64)
24
+ @IsString()
25
+ sku!: string;
26
+
27
+ @IsOptional()
28
+ @IsString()
29
+ externalId?: string | null;
30
+
31
+ @IsString()
32
+ brand!: string;
33
+
34
+ @IsString()
35
+ model!: string;
36
+
37
+ @IsString()
38
+ capacity!: string;
39
+
40
+ @IsString()
41
+ color!: string;
42
+
43
+ @IsString()
44
+ description!: string;
45
+
46
+ @IsOptional()
47
+ @IsObject()
48
+ specs?: Record<string, unknown> | null;
49
+
50
+ @IsOptional()
51
+ @IsString()
52
+ imageUrl?: string | null;
53
+
54
+ @IsEnum(ProductTierEnum)
55
+ tier!: ProductTierEnum;
56
+
57
+ @IsInt()
58
+ @Min(0)
59
+ basePriceCents!: number;
60
+
61
+ @IsOptional()
62
+ @IsInt()
63
+ @Min(0)
64
+ listPriceCents?: number | null;
65
+
66
+ @IsArray()
67
+ @IsString({ each: true })
68
+ eligibleFinanciers!: string[];
69
+
70
+ @Validate(IsMdmCoherentConstraint)
71
+ @IsBoolean()
72
+ mdmEnabled!: boolean;
73
+
74
+ @IsOptional()
75
+ @IsEnum(MdmProviderEnum)
76
+ mdmProvider?: MdmProviderEnum | null;
77
+
78
+ @IsOptional()
79
+ @IsEnum(MdmLockModeEnum)
80
+ mdmLockMode?: MdmLockModeEnum | null;
81
+ }
@@ -0,0 +1,22 @@
1
+ import { IsEnum, IsOptional, IsString } from 'class-validator';
2
+ import { ProductStatusEnum } from '../../enums/ProductStatusEnum';
3
+ import { ProductTierEnum } from '../../enums/ProductTierEnum';
4
+
5
+ /** Query string de GET /retailers/:retailerId/products — filtros opcionales. */
6
+ export class ListProductsQuery {
7
+ @IsOptional()
8
+ @IsString()
9
+ brand?: string;
10
+
11
+ @IsOptional()
12
+ @IsString()
13
+ model?: string;
14
+
15
+ @IsOptional()
16
+ @IsEnum(ProductTierEnum)
17
+ tier?: ProductTierEnum;
18
+
19
+ @IsOptional()
20
+ @IsEnum(ProductStatusEnum)
21
+ status?: ProductStatusEnum;
22
+ }
@@ -0,0 +1,12 @@
1
+ import { ArrayNotEmpty, IsArray, IsString } from 'class-validator';
2
+
3
+ /** Body de POST /retailers/:retailerId/stores/:storeId/inventory — registrar IMEIs nuevos (lote). */
4
+ export class RegisterInventoryRequest {
5
+ @IsString()
6
+ productSku!: string;
7
+
8
+ @IsArray()
9
+ @ArrayNotEmpty()
10
+ @IsString({ each: true })
11
+ imeis!: string[];
12
+ }
@@ -0,0 +1,7 @@
1
+ import { IsString } from 'class-validator';
2
+
3
+ /** Body de PUT /retailers/:retailerId/inventory/:imei/transfer — mover IMEI a otro store. */
4
+ export class TransferInventoryRequest {
5
+ @IsString()
6
+ newStoreId!: string;
7
+ }
@@ -0,0 +1,82 @@
1
+ import {
2
+ IsArray,
3
+ IsBoolean,
4
+ IsEnum,
5
+ IsInt,
6
+ IsObject,
7
+ IsOptional,
8
+ IsString,
9
+ Min,
10
+ Validate,
11
+ } from 'class-validator';
12
+ import { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
13
+ import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
14
+ import { ProductTierEnum } from '../../enums/ProductTierEnum';
15
+ import { IsMdmCoherentConstraint } from '../../validators/IsMdmCoherentConstraint';
16
+
17
+ /** Body de PUT /retailers/:retailerId/products/:sku — actualización parcial (sku y status son inmutables acá). */
18
+ export class UpdateProductRequest {
19
+ @IsOptional()
20
+ @IsString()
21
+ externalId?: string | null;
22
+
23
+ @IsOptional()
24
+ @IsString()
25
+ brand?: string;
26
+
27
+ @IsOptional()
28
+ @IsString()
29
+ model?: string;
30
+
31
+ @IsOptional()
32
+ @IsString()
33
+ capacity?: string;
34
+
35
+ @IsOptional()
36
+ @IsString()
37
+ color?: string;
38
+
39
+ @IsOptional()
40
+ @IsString()
41
+ description?: string;
42
+
43
+ @IsOptional()
44
+ @IsObject()
45
+ specs?: Record<string, unknown> | null;
46
+
47
+ @IsOptional()
48
+ @IsString()
49
+ imageUrl?: string | null;
50
+
51
+ @IsOptional()
52
+ @IsEnum(ProductTierEnum)
53
+ tier?: ProductTierEnum;
54
+
55
+ @IsOptional()
56
+ @IsInt()
57
+ @Min(0)
58
+ basePriceCents?: number;
59
+
60
+ @IsOptional()
61
+ @IsInt()
62
+ @Min(0)
63
+ listPriceCents?: number | null;
64
+
65
+ @IsOptional()
66
+ @IsArray()
67
+ @IsString({ each: true })
68
+ eligibleFinanciers?: string[];
69
+
70
+ @Validate(IsMdmCoherentConstraint)
71
+ @IsOptional()
72
+ @IsBoolean()
73
+ mdmEnabled?: boolean;
74
+
75
+ @IsOptional()
76
+ @IsEnum(MdmProviderEnum)
77
+ mdmProvider?: MdmProviderEnum | null;
78
+
79
+ @IsOptional()
80
+ @IsEnum(MdmLockModeEnum)
81
+ mdmLockMode?: MdmLockModeEnum | null;
82
+ }
@@ -0,0 +1,8 @@
1
+ import { IsEnum } from 'class-validator';
2
+ import { ProductStatusEnum } from '../../enums/ProductStatusEnum';
3
+
4
+ /** Body de PUT /retailers/:retailerId/products/:sku/status — ACTIVE | DISCONTINUED. */
5
+ export class UpdateProductStatusRequest {
6
+ @IsEnum(ProductStatusEnum)
7
+ status!: ProductStatusEnum;
8
+ }
@@ -0,0 +1,5 @@
1
+ /** Detalle de una fila rechazada en la carga CSV de productos. */
2
+ export class ImportCsvFailure {
3
+ fila!: number;
4
+ motivo!: string;
5
+ }
@@ -0,0 +1,7 @@
1
+ import { ImportCsvFailure } from './ImportCsvFailure';
2
+
3
+ /** Response de POST /retailers/:retailerId/products/import-csv — resultado de la carga masiva. */
4
+ export class ImportCsvResult {
5
+ committed!: string[];
6
+ failed!: ImportCsvFailure[];
7
+ }
@@ -0,0 +1,4 @@
1
+ import { InventoryItem } from '../InventoryItem';
2
+
3
+ /** Response de los endpoints de inventario (= entidad InventoryItem). */
4
+ export type InventoryItemResponse = InventoryItem;
@@ -0,0 +1,4 @@
1
+ import { Product } from '../Product';
2
+
3
+ /** Response de los endpoints de producto (= entidad Product). */
4
+ export type ProductResponse = Product;
@@ -0,0 +1,12 @@
1
+ import { InventoryItemStatusEnum } from '../../enums/InventoryItemStatusEnum';
2
+
3
+ /**
4
+ * Response de GET /private/inventory/:imei — validar IMEI + status + store + producto.
5
+ * Shape de salida → sin class-validator.
6
+ */
7
+ export class ValidateInventoryResponse {
8
+ imei!: string;
9
+ status!: InventoryItemStatusEnum;
10
+ storeId!: string;
11
+ productId!: string;
12
+ }
@@ -0,0 +1,21 @@
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
+ /**
7
+ * Response de GET /private/products/:retailerId/:sku — validar que el producto existe + status.
8
+ * Incluye los campos que los downstream consumen: `eligibleFinanciers` (wizard F2 paso 4)
9
+ * y la config MDM (device router F4+). Shape de salida → sin class-validator.
10
+ */
11
+ export class ValidateProductResponse {
12
+ productId!: string;
13
+ retailerId!: string;
14
+ sku!: string;
15
+ status!: ProductStatusEnum;
16
+ tier!: ProductTierEnum;
17
+ eligibleFinanciers!: string[];
18
+ mdmEnabled!: boolean;
19
+ mdmProvider!: MdmProviderEnum | null;
20
+ mdmLockMode!: MdmLockModeEnum | null;
21
+ }
@@ -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 enum InventoryItemStatusEnum {
13
+ AVAILABLE = 'AVAILABLE',
14
+ RESERVED = 'RESERVED',
15
+ SOLD = 'SOLD',
16
+ RETURNED = 'RETURNED',
17
+ DAMAGED = 'DAMAGED',
18
+ }
@@ -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 enum MdmLockModeEnum {
15
+ ONDEMAND = 'ONDEMAND',
16
+ SCHEDULED = 'SCHEDULED',
17
+ }
@@ -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 enum MdmProviderEnum {
9
+ TRUSTONIC = 'TRUSTONIC',
10
+ DATACULTR = 'DATACULTR',
11
+ }
@@ -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 enum ProductStatusEnum {
10
+ ACTIVE = 'ACTIVE',
11
+ INACTIVE = 'INACTIVE',
12
+ DISCONTINUED = 'DISCONTINUED',
13
+ }
@@ -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 enum ProductTierEnum {
11
+ LOW = 'LOW',
12
+ MID = 'MID',
13
+ HIGH = 'HIGH',
14
+ PREMIUM = 'PREMIUM',
15
+ }
@@ -0,0 +1,34 @@
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
+
7
+ // Constantes del dominio
8
+ export * from './constants/SkuPattern';
9
+
10
+ // Validators custom
11
+ export * from './validators/IsMdmCoherentConstraint';
12
+
13
+ // Entity DTOs
14
+ export * from './dtos/Product';
15
+ export * from './dtos/InventoryItem';
16
+
17
+ // Request DTOs (input validado por endpoint)
18
+ export * from './dtos/requests/CreateProductRequest';
19
+ export * from './dtos/requests/UpdateProductRequest';
20
+ export * from './dtos/requests/UpdateProductStatusRequest';
21
+ export * from './dtos/requests/ListProductsQuery';
22
+ export * from './dtos/requests/RegisterInventoryRequest';
23
+ export * from './dtos/requests/TransferInventoryRequest';
24
+ export * from './dtos/requests/ChangeInventoryStatusRequest';
25
+
26
+ // Response DTOs
27
+ export * from './dtos/responses/ProductResponse';
28
+ export * from './dtos/responses/InventoryItemResponse';
29
+ export * from './dtos/responses/ImportCsvFailure';
30
+ export * from './dtos/responses/ImportCsvResult';
31
+
32
+ // Validation DTOs (shapes de endpoints privados)
33
+ export * from './dtos/validation/ValidateProductResponse';
34
+ export * from './dtos/validation/ValidateInventoryResponse';
@@ -0,0 +1,25 @@
1
+ import {
2
+ ValidatorConstraint,
3
+ type ValidationArguments,
4
+ type ValidatorConstraintInterface,
5
+ } from 'class-validator';
6
+
7
+ /**
8
+ * Coherencia de la config MDM del producto:
9
+ * - mdmEnabled === true → mdmProvider y mdmLockMode obligatorios.
10
+ * - mdmEnabled !== true → mdmProvider y mdmLockMode deben omitirse (null/undefined).
11
+ */
12
+ @ValidatorConstraint({ name: 'isMdmCoherent', async: false })
13
+ export class IsMdmCoherentConstraint implements ValidatorConstraintInterface {
14
+ validate(_value: unknown, args: ValidationArguments): boolean {
15
+ const o = args.object as { mdmEnabled?: boolean; mdmProvider?: unknown; mdmLockMode?: unknown };
16
+ if (o.mdmEnabled === true) {
17
+ return o.mdmProvider != null && o.mdmLockMode != null;
18
+ }
19
+ return o.mdmProvider == null && o.mdmLockMode == null;
20
+ }
21
+
22
+ defaultMessage(): string {
23
+ return 'Configuración MDM incoherente: con mdmEnabled=true se requieren mdmProvider y mdmLockMode; con mdmEnabled=false deben omitirse';
24
+ }
25
+ }
@@ -0,0 +1,22 @@
1
+ import type { CollectorSeniorityEnum } from '../../enums/CollectorSeniorityEnum';
2
+ import type { RetailUserStatusEnum } from '../../enums/RetailUserStatusEnum';
3
+
4
+ /**
5
+ * Shape mínimo de un cobrador retail que devuelve el endpoint privado de validación de cobradores
6
+ * (consumido por loan-collector-assignment-business vía @fiado/api-invoker) para alimentar el
7
+ * algoritmo de asignación de cartera.
8
+ *
9
+ * `coverageStoreIds` va requerido (siempre presente; si el cobrador aún no cubre tiendas, `[]`).
10
+ *
11
+ * `collectorSeniority` es OPCIONAL: el modelo de datos no obliga a que un usuario con
12
+ * `commissionTier === 'collector'` tenga seniority poblado, así que un cobrador sin seniority es
13
+ * válido. Las estrategias de asignación BY_STORE / BY_LOAD / ROUND_ROBIN no lo necesitan; solo
14
+ * BY_SENIORITY lo usa para rankear (y ahí un cobrador sin seniority simplemente no rankea).
15
+ */
16
+ export interface CollectorValidationDto {
17
+ retailUserId: string;
18
+ coverageStoreIds: string[];
19
+ collectorSeniority?: CollectorSeniorityEnum;
20
+ status: RetailUserStatusEnum;
21
+ commissionTier: string;
22
+ }
@@ -17,6 +17,7 @@ export * from './dtos/RetailUser';
17
17
  export * from './dtos/validation/RetailerValidationDto';
18
18
  export * from './dtos/validation/StoreValidationDto';
19
19
  export * from './dtos/validation/RetailUserValidationDto';
20
+ export * from './dtos/validation/CollectorValidationDto';
20
21
 
21
22
  // Paginación genérica
22
23
  export * from './dtos/PaginatedResult';