@merkaly/api 0.2.2-26 → 0.2.2-28
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/.output/abstract/abstract.document.js +4 -6
- package/.output/abstract/abstract.entity.js +41 -21
- package/.output/abstract/abstract.validator.js +60 -43
- package/.output/modules/assets/asset.entity.js +56 -39
- package/.output/modules/insight/validators/order.validator.js +14 -13
- package/.output/modules/inventory/brands/brand.document.js +26 -5
- package/.output/modules/inventory/brands/brand.entity.js +37 -19
- package/.output/modules/inventory/brands/brand.validator.js +31 -29
- package/.output/modules/inventory/categories/category.document.js +27 -6
- package/.output/modules/inventory/categories/category.entity.js +48 -30
- package/.output/modules/inventory/categories/category.validator.js +43 -41
- package/.output/modules/inventory/products/entities/code.entity.d.ts +1 -1
- package/.output/modules/inventory/products/entities/code.entity.js +40 -23
- package/.output/modules/inventory/products/entities/dimension.entity.d.ts +1 -1
- package/.output/modules/inventory/products/entities/dimension.entity.js +44 -28
- package/.output/modules/inventory/products/entities/price.entity.d.ts +1 -1
- package/.output/modules/inventory/products/entities/price.entity.js +36 -18
- package/.output/modules/inventory/products/entities/seo.entity.d.ts +1 -1
- package/.output/modules/inventory/products/entities/seo.entity.js +40 -23
- package/.output/modules/inventory/products/product.document.js +28 -9
- package/.output/modules/inventory/products/product.entity.d.ts +4 -3
- package/.output/modules/inventory/products/product.entity.js +84 -66
- package/.output/modules/inventory/products/product.validator.d.ts +7 -6
- package/.output/modules/inventory/products/product.validator.js +99 -69
- package/.output/modules/inventory/products/validators/code.validator.js +24 -21
- package/.output/modules/inventory/products/validators/dimension.validator.js +30 -27
- package/.output/modules/inventory/products/validators/price.validator.d.ts +1 -1
- package/.output/modules/inventory/products/validators/price.validator.js +17 -14
- package/.output/modules/inventory/products/validators/seo.validator.js +24 -21
- package/.output/modules/inventory/properties/property.entity.js +42 -25
- package/.output/modules/inventory/properties/property.validator.js +33 -32
- package/.output/modules/search/search.validator.js +36 -26
- package/.output/modules/setting/connections/connection.validator.d.ts +0 -1
- package/.output/modules/setting/connections/connection.validator.js +23 -21
- package/.output/modules/setting/members/member.validator.d.ts +0 -1
- package/.output/modules/setting/members/member.validator.js +0 -1
- package/.output/modules/setting/organization/organization.types.js +86 -86
- package/.output/modules/setting/organization/organization.validator.js +68 -68
- package/.output/modules/setting/social/social.validator.js +15 -14
- package/.output/modules/store/clients/client.entity.js +60 -44
- package/.output/modules/store/clients/client.validator.js +53 -52
- package/.output/modules/store/orders/billing/billing.document.js +5 -7
- package/.output/modules/store/orders/billing/billing.entity.js +31 -33
- package/.output/modules/store/orders/billing/billing.validator.js +27 -28
- package/.output/modules/store/orders/item/item.document.js +5 -5
- package/.output/modules/store/orders/item/item.entity.js +41 -24
- package/.output/modules/store/orders/item/item.schema.js +2 -2
- package/.output/modules/store/orders/item/item.validator.js +16 -14
- package/.output/modules/store/orders/order.entity.js +76 -57
- package/.output/modules/store/orders/order.validator.js +60 -57
- package/.output/modules/store/orders/payment/payment.entity.js +15 -13
- package/.output/modules/store/orders/payment/payment.schema.js +2 -2
- package/.output/modules/store/orders/shipping/shipping.document.js +5 -7
- package/.output/modules/store/orders/shipping/shipping.entity.js +31 -33
- package/.output/modules/store/orders/shipping/shipping.validator.js +27 -28
- package/.output/modules/store/orders/status/status.document.js +5 -5
- package/.output/modules/store/orders/status/status.entity.js +24 -24
- package/.output/modules/users/user.validator.js +37 -41
- package/package.json +3 -3
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'reflect-metadata';
|
|
2
2
|
import { ProductCodeValidator } from './validators/code.validator';
|
|
3
3
|
import { ProductDimensionValidator } from './validators/dimension.validator';
|
|
4
4
|
import { ProductPriceValidator } from './validators/price.validator';
|
|
5
5
|
import { ProductSeoValidator } from './validators/seo.validator';
|
|
6
6
|
export declare class CreateProductValidator {
|
|
7
7
|
name: string;
|
|
8
|
-
description
|
|
8
|
+
description: string;
|
|
9
|
+
active: boolean;
|
|
9
10
|
category?: string;
|
|
10
11
|
brand?: string;
|
|
11
|
-
files:
|
|
12
|
+
files: string[];
|
|
12
13
|
hashtags: string[];
|
|
13
14
|
price: ProductPriceValidator;
|
|
14
|
-
seo
|
|
15
|
-
dimension
|
|
16
|
-
code
|
|
15
|
+
seo: ProductSeoValidator;
|
|
16
|
+
dimension: ProductDimensionValidator;
|
|
17
|
+
code: ProductCodeValidator;
|
|
17
18
|
}
|
|
18
19
|
export declare class UpdateProductValidator extends CreateProductValidator {
|
|
19
20
|
}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -10,74 +25,89 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
25
|
};
|
|
11
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
27
|
exports.UpdateProductValidator = exports.CreateProductValidator = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
28
|
+
var class_transformer_1 = require("class-transformer");
|
|
29
|
+
var class_validator_1 = require("class-validator");
|
|
30
|
+
require("reflect-metadata");
|
|
31
|
+
var code_validator_1 = require("./validators/code.validator");
|
|
32
|
+
var dimension_validator_1 = require("./validators/dimension.validator");
|
|
33
|
+
var price_validator_1 = require("./validators/price.validator");
|
|
34
|
+
var seo_validator_1 = require("./validators/seo.validator");
|
|
35
|
+
var CreateProductValidator = (function () {
|
|
36
|
+
function CreateProductValidator() {
|
|
37
|
+
this.name = String();
|
|
38
|
+
this.description = String();
|
|
39
|
+
this.active = Boolean(1);
|
|
40
|
+
this.category = null;
|
|
41
|
+
this.brand = null;
|
|
42
|
+
this.files = [];
|
|
43
|
+
this.hashtags = [];
|
|
44
|
+
this.price = new price_validator_1.ProductPriceValidator();
|
|
45
|
+
this.seo = new seo_validator_1.ProductSeoValidator();
|
|
46
|
+
this.dimension = new dimension_validator_1.ProductDimensionValidator();
|
|
47
|
+
this.code = new code_validator_1.ProductCodeValidator();
|
|
48
|
+
}
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsString)(),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], CreateProductValidator.prototype, "name", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsString)(),
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], CreateProductValidator.prototype, "description", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsBoolean)(),
|
|
60
|
+
(0, class_validator_1.IsOptional)(),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], CreateProductValidator.prototype, "active", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsOptional)(),
|
|
65
|
+
(0, class_validator_1.IsMongoId)(),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], CreateProductValidator.prototype, "category", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, class_validator_1.IsOptional)(),
|
|
70
|
+
(0, class_validator_1.IsMongoId)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], CreateProductValidator.prototype, "brand", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_validator_1.IsMongoId)({ each: true }),
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
__metadata("design:type", Array)
|
|
77
|
+
], CreateProductValidator.prototype, "files", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
80
|
+
__metadata("design:type", Array)
|
|
81
|
+
], CreateProductValidator.prototype, "hashtags", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, class_validator_1.ValidateNested)(),
|
|
84
|
+
(0, class_validator_1.IsNotEmptyObject)(),
|
|
85
|
+
(0, class_transformer_1.Type)(function () { return price_validator_1.ProductPriceValidator; }),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], CreateProductValidator.prototype, "price", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, class_validator_1.ValidateNested)(),
|
|
90
|
+
(0, class_transformer_1.Type)(function () { return seo_validator_1.ProductSeoValidator; }),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], CreateProductValidator.prototype, "seo", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, class_validator_1.ValidateNested)(),
|
|
95
|
+
(0, class_transformer_1.Type)(function () { return dimension_validator_1.ProductDimensionValidator; }),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], CreateProductValidator.prototype, "dimension", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, class_validator_1.ValidateNested)(),
|
|
100
|
+
(0, class_transformer_1.Type)(function () { return code_validator_1.ProductCodeValidator; }),
|
|
101
|
+
__metadata("design:type", Object)
|
|
102
|
+
], CreateProductValidator.prototype, "code", void 0);
|
|
103
|
+
return CreateProductValidator;
|
|
104
|
+
}());
|
|
80
105
|
exports.CreateProductValidator = CreateProductValidator;
|
|
81
|
-
|
|
82
|
-
|
|
106
|
+
var UpdateProductValidator = (function (_super) {
|
|
107
|
+
__extends(UpdateProductValidator, _super);
|
|
108
|
+
function UpdateProductValidator() {
|
|
109
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
110
|
+
}
|
|
111
|
+
return UpdateProductValidator;
|
|
112
|
+
}(CreateProductValidator));
|
|
83
113
|
exports.UpdateProductValidator = UpdateProductValidator;
|
|
@@ -10,25 +10,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ProductCodeValidator = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
var class_validator_1 = require("class-validator");
|
|
14
|
+
var ProductCodeValidator = (function () {
|
|
15
|
+
function ProductCodeValidator() {
|
|
16
|
+
this.sku = String();
|
|
17
|
+
this.gtin = String();
|
|
18
|
+
this.mpn = String();
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
(0, class_validator_1.IsOptional)(),
|
|
23
|
+
__metadata("design:type", Object)
|
|
24
|
+
], ProductCodeValidator.prototype, "sku", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
__metadata("design:type", Object)
|
|
29
|
+
], ProductCodeValidator.prototype, "gtin", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsString)(),
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], ProductCodeValidator.prototype, "mpn", void 0);
|
|
35
|
+
return ProductCodeValidator;
|
|
36
|
+
}());
|
|
34
37
|
exports.ProductCodeValidator = ProductCodeValidator;
|
|
@@ -10,31 +10,34 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ProductDimensionValidator = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
13
|
+
var class_validator_1 = require("class-validator");
|
|
14
|
+
var ProductDimensionValidator = (function () {
|
|
15
|
+
function ProductDimensionValidator() {
|
|
16
|
+
this.weight = 0;
|
|
17
|
+
this.height = 0;
|
|
18
|
+
this.width = 0;
|
|
19
|
+
this.depth = 0;
|
|
20
|
+
}
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsNumber)(),
|
|
23
|
+
(0, class_validator_1.IsOptional)(),
|
|
24
|
+
__metadata("design:type", Object)
|
|
25
|
+
], ProductDimensionValidator.prototype, "weight", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsNumber)(),
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], ProductDimensionValidator.prototype, "height", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsNumber)(),
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], ProductDimensionValidator.prototype, "width", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsNumber)(),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], ProductDimensionValidator.prototype, "depth", void 0);
|
|
41
|
+
return ProductDimensionValidator;
|
|
42
|
+
}());
|
|
40
43
|
exports.ProductDimensionValidator = ProductDimensionValidator;
|
|
@@ -10,18 +10,21 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ProductPriceValidator = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
var class_validator_1 = require("class-validator");
|
|
14
|
+
var ProductPriceValidator = (function () {
|
|
15
|
+
function ProductPriceValidator() {
|
|
16
|
+
this.sale = 0;
|
|
17
|
+
this.purchase = 0;
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsNumber)(),
|
|
21
|
+
__metadata("design:type", Object)
|
|
22
|
+
], ProductPriceValidator.prototype, "sale", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsNumber)(),
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
__metadata("design:type", Object)
|
|
27
|
+
], ProductPriceValidator.prototype, "purchase", void 0);
|
|
28
|
+
return ProductPriceValidator;
|
|
29
|
+
}());
|
|
27
30
|
exports.ProductPriceValidator = ProductPriceValidator;
|
|
@@ -10,25 +10,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ProductSeoValidator = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
var class_validator_1 = require("class-validator");
|
|
14
|
+
var ProductSeoValidator = (function () {
|
|
15
|
+
function ProductSeoValidator() {
|
|
16
|
+
this.title = String();
|
|
17
|
+
this.slug = String();
|
|
18
|
+
this.description = String();
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
(0, class_validator_1.IsOptional)(),
|
|
23
|
+
__metadata("design:type", Object)
|
|
24
|
+
], ProductSeoValidator.prototype, "title", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
__metadata("design:type", Object)
|
|
29
|
+
], ProductSeoValidator.prototype, "slug", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsString)(),
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], ProductSeoValidator.prototype, "description", void 0);
|
|
35
|
+
return ProductSeoValidator;
|
|
36
|
+
}());
|
|
34
37
|
exports.ProductSeoValidator = ProductSeoValidator;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -10,29 +25,31 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
25
|
};
|
|
11
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
27
|
exports.PropertyEntity = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
__decorate([
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
], PropertyEntity.prototype, "name", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
], PropertyEntity.prototype, "title", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
], PropertyEntity.prototype, "type", void 0);
|
|
35
|
-
PropertyEntity = __decorate([
|
|
36
|
-
|
|
37
|
-
], PropertyEntity);
|
|
28
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
29
|
+
var mongoose_2 = require("mongoose");
|
|
30
|
+
var abstract_entity_1 = require("../../../abstract/abstract.entity");
|
|
31
|
+
var property_validator_1 = require("./property.validator");
|
|
32
|
+
var PropertyEntity = (function (_super) {
|
|
33
|
+
__extends(PropertyEntity, _super);
|
|
34
|
+
function PropertyEntity() {
|
|
35
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
36
|
+
}
|
|
37
|
+
PropertyEntity.$index = 'inventory_properties';
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true, length: 32 }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], PropertyEntity.prototype, "name", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, length: 64 }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], PropertyEntity.prototype, "title", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: property_validator_1.PropertyType.STRING }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], PropertyEntity.prototype, "type", void 0);
|
|
50
|
+
PropertyEntity = __decorate([
|
|
51
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
52
|
+
], PropertyEntity);
|
|
53
|
+
return PropertyEntity;
|
|
54
|
+
}(abstract_entity_1.AbstractEntity));
|
|
38
55
|
exports.PropertyEntity = PropertyEntity;
|
|
@@ -10,41 +10,42 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UpdatePropertyValidator = exports.CreatePropertyValidator = exports.PropertyType = void 0;
|
|
13
|
-
|
|
13
|
+
var class_validator_1 = require("class-validator");
|
|
14
14
|
var PropertyType;
|
|
15
15
|
(function (PropertyType) {
|
|
16
16
|
PropertyType["STRING"] = "STRING";
|
|
17
17
|
})(PropertyType = exports.PropertyType || (exports.PropertyType = {}));
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
var CreatePropertyValidator = (function () {
|
|
19
|
+
function CreatePropertyValidator() {
|
|
20
|
+
}
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], CreatePropertyValidator.prototype, "name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CreatePropertyValidator.prototype, "title", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreatePropertyValidator.prototype, "type", void 0);
|
|
33
|
+
return CreatePropertyValidator;
|
|
34
|
+
}());
|
|
35
35
|
exports.CreatePropertyValidator = CreatePropertyValidator;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
var UpdatePropertyValidator = (function () {
|
|
37
|
+
function UpdatePropertyValidator() {
|
|
38
|
+
}
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], UpdatePropertyValidator.prototype, "name", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsString)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], UpdatePropertyValidator.prototype, "title", void 0);
|
|
49
|
+
return UpdatePropertyValidator;
|
|
50
|
+
}());
|
|
50
51
|
exports.UpdatePropertyValidator = UpdatePropertyValidator;
|