@merkaly/api 0.6.9 → 0.6.10

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.
@@ -14,6 +14,7 @@ export declare class ProductAttributeRequestValidator extends AbstractRequestVal
14
14
  export declare class CreateProductRequestValidator extends AbstractRequestValidator {
15
15
  name: string;
16
16
  sku?: string;
17
+ gtin?: string;
17
18
  description?: string;
18
19
  sellPrice?: number;
19
20
  buyPrice?: number;
@@ -36,6 +36,7 @@ __decorate([
36
36
  export class CreateProductRequestValidator extends abstract_validator_1.AbstractRequestValidator {
37
37
  name;
38
38
  sku;
39
+ gtin;
39
40
  description;
40
41
  sellPrice;
41
42
  buyPrice;
@@ -51,8 +52,10 @@ export class CreateProductRequestValidator extends abstract_validator_1.Abstract
51
52
  if (!product) {
52
53
  return;
53
54
  }
55
+ const identifier = product.variants?.[0]?.identifier;
54
56
  this.name = product.name;
55
- this.sku = product.sku;
57
+ this.sku = identifier?.sku ?? product.sku;
58
+ this.gtin = identifier?.gtin;
56
59
  this.description = product.description;
57
60
  this.sellPrice = product.sellPrice ?? product.price;
58
61
  this.buyPrice = product.buyPrice ?? product.cost;
@@ -87,6 +90,12 @@ __decorate([
87
90
  (0, class_validator_1.IsOptional)(),
88
91
  __metadata("design:type", String)
89
92
  ], CreateProductRequestValidator.prototype, "sku", void 0);
93
+ __decorate([
94
+ (0, class_validator_1.IsString)(),
95
+ (0, class_validator_1.Length)(0, 50),
96
+ (0, class_validator_1.IsOptional)(),
97
+ __metadata("design:type", String)
98
+ ], CreateProductRequestValidator.prototype, "gtin", void 0);
90
99
  __decorate([
91
100
  (0, class_validator_1.IsString)(),
92
101
  (0, class_validator_1.Length)(0, 1000),
@@ -1,9 +1,16 @@
1
1
  import { AccountUserEntity } from '../../../account/user';
2
2
  import { StockWarehouseEntity } from '../warehouse';
3
- import { TransferStatusEnum, TransferTypeEnum } from './transfer.enum.js';
3
+ import { TransferStatusEnum } from './transfer.enum.js';
4
4
  import { AbstractEntity } from '../../../abstract.entity.js';
5
5
  import { StockTransferItemEntity } from './transfer.item.entity.js';
6
6
  import type { StatusEntity } from '../../../status.plugin.js';
7
+ export interface StockTransferCapabilities {
8
+ addItems: boolean;
9
+ cancel: boolean;
10
+ complete: boolean;
11
+ deleteItems: boolean;
12
+ editItems: boolean;
13
+ }
7
14
  export declare class StockTransferEntity extends AbstractEntity {
8
15
  origin: StockWarehouseEntity;
9
16
  destination: StockWarehouseEntity;
@@ -12,7 +19,7 @@ export declare class StockTransferEntity extends AbstractEntity {
12
19
  user: AccountUserEntity;
13
20
  history: StatusEntity<TransferStatusEnum>[];
14
21
  status: TransferStatusEnum;
15
- readonly type: TransferTypeEnum;
16
22
  readonly number: string;
23
+ readonly capabilities: StockTransferCapabilities;
17
24
  readonly isProcessable: boolean;
18
25
  }
@@ -3,8 +3,3 @@ export declare enum TransferStatusEnum {
3
3
  COMPLETED = "COMPLETED",
4
4
  CANCELLED = "CANCELLED"
5
5
  }
6
- export declare enum TransferTypeEnum {
7
- ENTRY = "ENTRY",
8
- EXIT = "EXIT",
9
- INTERNAL = "INTERNAL"
10
- }
@@ -4,9 +4,3 @@ export var TransferStatusEnum;
4
4
  TransferStatusEnum["COMPLETED"] = "COMPLETED";
5
5
  TransferStatusEnum["CANCELLED"] = "CANCELLED";
6
6
  })(TransferStatusEnum || (TransferStatusEnum = {}));
7
- export var TransferTypeEnum;
8
- (function (TransferTypeEnum) {
9
- TransferTypeEnum["ENTRY"] = "ENTRY";
10
- TransferTypeEnum["EXIT"] = "EXIT";
11
- TransferTypeEnum["INTERNAL"] = "INTERNAL";
12
- })(TransferTypeEnum || (TransferTypeEnum = {}));
@@ -2,11 +2,21 @@ import { CatalogProductEntity } from '../../catalog/product';
2
2
  import { CatalogVariantEntity } from '../../catalog/variant';
3
3
  import { AbstractEntity } from '../../../abstract.entity.js';
4
4
  import type { StockBalanceEntity } from '../balance';
5
+ export interface StockTransferItemAvailability {
6
+ mode: 'incoming' | 'reservation';
7
+ remaining: number;
8
+ allocatable: number | null;
9
+ reserved: number | null;
10
+ unreserved: number | null;
11
+ processable: boolean;
12
+ }
5
13
  export declare class StockTransferItemEntity extends AbstractEntity {
6
14
  product: CatalogProductEntity;
7
15
  variant: CatalogVariantEntity;
8
16
  quantity: number;
17
+ reservedQuantity?: number;
9
18
  notes?: string;
10
19
  readonly balance: StockBalanceEntity;
20
+ readonly availability: StockTransferItemAvailability;
11
21
  readonly isProcessable: boolean;
12
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "type": "module",
5
5
  "description": "Shared TypeScript interfaces and enums for Merkaly API",
6
6
  "repository": {
@@ -27,9 +27,9 @@
27
27
  "reflect-metadata": "^0.2.2"
28
28
  },
29
29
  "devDependencies": {
30
- "@types/node": "^25.9.1",
30
+ "@types/node": "^26.0.0",
31
31
  "changelogen": "^0.6.2",
32
- "oxlint": "^1.69.0",
32
+ "oxlint": "^1.70.0",
33
33
  "tsx": "^4.22.4",
34
34
  "typescript": "^6.0.3"
35
35
  },