@merkaly/api 0.2.3-2 → 0.2.3-4
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.validator.d.ts +4 -1
- package/.output/abstract/abstract.validator.js +32 -7
- package/.output/modules/inventory/brands/brand.validator.d.ts +3 -2
- package/.output/modules/inventory/brands/brand.validator.js +25 -4
- package/.output/modules/inventory/categories/category.validator.d.ts +3 -2
- package/.output/modules/inventory/categories/category.validator.js +28 -6
- package/.output/modules/inventory/products/product.document.d.ts +1 -0
- package/.output/modules/inventory/products/product.document.js +1 -0
- package/.output/modules/inventory/products/product.validator.d.ts +3 -1
- package/.output/modules/inventory/products/product.validator.js +24 -14
- package/.output/modules/inventory/properties/property.validator.d.ts +3 -2
- package/.output/modules/inventory/properties/property.validator.js +24 -4
- package/.output/modules/sales/clients/client.validator.d.ts +2 -1
- package/.output/modules/sales/clients/client.validator.js +5 -2
- package/.output/modules/sales/orders/address/address.entity.d.ts +8 -0
- package/.output/modules/sales/orders/address/address.validator.d.ts +8 -0
- package/.output/modules/sales/orders/{billing/billing.entity.js → address/address.validator.js} +23 -21
- package/.output/modules/sales/orders/billing/billing.entity.d.ts +5 -5
- package/.output/modules/sales/orders/billing/billing.validator.d.ts +11 -5
- package/.output/modules/sales/orders/billing/billing.validator.js +21 -16
- package/.output/modules/sales/orders/customer/customer.entity.d.ts +5 -0
- package/.output/modules/sales/orders/customer/customer.validator.d.ts +5 -0
- package/.output/modules/sales/orders/{payment/payment.entity.js → customer/customer.validator.js} +18 -13
- package/.output/modules/sales/orders/item/item.schema.d.ts +1 -1
- package/.output/modules/sales/orders/order.entity.d.ts +6 -3
- package/.output/modules/sales/orders/order.validator.d.ts +15 -7
- package/.output/modules/sales/orders/order.validator.js +66 -14
- package/.output/modules/sales/orders/shipping/shipping.entity.d.ts +4 -5
- package/.output/modules/sales/orders/shipping/shipping.validator.d.ts +11 -5
- package/.output/modules/sales/orders/shipping/shipping.validator.js +26 -16
- package/.output/modules/search/search.validator.d.ts +2 -1
- package/.output/modules/search/search.validator.js +22 -3
- package/package.json +9 -7
- package/.output/abstract/abstract.entity.js +0 -53
- package/.output/modules/assets/asset.entity.js +0 -69
- package/.output/modules/content/banners/banner.entity.js +0 -54
- package/.output/modules/content/pages/page.entity.js +0 -69
- package/.output/modules/inventory/brands/brand.entity.js +0 -50
- package/.output/modules/inventory/categories/category.entity.js +0 -61
- package/.output/modules/inventory/products/entities/code.entity.js +0 -53
- package/.output/modules/inventory/products/entities/dimension.entity.js +0 -57
- package/.output/modules/inventory/products/entities/price.entity.js +0 -49
- package/.output/modules/inventory/products/entities/seo.entity.js +0 -53
- package/.output/modules/inventory/products/product.entity.js +0 -101
- package/.output/modules/inventory/properties/property.entity.js +0 -55
- package/.output/modules/sales/clients/client.entity.js +0 -64
- package/.output/modules/sales/orders/item/item.entity.js +0 -54
- package/.output/modules/sales/orders/order.entity.js +0 -87
- package/.output/modules/sales/orders/payment/payment.schema.d.ts +0 -27
- package/.output/modules/sales/orders/payment/payment.schema.js +0 -6
- package/.output/modules/sales/orders/shipping/shipping.entity.js +0 -44
- package/.output/modules/sales/orders/status/status.entity.js +0 -37
- package/.output/modules/setting/layout/layout.entity.js +0 -46
- package/.output/modules/setting/organization/organization.entity.js +0 -28
- package/.output/modules/setting/theme/theme.entity.js +0 -46
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { PopulateOptions, QuerySelector, SortOrder } from 'mongoose';
|
|
2
2
|
import { AbstractEntity } from './abstract.entity';
|
|
3
|
+
import 'reflect-metadata';
|
|
3
4
|
export interface SearchResults<I> {
|
|
4
5
|
page: number;
|
|
5
6
|
total: number;
|
|
6
7
|
items: I[];
|
|
7
8
|
}
|
|
8
|
-
export declare class
|
|
9
|
+
export declare abstract class AbstractValidator {
|
|
10
|
+
}
|
|
11
|
+
export declare class FindValidator<E extends AbstractEntity> extends AbstractValidator {
|
|
9
12
|
limit?: number;
|
|
10
13
|
page?: number;
|
|
11
14
|
sort?: {
|
|
@@ -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);
|
|
@@ -9,15 +24,25 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
24
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
25
|
};
|
|
11
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.FindValidator = void 0;
|
|
27
|
+
exports.FindValidator = exports.AbstractValidator = void 0;
|
|
13
28
|
var class_transformer_1 = require("class-transformer");
|
|
14
29
|
var class_validator_1 = require("class-validator");
|
|
15
|
-
|
|
30
|
+
require("reflect-metadata");
|
|
31
|
+
var AbstractValidator = (function () {
|
|
32
|
+
function AbstractValidator() {
|
|
33
|
+
}
|
|
34
|
+
return AbstractValidator;
|
|
35
|
+
}());
|
|
36
|
+
exports.AbstractValidator = AbstractValidator;
|
|
37
|
+
var FindValidator = (function (_super) {
|
|
38
|
+
__extends(FindValidator, _super);
|
|
16
39
|
function FindValidator() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
40
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
41
|
+
_this.limit = 10;
|
|
42
|
+
_this.page = 1;
|
|
43
|
+
_this.sort = {};
|
|
44
|
+
_this.filters = {};
|
|
45
|
+
return _this;
|
|
21
46
|
}
|
|
22
47
|
__decorate([
|
|
23
48
|
(0, class_transformer_1.Transform)(function (_a) {
|
|
@@ -69,5 +94,5 @@ var FindValidator = (function () {
|
|
|
69
94
|
__metadata("design:type", Array)
|
|
70
95
|
], FindValidator.prototype, "join", void 0);
|
|
71
96
|
return FindValidator;
|
|
72
|
-
}());
|
|
97
|
+
}(AbstractValidator));
|
|
73
98
|
exports.FindValidator = FindValidator;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { AbstractValidator } from "../../../abstract/abstract.validator";
|
|
2
|
+
export declare class CreateBrandValidator extends AbstractValidator {
|
|
2
3
|
name: string;
|
|
3
4
|
description?: string;
|
|
4
5
|
}
|
|
5
|
-
export declare class UpdateBrandValidator {
|
|
6
|
+
export declare class UpdateBrandValidator extends AbstractValidator {
|
|
6
7
|
name?: string;
|
|
7
8
|
description?: string;
|
|
8
9
|
}
|
|
@@ -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);
|
|
@@ -11,8 +26,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
27
|
exports.UpdateBrandValidator = exports.CreateBrandValidator = void 0;
|
|
13
28
|
var class_validator_1 = require("class-validator");
|
|
14
|
-
var
|
|
29
|
+
var abstract_validator_1 = require("../../../abstract/abstract.validator");
|
|
30
|
+
var CreateBrandValidator = (function (_super) {
|
|
31
|
+
__extends(CreateBrandValidator, _super);
|
|
15
32
|
function CreateBrandValidator() {
|
|
33
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
16
34
|
}
|
|
17
35
|
__decorate([
|
|
18
36
|
(0, class_validator_1.IsString)(),
|
|
@@ -25,13 +43,16 @@ var CreateBrandValidator = (function () {
|
|
|
25
43
|
__metadata("design:type", String)
|
|
26
44
|
], CreateBrandValidator.prototype, "description", void 0);
|
|
27
45
|
return CreateBrandValidator;
|
|
28
|
-
}());
|
|
46
|
+
}(abstract_validator_1.AbstractValidator));
|
|
29
47
|
exports.CreateBrandValidator = CreateBrandValidator;
|
|
30
|
-
var UpdateBrandValidator = (function () {
|
|
48
|
+
var UpdateBrandValidator = (function (_super) {
|
|
49
|
+
__extends(UpdateBrandValidator, _super);
|
|
31
50
|
function UpdateBrandValidator() {
|
|
51
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
32
52
|
}
|
|
33
53
|
__decorate([
|
|
34
54
|
(0, class_validator_1.IsString)(),
|
|
55
|
+
(0, class_validator_1.Length)(2, 32),
|
|
35
56
|
(0, class_validator_1.IsOptional)(),
|
|
36
57
|
__metadata("design:type", String)
|
|
37
58
|
], UpdateBrandValidator.prototype, "name", void 0);
|
|
@@ -41,5 +62,5 @@ var UpdateBrandValidator = (function () {
|
|
|
41
62
|
__metadata("design:type", String)
|
|
42
63
|
], UpdateBrandValidator.prototype, "description", void 0);
|
|
43
64
|
return UpdateBrandValidator;
|
|
44
|
-
}());
|
|
65
|
+
}(abstract_validator_1.AbstractValidator));
|
|
45
66
|
exports.UpdateBrandValidator = UpdateBrandValidator;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { AbstractValidator } from "../../../abstract/abstract.validator";
|
|
2
|
+
export declare class CreateCategoryValidator extends AbstractValidator {
|
|
2
3
|
name: string;
|
|
3
4
|
description?: string;
|
|
4
5
|
icon: string;
|
|
5
6
|
}
|
|
6
|
-
export declare class UpdateCategoryValidator {
|
|
7
|
+
export declare class UpdateCategoryValidator extends AbstractValidator {
|
|
7
8
|
name: string;
|
|
8
9
|
description?: string;
|
|
9
10
|
icon: string;
|
|
@@ -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);
|
|
@@ -11,9 +26,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
27
|
exports.UpdateCategoryValidator = exports.CreateCategoryValidator = void 0;
|
|
13
28
|
var class_validator_1 = require("class-validator");
|
|
14
|
-
var
|
|
29
|
+
var abstract_validator_1 = require("../../../abstract/abstract.validator");
|
|
30
|
+
var CreateCategoryValidator = (function (_super) {
|
|
31
|
+
__extends(CreateCategoryValidator, _super);
|
|
15
32
|
function CreateCategoryValidator() {
|
|
16
|
-
|
|
33
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
+
_this.icon = 'tag';
|
|
35
|
+
return _this;
|
|
17
36
|
}
|
|
18
37
|
__decorate([
|
|
19
38
|
(0, class_validator_1.IsString)(),
|
|
@@ -31,11 +50,14 @@ var CreateCategoryValidator = (function () {
|
|
|
31
50
|
__metadata("design:type", Object)
|
|
32
51
|
], CreateCategoryValidator.prototype, "icon", void 0);
|
|
33
52
|
return CreateCategoryValidator;
|
|
34
|
-
}());
|
|
53
|
+
}(abstract_validator_1.AbstractValidator));
|
|
35
54
|
exports.CreateCategoryValidator = CreateCategoryValidator;
|
|
36
|
-
var UpdateCategoryValidator = (function () {
|
|
55
|
+
var UpdateCategoryValidator = (function (_super) {
|
|
56
|
+
__extends(UpdateCategoryValidator, _super);
|
|
37
57
|
function UpdateCategoryValidator() {
|
|
38
|
-
|
|
58
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
59
|
+
_this.icon = 'tag';
|
|
60
|
+
return _this;
|
|
39
61
|
}
|
|
40
62
|
__decorate([
|
|
41
63
|
(0, class_validator_1.IsString)(),
|
|
@@ -53,5 +75,5 @@ var UpdateCategoryValidator = (function () {
|
|
|
53
75
|
__metadata("design:type", Object)
|
|
54
76
|
], UpdateCategoryValidator.prototype, "icon", void 0);
|
|
55
77
|
return UpdateCategoryValidator;
|
|
56
|
-
}());
|
|
78
|
+
}(abstract_validator_1.AbstractValidator));
|
|
57
79
|
exports.UpdateCategoryValidator = UpdateCategoryValidator;
|
|
@@ -3,7 +3,8 @@ 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
|
+
import { AbstractValidator } from "../../../abstract/abstract.validator";
|
|
7
|
+
export declare class CreateProductValidator extends AbstractValidator {
|
|
7
8
|
name: string;
|
|
8
9
|
description: string;
|
|
9
10
|
measurement: string;
|
|
@@ -18,4 +19,5 @@ export declare class CreateProductValidator {
|
|
|
18
19
|
code: ProductCodeValidator;
|
|
19
20
|
}
|
|
20
21
|
export declare class UpdateProductValidator extends CreateProductValidator {
|
|
22
|
+
name: string;
|
|
21
23
|
}
|
|
@@ -32,23 +32,28 @@ var code_validator_1 = require("./validators/code.validator");
|
|
|
32
32
|
var dimension_validator_1 = require("./validators/dimension.validator");
|
|
33
33
|
var price_validator_1 = require("./validators/price.validator");
|
|
34
34
|
var seo_validator_1 = require("./validators/seo.validator");
|
|
35
|
-
var
|
|
35
|
+
var abstract_validator_1 = require("../../../abstract/abstract.validator");
|
|
36
|
+
var CreateProductValidator = (function (_super) {
|
|
37
|
+
__extends(CreateProductValidator, _super);
|
|
36
38
|
function CreateProductValidator() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
+
_this.name = String();
|
|
41
|
+
_this.description = String();
|
|
42
|
+
_this.measurement = String();
|
|
43
|
+
_this.active = Boolean(1);
|
|
44
|
+
_this.category = null;
|
|
45
|
+
_this.brand = null;
|
|
46
|
+
_this.files = [];
|
|
47
|
+
_this.hashtags = [];
|
|
48
|
+
_this.price = new price_validator_1.ProductPriceValidator();
|
|
49
|
+
_this.seo = new seo_validator_1.ProductSeoValidator();
|
|
50
|
+
_this.dimension = new dimension_validator_1.ProductDimensionValidator();
|
|
51
|
+
_this.code = new code_validator_1.ProductCodeValidator();
|
|
52
|
+
return _this;
|
|
49
53
|
}
|
|
50
54
|
__decorate([
|
|
51
55
|
(0, class_validator_1.IsString)(),
|
|
56
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
52
57
|
__metadata("design:type", Object)
|
|
53
58
|
], CreateProductValidator.prototype, "name", void 0);
|
|
54
59
|
__decorate([
|
|
@@ -106,13 +111,18 @@ var CreateProductValidator = (function () {
|
|
|
106
111
|
__metadata("design:type", Object)
|
|
107
112
|
], CreateProductValidator.prototype, "code", void 0);
|
|
108
113
|
return CreateProductValidator;
|
|
109
|
-
}());
|
|
114
|
+
}(abstract_validator_1.AbstractValidator));
|
|
110
115
|
exports.CreateProductValidator = CreateProductValidator;
|
|
111
116
|
var UpdateProductValidator = (function (_super) {
|
|
112
117
|
__extends(UpdateProductValidator, _super);
|
|
113
118
|
function UpdateProductValidator() {
|
|
114
119
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
115
120
|
}
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, class_validator_1.IsString)(),
|
|
123
|
+
(0, class_validator_1.IsOptional)(),
|
|
124
|
+
__metadata("design:type", String)
|
|
125
|
+
], UpdateProductValidator.prototype, "name", void 0);
|
|
116
126
|
return UpdateProductValidator;
|
|
117
127
|
}(CreateProductValidator));
|
|
118
128
|
exports.UpdateProductValidator = UpdateProductValidator;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { AbstractValidator } from "../../../abstract/abstract.validator";
|
|
1
2
|
export declare enum PropertyType {
|
|
2
3
|
STRING = "STRING"
|
|
3
4
|
}
|
|
4
|
-
export declare class CreatePropertyValidator {
|
|
5
|
+
export declare class CreatePropertyValidator extends AbstractValidator {
|
|
5
6
|
name: string;
|
|
6
7
|
title: string;
|
|
7
8
|
type: string;
|
|
8
9
|
}
|
|
9
|
-
export declare class UpdatePropertyValidator {
|
|
10
|
+
export declare class UpdatePropertyValidator extends AbstractValidator {
|
|
10
11
|
name?: string;
|
|
11
12
|
title?: string;
|
|
12
13
|
}
|
|
@@ -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);
|
|
@@ -11,12 +26,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
27
|
exports.UpdatePropertyValidator = exports.CreatePropertyValidator = exports.PropertyType = void 0;
|
|
13
28
|
var class_validator_1 = require("class-validator");
|
|
29
|
+
var abstract_validator_1 = require("../../../abstract/abstract.validator");
|
|
14
30
|
var PropertyType;
|
|
15
31
|
(function (PropertyType) {
|
|
16
32
|
PropertyType["STRING"] = "STRING";
|
|
17
33
|
})(PropertyType = exports.PropertyType || (exports.PropertyType = {}));
|
|
18
|
-
var CreatePropertyValidator = (function () {
|
|
34
|
+
var CreatePropertyValidator = (function (_super) {
|
|
35
|
+
__extends(CreatePropertyValidator, _super);
|
|
19
36
|
function CreatePropertyValidator() {
|
|
37
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
20
38
|
}
|
|
21
39
|
__decorate([
|
|
22
40
|
(0, class_validator_1.IsString)(),
|
|
@@ -31,10 +49,12 @@ var CreatePropertyValidator = (function () {
|
|
|
31
49
|
__metadata("design:type", String)
|
|
32
50
|
], CreatePropertyValidator.prototype, "type", void 0);
|
|
33
51
|
return CreatePropertyValidator;
|
|
34
|
-
}());
|
|
52
|
+
}(abstract_validator_1.AbstractValidator));
|
|
35
53
|
exports.CreatePropertyValidator = CreatePropertyValidator;
|
|
36
|
-
var UpdatePropertyValidator = (function () {
|
|
54
|
+
var UpdatePropertyValidator = (function (_super) {
|
|
55
|
+
__extends(UpdatePropertyValidator, _super);
|
|
37
56
|
function UpdatePropertyValidator() {
|
|
57
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
38
58
|
}
|
|
39
59
|
__decorate([
|
|
40
60
|
(0, class_validator_1.IsString)(),
|
|
@@ -47,5 +67,5 @@ var UpdatePropertyValidator = (function () {
|
|
|
47
67
|
__metadata("design:type", String)
|
|
48
68
|
], UpdatePropertyValidator.prototype, "title", void 0);
|
|
49
69
|
return UpdatePropertyValidator;
|
|
50
|
-
}());
|
|
70
|
+
}(abstract_validator_1.AbstractValidator));
|
|
51
71
|
exports.UpdatePropertyValidator = UpdatePropertyValidator;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MetaAddress } from "../../../types";
|
|
2
|
-
|
|
2
|
+
import { AbstractValidator } from "../../../abstract/abstract.validator";
|
|
3
|
+
export declare class CreateClientValidator extends AbstractValidator {
|
|
3
4
|
name: string;
|
|
4
5
|
email: string;
|
|
5
6
|
phone?: string;
|
|
@@ -27,8 +27,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
27
|
exports.UpdateClientValidator = exports.CreateClientValidator = void 0;
|
|
28
28
|
var class_transformer_1 = require("class-transformer");
|
|
29
29
|
var class_validator_1 = require("class-validator");
|
|
30
|
-
var
|
|
30
|
+
var abstract_validator_1 = require("../../../abstract/abstract.validator");
|
|
31
|
+
var CreateClientValidator = (function (_super) {
|
|
32
|
+
__extends(CreateClientValidator, _super);
|
|
31
33
|
function CreateClientValidator() {
|
|
34
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
32
35
|
}
|
|
33
36
|
__decorate([
|
|
34
37
|
(0, class_validator_1.IsString)(),
|
|
@@ -56,7 +59,7 @@ var CreateClientValidator = (function () {
|
|
|
56
59
|
__metadata("design:type", Array)
|
|
57
60
|
], CreateClientValidator.prototype, "addresses", void 0);
|
|
58
61
|
return CreateClientValidator;
|
|
59
|
-
}());
|
|
62
|
+
}(abstract_validator_1.AbstractValidator));
|
|
60
63
|
exports.CreateClientValidator = CreateClientValidator;
|
|
61
64
|
var UpdateClientValidator = (function (_super) {
|
|
62
65
|
__extends(UpdateClientValidator, _super);
|
package/.output/modules/sales/orders/{billing/billing.entity.js → address/address.validator.js}
RENAMED
|
@@ -9,36 +9,38 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var BillingEntity = (function () {
|
|
17
|
-
function BillingEntity() {
|
|
12
|
+
exports.AddressValidator = void 0;
|
|
13
|
+
var class_validator_1 = require("class-validator");
|
|
14
|
+
var AddressValidator = (function () {
|
|
15
|
+
function AddressValidator() {
|
|
18
16
|
}
|
|
19
17
|
__decorate([
|
|
20
|
-
(0,
|
|
18
|
+
(0, class_validator_1.IsISO31661Alpha2)(),
|
|
21
19
|
__metadata("design:type", String)
|
|
22
|
-
],
|
|
20
|
+
], AddressValidator.prototype, "country", void 0);
|
|
23
21
|
__decorate([
|
|
24
|
-
(0,
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
25
23
|
__metadata("design:type", String)
|
|
26
|
-
],
|
|
24
|
+
], AddressValidator.prototype, "code", void 0);
|
|
27
25
|
__decorate([
|
|
28
|
-
(0,
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
29
27
|
__metadata("design:type", String)
|
|
30
|
-
],
|
|
28
|
+
], AddressValidator.prototype, "line1", void 0);
|
|
31
29
|
__decorate([
|
|
32
|
-
(0,
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
32
|
__metadata("design:type", String)
|
|
34
|
-
],
|
|
33
|
+
], AddressValidator.prototype, "line2", void 0);
|
|
35
34
|
__decorate([
|
|
36
|
-
(0,
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
|
-
],
|
|
39
|
-
|
|
40
|
-
(0,
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
], AddressValidator.prototype, "city", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], AddressValidator.prototype, "state", void 0);
|
|
44
|
+
return AddressValidator;
|
|
43
45
|
}());
|
|
44
|
-
exports.
|
|
46
|
+
exports.AddressValidator = AddressValidator;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Types } from 'mongoose';
|
|
2
|
+
import { BillingType } from "./billing.validator";
|
|
1
3
|
export declare class BillingEntity {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
address: string;
|
|
6
|
-
code: string;
|
|
4
|
+
address?: Types.Map<any>;
|
|
5
|
+
customer: Types.Map<any>;
|
|
6
|
+
type: BillingType;
|
|
7
7
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { AddressValidator } from
|
|
1
|
+
import { AddressValidator } from "../address/address.validator";
|
|
2
|
+
import { CreateCustomerValidator } from "../customer/customer.validator";
|
|
3
|
+
import 'reflect-metadata';
|
|
4
|
+
export declare enum BillingType {
|
|
5
|
+
CASH = "CASH",
|
|
6
|
+
CARD = "CARD",
|
|
7
|
+
TRANSFER = "TRANSFER"
|
|
8
|
+
}
|
|
2
9
|
export declare class CreateBillingValidator {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
address: AddressValidator;
|
|
10
|
+
customer: CreateCustomerValidator;
|
|
11
|
+
address?: AddressValidator;
|
|
12
|
+
type: BillingType;
|
|
7
13
|
}
|
|
@@ -9,32 +9,37 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CreateBillingValidator = void 0;
|
|
12
|
+
exports.CreateBillingValidator = exports.BillingType = void 0;
|
|
13
13
|
var class_transformer_1 = require("class-transformer");
|
|
14
14
|
var class_validator_1 = require("class-validator");
|
|
15
|
-
var
|
|
15
|
+
var address_validator_1 = require("../address/address.validator");
|
|
16
|
+
var customer_validator_1 = require("../customer/customer.validator");
|
|
17
|
+
require("reflect-metadata");
|
|
18
|
+
var BillingType;
|
|
19
|
+
(function (BillingType) {
|
|
20
|
+
BillingType["CASH"] = "CASH";
|
|
21
|
+
BillingType["CARD"] = "CARD";
|
|
22
|
+
BillingType["TRANSFER"] = "TRANSFER";
|
|
23
|
+
})(BillingType = exports.BillingType || (exports.BillingType = {}));
|
|
16
24
|
var CreateBillingValidator = (function () {
|
|
17
25
|
function CreateBillingValidator() {
|
|
18
26
|
}
|
|
19
27
|
__decorate([
|
|
20
|
-
(0, class_validator_1.
|
|
21
|
-
(0,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(0, class_validator_1.IsEmail)(),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], CreateBillingValidator.prototype, "email", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, class_validator_1.IsString)(),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], CreateBillingValidator.prototype, "phone", void 0);
|
|
28
|
+
(0, class_validator_1.ValidateNested)(),
|
|
29
|
+
(0, class_transformer_1.Type)(function () { return customer_validator_1.CreateCustomerValidator; }),
|
|
30
|
+
(0, class_validator_1.IsNotEmptyObject)(),
|
|
31
|
+
__metadata("design:type", customer_validator_1.CreateCustomerValidator)
|
|
32
|
+
], CreateBillingValidator.prototype, "customer", void 0);
|
|
32
33
|
__decorate([
|
|
33
34
|
(0, class_validator_1.ValidateNested)(),
|
|
34
|
-
(0, class_transformer_1.Type)(function () { return
|
|
35
|
+
(0, class_transformer_1.Type)(function () { return address_validator_1.AddressValidator; }),
|
|
35
36
|
(0, class_validator_1.IsNotEmptyObject)(),
|
|
36
|
-
__metadata("design:type",
|
|
37
|
+
__metadata("design:type", address_validator_1.AddressValidator)
|
|
37
38
|
], CreateBillingValidator.prototype, "address", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsEnum)(BillingType),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], CreateBillingValidator.prototype, "type", void 0);
|
|
38
43
|
return CreateBillingValidator;
|
|
39
44
|
}());
|
|
40
45
|
exports.CreateBillingValidator = CreateBillingValidator;
|