@merkaly/api 0.16.0 → 0.18.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/dist/integration/supplier/index.d.ts +1 -0
- package/dist/integration/supplier/product.d.ts +4 -0
- package/dist/integration/supplier/sync.d.ts +24 -0
- package/dist/inventory/catalog/category/category.entity.d.ts +1 -0
- package/dist/inventory/catalog/category/request.validator.d.ts +2 -0
- package/dist/inventory/catalog/category/request.validator.js +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SupplierProductVariant } from './product.js';
|
|
2
|
+
import type { CatalogProductEntity } from '../../inventory/catalog/product';
|
|
3
|
+
import type { CatalogVariantOptionEntity } from '../../inventory/catalog/variant';
|
|
4
|
+
export interface SupplierProductSyncCostChange {
|
|
5
|
+
variant: string;
|
|
6
|
+
externalVariantId: string;
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
}
|
|
10
|
+
export interface SupplierProductSyncMissingVariant {
|
|
11
|
+
variant: string;
|
|
12
|
+
externalVariantId: string;
|
|
13
|
+
options: CatalogVariantOptionEntity[];
|
|
14
|
+
}
|
|
15
|
+
export interface SupplierProductSyncChanges {
|
|
16
|
+
costChanged: SupplierProductSyncCostChange[];
|
|
17
|
+
missingVariants: SupplierProductSyncMissingVariant[];
|
|
18
|
+
newVariants: SupplierProductVariant[];
|
|
19
|
+
fields: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface SupplierProductSyncResult {
|
|
22
|
+
product: CatalogProductEntity;
|
|
23
|
+
changes: SupplierProductSyncChanges;
|
|
24
|
+
}
|
|
@@ -4,6 +4,7 @@ import { CatalogProductEntity } from '../product';
|
|
|
4
4
|
export declare class CatalogCategoryEntity extends AbstractEntity {
|
|
5
5
|
name: string;
|
|
6
6
|
description?: string;
|
|
7
|
+
icon?: string;
|
|
7
8
|
parent?: CatalogCategoryEntity;
|
|
8
9
|
readonly children?: CatalogCategoryEntity[];
|
|
9
10
|
readonly products?: CatalogProductEntity[];
|
|
@@ -3,6 +3,8 @@ import type { CatalogCategoryEntity } from './category.entity.js';
|
|
|
3
3
|
export declare class CreateCategoryRequestValidator extends AbstractRequestValidator {
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
parent?: string | null;
|
|
6
8
|
constructor(category?: CatalogCategoryEntity);
|
|
7
9
|
}
|
|
8
10
|
export declare class UpdateCategoryRequestValidator extends CreateCategoryRequestValidator {
|
|
@@ -13,6 +13,8 @@ import * as abstract_validator_1 from '../../../abstract.validator.js';
|
|
|
13
13
|
export class CreateCategoryRequestValidator extends abstract_validator_1.AbstractRequestValidator {
|
|
14
14
|
name;
|
|
15
15
|
description;
|
|
16
|
+
icon;
|
|
17
|
+
parent;
|
|
16
18
|
constructor(category) {
|
|
17
19
|
super();
|
|
18
20
|
if (!category) {
|
|
@@ -20,6 +22,8 @@ export class CreateCategoryRequestValidator extends abstract_validator_1.Abstrac
|
|
|
20
22
|
}
|
|
21
23
|
this.name = category.name;
|
|
22
24
|
this.description = category.description;
|
|
25
|
+
this.icon = category.icon;
|
|
26
|
+
this.parent = category.parent ? String(category.parent._id ?? category.parent) : null;
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
__decorate([
|
|
@@ -34,6 +38,18 @@ __decorate([
|
|
|
34
38
|
(0, class_validator_1.IsOptional)(),
|
|
35
39
|
__metadata("design:type", String)
|
|
36
40
|
], CreateCategoryRequestValidator.prototype, "description", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
(0, class_validator_1.Length)(1, 40),
|
|
44
|
+
(0, class_validator_1.Matches)(/^[a-z0-9-]+$/),
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], CreateCategoryRequestValidator.prototype, "icon", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsMongoId)(),
|
|
50
|
+
(0, class_validator_1.IsOptional)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], CreateCategoryRequestValidator.prototype, "parent", void 0);
|
|
37
53
|
export class UpdateCategoryRequestValidator extends CreateCategoryRequestValidator {
|
|
38
54
|
}
|
|
39
55
|
__decorate([
|