@fiado/type-kit 3.479.0 → 3.480.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.
@@ -141,6 +141,10 @@ describe('BackofficeRegisterEntryRequest (backofficeRegisterEntry)', () => {
141
141
  expect(errorsOf(BackofficeRegisterEntryRequest, { ...ok, identifiers: [' '] })).toContain('identifiers');
142
142
  expect(errorsOf(BackofficeRegisterEntryRequest, { ...ok, identifiers: ['A1', 'A1'] })).toContain('identifiers');
143
143
  });
144
+ it('acepta el motivo sobrante de conteo y rechaza motivos desconocidos', () => {
145
+ expect(errorsOf(BackofficeRegisterEntryRequest, { ...ok, reason: InventoryMovementReasonEnum.COUNT_SURPLUS })).toEqual([]);
146
+ expect(errorsOf(BackofficeRegisterEntryRequest, { ...ok, reason: 'LOST' })).toContain('reason');
147
+ });
144
148
  });
145
149
 
146
150
  describe('BackofficeRegisterAdjustmentRequest (backofficeRegisterAdjustment)', () => {
@@ -55,7 +55,7 @@ describe('retailCatalog — enums de la operación independiente', () => {
55
55
 
56
56
  it('expone el motivo de un movimiento', () => {
57
57
  expect(Object.values(RetailCatalog.InventoryMovementReasonEnum)).toEqual([
58
- 'SHRINKAGE', 'ADJUSTMENT', 'WARRANTY', 'DAMAGED_RETURN',
58
+ 'SHRINKAGE', 'ADJUSTMENT', 'WARRANTY', 'DAMAGED_RETURN', 'COUNT_SURPLUS',
59
59
  ]);
60
60
  });
61
61
  });
@@ -1,3 +1,4 @@
1
+ import { InventoryMovementReasonEnum } from '../../enums/InventoryMovementReasonEnum';
1
2
  /** Body de POST /backoffice/inventory/entries (backofficeRegisterEntry); suma al saldo de la tienda con un MOV# ENTRY. */
2
3
  export declare class BackofficeRegisterEntryRequest {
3
4
  /** Debe pertenecer al retailer del token. */
@@ -6,4 +7,6 @@ export declare class BackofficeRegisterEntryRequest {
6
7
  qty: number;
7
8
  /** IMEI o serie de cada pieza; ausente si el SKU se rastrea por cantidad. */
8
9
  identifiers?: string[];
10
+ /** Motivo de la entrada; COUNT_SURPLUS marca un sobrante de conteo. Ausente en una entrada normal. */
11
+ reason?: InventoryMovementReasonEnum;
9
12
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BackofficeRegisterEntryRequest = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const SkuPattern_1 = require("../../constants/SkuPattern");
15
+ const InventoryMovementReasonEnum_1 = require("../../enums/InventoryMovementReasonEnum");
15
16
  /** Body de POST /backoffice/inventory/entries (backofficeRegisterEntry); suma al saldo de la tienda con un MOV# ENTRY. */
16
17
  class BackofficeRegisterEntryRequest {
17
18
  }
@@ -41,3 +42,8 @@ __decorate([
41
42
  (0, class_validator_1.IsString)({ each: true }),
42
43
  __metadata("design:type", Array)
43
44
  ], BackofficeRegisterEntryRequest.prototype, "identifiers", void 0);
45
+ __decorate([
46
+ (0, class_validator_1.IsOptional)(),
47
+ (0, class_validator_1.IsEnum)(InventoryMovementReasonEnum_1.InventoryMovementReasonEnum),
48
+ __metadata("design:type", String)
49
+ ], BackofficeRegisterEntryRequest.prototype, "reason", void 0);
@@ -1,7 +1,8 @@
1
- /** Motivo de un movimiento manual de inventario (MOV#): merma, ajuste, garantía o devolución dañada. */
1
+ /** Motivo de un movimiento manual de inventario (MOV#): merma, ajuste, garantía, devolución dañada o sobrante de conteo. */
2
2
  export declare enum InventoryMovementReasonEnum {
3
3
  SHRINKAGE = "SHRINKAGE",
4
4
  ADJUSTMENT = "ADJUSTMENT",
5
5
  WARRANTY = "WARRANTY",
6
- DAMAGED_RETURN = "DAMAGED_RETURN"
6
+ DAMAGED_RETURN = "DAMAGED_RETURN",
7
+ COUNT_SURPLUS = "COUNT_SURPLUS"
7
8
  }
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InventoryMovementReasonEnum = void 0;
4
- /** Motivo de un movimiento manual de inventario (MOV#): merma, ajuste, garantía o devolución dañada. */
4
+ /** Motivo de un movimiento manual de inventario (MOV#): merma, ajuste, garantía, devolución dañada o sobrante de conteo. */
5
5
  var InventoryMovementReasonEnum;
6
6
  (function (InventoryMovementReasonEnum) {
7
7
  InventoryMovementReasonEnum["SHRINKAGE"] = "SHRINKAGE";
8
8
  InventoryMovementReasonEnum["ADJUSTMENT"] = "ADJUSTMENT";
9
9
  InventoryMovementReasonEnum["WARRANTY"] = "WARRANTY";
10
10
  InventoryMovementReasonEnum["DAMAGED_RETURN"] = "DAMAGED_RETURN";
11
+ InventoryMovementReasonEnum["COUNT_SURPLUS"] = "COUNT_SURPLUS";
11
12
  })(InventoryMovementReasonEnum || (exports.InventoryMovementReasonEnum = InventoryMovementReasonEnum = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.479.0",
3
+ "version": "3.480.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,5 +1,6 @@
1
- import { ArrayMinSize, ArrayUnique, IsArray, IsInt, IsOptional, IsString, Length, Matches, Min } from 'class-validator';
1
+ import { ArrayMinSize, ArrayUnique, IsArray, IsEnum, IsInt, IsOptional, IsString, Length, Matches, Min } from 'class-validator';
2
2
  import { SKU_PATTERN } from '../../constants/SkuPattern';
3
+ import { InventoryMovementReasonEnum } from '../../enums/InventoryMovementReasonEnum';
3
4
 
4
5
  /** Body de POST /backoffice/inventory/entries (backofficeRegisterEntry); suma al saldo de la tienda con un MOV# ENTRY. */
5
6
  export class BackofficeRegisterEntryRequest {
@@ -25,4 +26,9 @@ export class BackofficeRegisterEntryRequest {
25
26
  @Matches(/^\S+$/, { each: true })
26
27
  @IsString({ each: true })
27
28
  identifiers?: string[];
29
+
30
+ /** Motivo de la entrada; COUNT_SURPLUS marca un sobrante de conteo. Ausente en una entrada normal. */
31
+ @IsOptional()
32
+ @IsEnum(InventoryMovementReasonEnum)
33
+ reason?: InventoryMovementReasonEnum;
28
34
  }
@@ -1,7 +1,8 @@
1
- /** Motivo de un movimiento manual de inventario (MOV#): merma, ajuste, garantía o devolución dañada. */
1
+ /** Motivo de un movimiento manual de inventario (MOV#): merma, ajuste, garantía, devolución dañada o sobrante de conteo. */
2
2
  export enum InventoryMovementReasonEnum {
3
3
  SHRINKAGE = 'SHRINKAGE',
4
4
  ADJUSTMENT = 'ADJUSTMENT',
5
5
  WARRANTY = 'WARRANTY',
6
6
  DAMAGED_RETURN = 'DAMAGED_RETURN',
7
+ COUNT_SURPLUS = 'COUNT_SURPLUS',
7
8
  }