@merkaly/api 0.2.5-5 → 0.2.5-7
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/abstracts/abstract.entity.d.ts +14 -0
- package/.output/{abstract → abstracts}/abstract.validator.d.ts +13 -9
- package/.output/{abstract → abstracts}/abstract.validator.js +36 -23
- package/.output/exceptions/missing-identity.exception.js +1 -1
- package/.output/modules/asset/files/file.entity.d.ts +1 -2
- package/.output/modules/{sale/orders/item/item.schema.d.ts → asset/files/file.schema.d.ts} +9 -2
- package/.output/modules/asset/files/file.schema.js +10 -0
- package/.output/modules/auth/organizations/organization.entity.d.ts +8 -0
- package/.output/modules/auth/users/user.entity.d.ts +9 -0
- package/.output/modules/{inventory/products/schemas/variant.schema.d.ts → auth/users/user.schema.d.ts} +9 -2
- package/.output/modules/auth/users/user.schema.js +10 -0
- package/.output/modules/auth/users/user.validator.d.ts +11 -9
- package/.output/modules/auth/users/user.validator.js +24 -16
- package/.output/modules/inventory/brands/brand.entity.d.ts +1 -4
- package/.output/modules/inventory/brands/brand.schema.d.ts +34 -0
- package/.output/modules/inventory/brands/brand.schema.js +10 -0
- package/.output/modules/inventory/brands/brand.validator.d.ts +1 -1
- package/.output/modules/inventory/brands/brand.validator.js +4 -5
- package/.output/modules/inventory/categories/category.entity.d.ts +2 -8
- package/.output/modules/inventory/categories/category.schema.d.ts +34 -0
- package/.output/modules/inventory/categories/category.schema.js +10 -0
- package/.output/modules/inventory/categories/category.validator.d.ts +2 -7
- package/.output/modules/inventory/categories/category.validator.js +4 -50
- package/.output/modules/inventory/complements/complement.entity.d.ts +6 -0
- package/.output/modules/inventory/complements/complement.validator.d.ts +10 -0
- package/.output/modules/inventory/{products/validators/variant.validator.js → complements/complement.validator.js} +27 -24
- package/.output/modules/inventory/products/documents/attribute.document.d.ts +5 -0
- package/.output/modules/{sale/orders/billing/validators/customer.validator.js → inventory/products/documents/attribute.document.js} +15 -18
- package/.output/modules/inventory/products/{entities/dimension.entity.d.ts → documents/dimension.document.d.ts} +1 -1
- package/.output/modules/inventory/products/documents/dimension.document.js +35 -0
- package/.output/modules/inventory/products/product.entity.d.ts +11 -18
- package/.output/modules/inventory/products/product.schema.d.ts +34 -0
- package/.output/modules/inventory/products/product.schema.js +18 -0
- package/.output/modules/inventory/products/product.validator.d.ts +17 -26
- package/.output/modules/inventory/products/product.validator.js +76 -132
- package/.output/modules/inventory/products/validators/attributes.validator.d.ts +5 -0
- package/.output/modules/inventory/products/validators/{seo.validator.js → attributes.validator.js} +14 -13
- package/.output/modules/inventory/products/validators/dimension.validator.d.ts +5 -5
- package/.output/modules/inventory/products/validators/dimension.validator.js +16 -21
- package/.output/modules/sale/customers/customer.entity.d.ts +7 -11
- package/.output/modules/sale/customers/customer.schema.d.ts +34 -0
- package/.output/modules/sale/customers/customer.schema.js +10 -0
- package/.output/modules/sale/customers/customer.validator.d.ts +9 -13
- package/.output/modules/sale/customers/customer.validator.js +26 -39
- package/.output/modules/sale/orders/documents/address.document.d.ts +8 -0
- package/.output/modules/sale/orders/documents/address.document.js +43 -0
- package/.output/modules/sale/orders/documents/status.document.d.ts +8 -0
- package/.output/modules/sale/orders/{shipping/validators/customer.validator.js → documents/status.document.js} +17 -19
- package/.output/modules/sale/orders/entities/item.entity.d.ts +38 -0
- package/.output/modules/sale/orders/{status/status.validator.d.ts → enums/order.status.d.ts} +1 -3
- package/.output/modules/sale/orders/enums/order.status.js +10 -0
- package/.output/modules/sale/orders/order.entity.d.ts +16 -16
- package/.output/modules/sale/orders/order.validator.d.ts +11 -23
- package/.output/modules/sale/orders/order.validator.js +26 -80
- package/.output/modules/sale/orders/validators/address.validator.d.ts +17 -0
- package/.output/modules/sale/orders/validators/address.validator.js +81 -0
- package/.output/modules/sale/orders/validators/billing.validator.d.ts +8 -0
- package/.output/modules/sale/orders/validators/billing.validator.js +13 -0
- package/.output/modules/sale/orders/{item → validators}/item.validator.d.ts +2 -1
- package/.output/modules/sale/orders/{item → validators}/item.validator.js +11 -8
- package/.output/modules/sale/orders/validators/payment.validator.d.ts +10 -0
- package/.output/modules/sale/orders/validators/payment.validator.js +62 -0
- package/.output/modules/sale/orders/validators/shipping.validator.d.ts +9 -0
- package/.output/modules/sale/orders/validators/shipping.validator.js +14 -0
- package/.output/modules/sale/payments/entities/status.entity.d.ts +8 -0
- package/.output/modules/sale/payments/enums/billing.type.d.ts +6 -0
- package/.output/modules/sale/payments/enums/billing.type.js +10 -0
- package/.output/modules/sale/payments/enums/payment.status.d.ts +7 -0
- package/.output/modules/sale/payments/enums/payment.status.js +11 -0
- package/.output/modules/sale/payments/enums/shipping.type.d.ts +4 -0
- package/.output/modules/sale/payments/enums/shipping.type.js +8 -0
- package/.output/modules/sale/payments/payment.entity.d.ts +12 -0
- package/.output/modules/sale/payments/payment.schema.d.ts +34 -0
- package/.output/modules/sale/payments/payment.schema.js +14 -0
- package/.output/modules/sale/payments/payment.validator.d.ts +16 -0
- package/.output/modules/sale/payments/payment.validator.js +77 -0
- package/.output/tsconfig.package.tsbuildinfo +1 -0
- package/package.json +69 -78
- package/.output/abstract/abstract.entity.d.ts +0 -9
- package/.output/abstract/abstract.exception.d.ts +0 -11
- package/.output/abstract/abstract.exception.js +0 -53
- package/.output/abstract/abstract.fixture.d.ts +0 -4
- package/.output/abstract/abstract.fixture.js +0 -11
- package/.output/exceptions/store-not-implemented.exception.d.ts +0 -5
- package/.output/exceptions/store-not-implemented.exception.js +0 -31
- package/.output/exceptions/store-not-recognized.exception.d.ts +0 -5
- package/.output/exceptions/store-not-recognized.exception.js +0 -30
- package/.output/modules/auth/auth.types.d.ts +0 -3
- package/.output/modules/auth/auth.types.js +0 -7
- package/.output/modules/config/organization/organization.entity.d.ts +0 -21
- package/.output/modules/config/organization/organization.types.d.ts +0 -23
- package/.output/modules/config/organization/organization.types.js +0 -107
- package/.output/modules/config/organization/organization.validator.d.ts +0 -18
- package/.output/modules/config/organization/organization.validator.js +0 -88
- package/.output/modules/insight/validators/order.validator.d.ts +0 -4
- package/.output/modules/insight/validators/order.validator.js +0 -27
- package/.output/modules/inventory/brands/brand.exception.d.ts +0 -5
- package/.output/modules/inventory/brands/brand.exception.js +0 -40
- package/.output/modules/inventory/categories/category.exception.d.ts +0 -5
- package/.output/modules/inventory/categories/category.exception.js +0 -40
- package/.output/modules/inventory/categories/category.fixture.d.ts +0 -5
- package/.output/modules/inventory/categories/category.fixture.js +0 -38
- package/.output/modules/inventory/products/entities/code.entity.d.ts +0 -5
- package/.output/modules/inventory/products/entities/seo.entity.d.ts +0 -5
- package/.output/modules/inventory/products/entities/variant.entity.d.ts +0 -13
- package/.output/modules/inventory/products/product.exception.d.ts +0 -5
- package/.output/modules/inventory/products/product.exception.js +0 -40
- package/.output/modules/inventory/products/product.fixture.d.ts +0 -5
- package/.output/modules/inventory/products/product.fixture.js +0 -39
- package/.output/modules/inventory/products/schemas/variant.schema.js +0 -6
- package/.output/modules/inventory/products/validators/code.validator.d.ts +0 -5
- package/.output/modules/inventory/products/validators/code.validator.js +0 -37
- package/.output/modules/inventory/products/validators/seo.validator.d.ts +0 -5
- package/.output/modules/inventory/products/validators/variant.validator.d.ts +0 -10
- package/.output/modules/inventory/properties/property.entity.d.ts +0 -8
- package/.output/modules/inventory/properties/property.exception.d.ts +0 -5
- package/.output/modules/inventory/properties/property.exception.js +0 -40
- package/.output/modules/inventory/properties/property.types.d.ts +0 -6
- package/.output/modules/inventory/properties/property.types.js +0 -10
- package/.output/modules/inventory/properties/property.validator.d.ts +0 -12
- package/.output/modules/inventory/properties/property.validator.js +0 -79
- package/.output/modules/layout/pages/page.entity.d.ts +0 -8
- package/.output/modules/layout/pages/page.fixture.d.ts +0 -5
- package/.output/modules/layout/pages/page.fixture.js +0 -36
- package/.output/modules/layout/pages/page.types.d.ts +0 -20
- package/.output/modules/layout/pages/page.types.js +0 -2
- package/.output/modules/layout/pages/page.validator.d.ts +0 -8
- package/.output/modules/layout/pages/page.validator.js +0 -61
- package/.output/modules/sale/customers/customer.exception.d.ts +0 -5
- package/.output/modules/sale/customers/customer.exception.js +0 -40
- package/.output/modules/sale/orders/billing/billing.entity.d.ts +0 -10
- package/.output/modules/sale/orders/billing/billing.types.d.ts +0 -9
- package/.output/modules/sale/orders/billing/billing.types.js +0 -14
- package/.output/modules/sale/orders/billing/billing.validator.d.ts +0 -9
- package/.output/modules/sale/orders/billing/billing.validator.js +0 -42
- package/.output/modules/sale/orders/billing/entities/address.entity.d.ts +0 -10
- package/.output/modules/sale/orders/billing/entities/customer.entity.d.ts +0 -5
- package/.output/modules/sale/orders/billing/entities/status.entity.d.ts +0 -6
- package/.output/modules/sale/orders/billing/validators/address.validator.d.ts +0 -10
- package/.output/modules/sale/orders/billing/validators/address.validator.js +0 -56
- package/.output/modules/sale/orders/billing/validators/customer.validator.d.ts +0 -5
- package/.output/modules/sale/orders/customer/customer.entity.d.ts +0 -5
- package/.output/modules/sale/orders/customer/customer.validator.d.ts +0 -5
- package/.output/modules/sale/orders/customer/customer.validator.js +0 -36
- package/.output/modules/sale/orders/item/item.entity.d.ts +0 -9
- package/.output/modules/sale/orders/item/item.schema.js +0 -9
- package/.output/modules/sale/orders/order.exception.d.ts +0 -13
- package/.output/modules/sale/orders/order.exception.js +0 -46
- package/.output/modules/sale/orders/shipping/entities/address.entity.d.ts +0 -10
- package/.output/modules/sale/orders/shipping/entities/customer.entity.d.ts +0 -5
- package/.output/modules/sale/orders/shipping/entities/status.entity.d.ts +0 -6
- package/.output/modules/sale/orders/shipping/shipping.entity.d.ts +0 -11
- package/.output/modules/sale/orders/shipping/shipping.types.d.ts +0 -11
- package/.output/modules/sale/orders/shipping/shipping.types.js +0 -16
- package/.output/modules/sale/orders/shipping/shipping.validator.d.ts +0 -10
- package/.output/modules/sale/orders/shipping/shipping.validator.js +0 -48
- package/.output/modules/sale/orders/shipping/validators/address.validator.d.ts +0 -10
- package/.output/modules/sale/orders/shipping/validators/address.validator.js +0 -56
- package/.output/modules/sale/orders/shipping/validators/customer.validator.d.ts +0 -5
- package/.output/modules/sale/orders/status/status.entity.d.ts +0 -6
- package/.output/modules/sale/orders/status/status.validator.js +0 -12
- package/.output/services/logger.service.d.ts +0 -11
- package/.output/services/logger.service.js +0 -50
- package/.output/types.d.ts +0 -18
- package/.output/types.js +0 -2
- package/LICENSE +0 -674
|
@@ -9,41 +9,44 @@ 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.
|
|
12
|
+
exports.UpdateComplementValidator = exports.CreateComplementValidator = void 0;
|
|
13
13
|
var class_validator_1 = require("class-validator");
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
function ProductVariantValidator() {
|
|
14
|
+
var CreateComplementValidator = exports.CreateComplementValidator = (function () {
|
|
15
|
+
function CreateComplementValidator() {
|
|
17
16
|
}
|
|
18
17
|
__decorate([
|
|
19
|
-
(0, class_validator_1.
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
], ProductVariantValidator.prototype, "active", void 0);
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], CreateComplementValidator.prototype, "name", void 0);
|
|
23
21
|
__decorate([
|
|
24
22
|
(0, class_validator_1.IsString)(),
|
|
25
|
-
(0, class_validator_1.IsOptional)(),
|
|
26
23
|
__metadata("design:type", String)
|
|
27
|
-
],
|
|
24
|
+
], CreateComplementValidator.prototype, "description", void 0);
|
|
28
25
|
__decorate([
|
|
29
26
|
(0, class_validator_1.IsNumber)(),
|
|
30
|
-
(0, class_validator_1.
|
|
31
|
-
(0, class_transformer_1.Transform)(function (_a) {
|
|
32
|
-
var value = _a.value;
|
|
33
|
-
return Number.isFinite(value) ? value : null;
|
|
34
|
-
}),
|
|
27
|
+
(0, class_validator_1.IsPositive)(),
|
|
35
28
|
__metadata("design:type", Number)
|
|
36
|
-
],
|
|
29
|
+
], CreateComplementValidator.prototype, "price", void 0);
|
|
30
|
+
return CreateComplementValidator;
|
|
31
|
+
}());
|
|
32
|
+
var UpdateComplementValidator = exports.UpdateComplementValidator = (function () {
|
|
33
|
+
function UpdateComplementValidator() {
|
|
34
|
+
}
|
|
37
35
|
__decorate([
|
|
38
|
-
(0, class_validator_1.IsNumber)(),
|
|
39
36
|
(0, class_validator_1.IsOptional)(),
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], UpdateComplementValidator.prototype, "name", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], UpdateComplementValidator.prototype, "description", void 0);
|
|
42
45
|
__decorate([
|
|
43
46
|
(0, class_validator_1.IsOptional)(),
|
|
44
|
-
(0, class_validator_1.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
(0, class_validator_1.IsNumber)(),
|
|
48
|
+
(0, class_validator_1.IsPositive)(),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], UpdateComplementValidator.prototype, "price", void 0);
|
|
51
|
+
return UpdateComplementValidator;
|
|
48
52
|
}());
|
|
49
|
-
exports.ProductVariantValidator = ProductVariantValidator;
|
|
@@ -9,28 +9,25 @@ 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
|
-
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
12
|
+
exports.ProductAttributesDocument = void 0;
|
|
13
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
var mongoose_2 = require("mongoose");
|
|
15
|
+
var ProductAttributesDocument = exports.ProductAttributesDocument = (function () {
|
|
16
|
+
function ProductAttributesDocument() {
|
|
17
|
+
this.units = 1;
|
|
18
|
+
this.stock = null;
|
|
19
19
|
}
|
|
20
20
|
__decorate([
|
|
21
|
-
(0,
|
|
22
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
+
(0, mongoose_1.Prop)({ default: function () { return 1; }, type: mongoose_2.Schema.Types.Number }),
|
|
23
22
|
__metadata("design:type", Object)
|
|
24
|
-
],
|
|
23
|
+
], ProductAttributesDocument.prototype, "units", void 0);
|
|
25
24
|
__decorate([
|
|
26
|
-
(0,
|
|
27
|
-
__metadata("design:type",
|
|
28
|
-
],
|
|
25
|
+
(0, mongoose_1.Prop)({ default: function () { return null; }, type: mongoose_2.Schema.Types.Number }),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], ProductAttributesDocument.prototype, "stock", void 0);
|
|
29
28
|
__decorate([
|
|
30
|
-
(0,
|
|
31
|
-
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
(0, mongoose_1.Prop)({ default: function () { return undefined; }, required: true, type: mongoose_2.Schema.Types.String, unique: true }),
|
|
32
30
|
__metadata("design:type", String)
|
|
33
|
-
],
|
|
34
|
-
return
|
|
31
|
+
], ProductAttributesDocument.prototype, "sku", void 0);
|
|
32
|
+
return ProductAttributesDocument;
|
|
35
33
|
}());
|
|
36
|
-
exports.BillingCustomerValidator = BillingCustomerValidator;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProductDimensionDocument = void 0;
|
|
13
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
var mongoose_2 = require("mongoose");
|
|
15
|
+
var ProductDimensionDocument = exports.ProductDimensionDocument = (function () {
|
|
16
|
+
function ProductDimensionDocument() {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], ProductDimensionDocument.prototype, "weight", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], ProductDimensionDocument.prototype, "height", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], ProductDimensionDocument.prototype, "width", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], ProductDimensionDocument.prototype, "depth", void 0);
|
|
34
|
+
return ProductDimensionDocument;
|
|
35
|
+
}());
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import { AbstractEntity } from '../../../
|
|
1
|
+
import { AbstractEntity, MaybeEntity } from '../../../abstracts/abstract.entity';
|
|
2
2
|
import { FileEntity } from '../../asset/files/file.entity';
|
|
3
3
|
import { BrandEntity } from '../brands/brand.entity';
|
|
4
4
|
import { CategoryEntity } from '../categories/category.entity';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { SeoEntity } from './entities/seo.entity';
|
|
8
|
-
import { VariantEntity } from './entities/variant.entity';
|
|
5
|
+
import { ProductAttributesDocument } from './documents/attribute.document';
|
|
6
|
+
import { ProductDimensionDocument } from './documents/dimension.document';
|
|
9
7
|
export declare class ProductEntity extends AbstractEntity {
|
|
10
|
-
static readonly $index = "inventory_products";
|
|
11
8
|
name: string;
|
|
12
|
-
measurement: string;
|
|
13
|
-
active: boolean;
|
|
14
9
|
description: string;
|
|
15
|
-
|
|
16
|
-
category?: CategoryEntity;
|
|
17
|
-
brand?: BrandEntity;
|
|
18
|
-
files: FileEntity[];
|
|
10
|
+
active: boolean;
|
|
19
11
|
price: number;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
hashtags: string[];
|
|
13
|
+
brand?: MaybeEntity<BrandEntity>;
|
|
14
|
+
category?: MaybeEntity<CategoryEntity>;
|
|
15
|
+
pictures: FileEntity[];
|
|
16
|
+
attributes: ProductAttributesDocument;
|
|
17
|
+
dimension: ProductDimensionDocument;
|
|
18
|
+
readonly image: string;
|
|
26
19
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { ProductEntity } from './product.entity';
|
|
27
|
+
export declare namespace ProductSchema {
|
|
28
|
+
const name = "inventory_products";
|
|
29
|
+
const schema: import("mongoose").Schema<ProductEntity, import("mongoose").Model<ProductEntity, any, any, any, import("mongoose").Document<unknown, any, ProductEntity> & ProductEntity & Required<{
|
|
30
|
+
_id: string;
|
|
31
|
+
}>, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ProductEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ProductEntity>> & import("mongoose").FlatRecord<ProductEntity> & Required<{
|
|
32
|
+
_id: string;
|
|
33
|
+
}>>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductSchema = void 0;
|
|
4
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
5
|
+
var product_entity_1 = require("./product.entity");
|
|
6
|
+
var ProductSchema;
|
|
7
|
+
(function (ProductSchema) {
|
|
8
|
+
ProductSchema.name = 'inventory_products';
|
|
9
|
+
ProductSchema.schema = mongoose_1.SchemaFactory.createForClass(product_entity_1.ProductEntity);
|
|
10
|
+
ProductSchema.schema.index({
|
|
11
|
+
description: 'text',
|
|
12
|
+
name: 'text',
|
|
13
|
+
});
|
|
14
|
+
ProductSchema.schema.virtual('image').get(function () {
|
|
15
|
+
var first = this.pictures[0];
|
|
16
|
+
return first === null || first === void 0 ? void 0 : first.url;
|
|
17
|
+
});
|
|
18
|
+
})(ProductSchema || (exports.ProductSchema = ProductSchema = {}));
|
|
@@ -1,38 +1,29 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { AbstractValidator } from '../../../abstract/abstract.validator';
|
|
6
|
-
import { ProductVariantValidator } from "./validators/variant.validator";
|
|
7
|
-
import { ProductEntity } from "./product.entity";
|
|
1
|
+
import { AbstractValidator } from '../../../abstracts/abstract.validator';
|
|
2
|
+
import { ProductEntity } from './product.entity';
|
|
3
|
+
import { AttributesValidator } from './validators/attributes.validator';
|
|
4
|
+
import { DimensionValidator } from './validators/dimension.validator';
|
|
8
5
|
export declare class CreateProductValidator extends AbstractValidator {
|
|
6
|
+
active?: boolean;
|
|
7
|
+
hashtags?: string[];
|
|
9
8
|
name: string;
|
|
10
9
|
description: string;
|
|
11
|
-
|
|
10
|
+
price: number;
|
|
11
|
+
pictures?: string[];
|
|
12
12
|
category?: string;
|
|
13
13
|
brand?: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
price: number;
|
|
17
|
-
seo: ProductSeoValidator;
|
|
18
|
-
dimension: ProductDimensionValidator;
|
|
19
|
-
code: ProductCodeValidator;
|
|
20
|
-
stock: number | null;
|
|
21
|
-
variants?: ProductVariantValidator[];
|
|
14
|
+
dimension?: DimensionValidator;
|
|
15
|
+
attributes?: AttributesValidator;
|
|
22
16
|
}
|
|
23
17
|
export declare class UpdateProductValidator {
|
|
24
|
-
|
|
18
|
+
active?: boolean;
|
|
19
|
+
hashtags?: string[];
|
|
25
20
|
name?: string;
|
|
26
21
|
description?: string;
|
|
27
|
-
|
|
22
|
+
price?: number;
|
|
28
23
|
category?: string;
|
|
29
24
|
brand?: string;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
dimension: ProductDimensionValidator;
|
|
35
|
-
code?: ProductCodeValidator;
|
|
36
|
-
stock?: number;
|
|
37
|
-
variants?: ProductVariantValidator[];
|
|
25
|
+
pictures?: string[];
|
|
26
|
+
dimension?: DimensionValidator;
|
|
27
|
+
attributes?: AttributesValidator;
|
|
28
|
+
constructor(entity: ProductEntity);
|
|
38
29
|
}
|
|
@@ -27,44 +27,52 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
27
|
exports.UpdateProductValidator = exports.CreateProductValidator = void 0;
|
|
28
28
|
var class_transformer_1 = require("class-transformer");
|
|
29
29
|
var class_validator_1 = require("class-validator");
|
|
30
|
-
require("
|
|
31
|
-
var
|
|
30
|
+
var abstract_validator_1 = require("../../../abstracts/abstract.validator");
|
|
31
|
+
var attributes_validator_1 = require("./validators/attributes.validator");
|
|
32
32
|
var dimension_validator_1 = require("./validators/dimension.validator");
|
|
33
|
-
var
|
|
34
|
-
var abstract_validator_1 = require("../../../abstract/abstract.validator");
|
|
35
|
-
var variant_validator_1 = require("./validators/variant.validator");
|
|
36
|
-
var CreateProductValidator = (function (_super) {
|
|
33
|
+
var CreateProductValidator = exports.CreateProductValidator = (function (_super) {
|
|
37
34
|
__extends(CreateProductValidator, _super);
|
|
38
35
|
function CreateProductValidator() {
|
|
39
36
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
-
_this.
|
|
41
|
-
_this.description = String();
|
|
42
|
-
_this.category = null;
|
|
43
|
-
_this.brand = null;
|
|
44
|
-
_this.files = [];
|
|
37
|
+
_this.active = true;
|
|
45
38
|
_this.hashtags = [];
|
|
46
|
-
_this.
|
|
47
|
-
_this.dimension = new dimension_validator_1.
|
|
48
|
-
_this.
|
|
49
|
-
_this.stock = null;
|
|
50
|
-
_this.variants = [];
|
|
39
|
+
_this.pictures = [];
|
|
40
|
+
_this.dimension = new dimension_validator_1.DimensionValidator();
|
|
41
|
+
_this.attributes = new attributes_validator_1.AttributesValidator();
|
|
51
42
|
return _this;
|
|
52
43
|
}
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsBoolean)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], CreateProductValidator.prototype, "active", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
51
|
+
(0, class_validator_1.IsNotEmpty)({ each: true }),
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
__metadata("design:type", Array)
|
|
54
|
+
], CreateProductValidator.prototype, "hashtags", void 0);
|
|
53
55
|
__decorate([
|
|
54
56
|
(0, class_validator_1.IsString)(),
|
|
55
57
|
(0, class_validator_1.IsNotEmpty)(),
|
|
56
|
-
__metadata("design:type",
|
|
58
|
+
__metadata("design:type", String)
|
|
57
59
|
], CreateProductValidator.prototype, "name", void 0);
|
|
58
60
|
__decorate([
|
|
59
61
|
(0, class_validator_1.IsString)(),
|
|
60
62
|
(0, class_validator_1.IsOptional)(),
|
|
61
|
-
__metadata("design:type",
|
|
63
|
+
__metadata("design:type", String)
|
|
62
64
|
], CreateProductValidator.prototype, "description", void 0);
|
|
63
65
|
__decorate([
|
|
64
|
-
(0, class_validator_1.
|
|
66
|
+
(0, class_validator_1.IsNumber)(),
|
|
67
|
+
(0, class_validator_1.IsPositive)(),
|
|
68
|
+
__metadata("design:type", Number)
|
|
69
|
+
], CreateProductValidator.prototype, "price", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_validator_1.IsMongoId)({ each: true }),
|
|
72
|
+
(0, class_validator_1.IsArray)(),
|
|
65
73
|
(0, class_validator_1.IsOptional)(),
|
|
66
|
-
__metadata("design:type",
|
|
67
|
-
], CreateProductValidator.prototype, "
|
|
74
|
+
__metadata("design:type", Array)
|
|
75
|
+
], CreateProductValidator.prototype, "pictures", void 0);
|
|
68
76
|
__decorate([
|
|
69
77
|
(0, class_validator_1.IsOptional)(),
|
|
70
78
|
(0, class_validator_1.IsMongoId)(),
|
|
@@ -76,105 +84,69 @@ var CreateProductValidator = (function (_super) {
|
|
|
76
84
|
__metadata("design:type", String)
|
|
77
85
|
], CreateProductValidator.prototype, "brand", void 0);
|
|
78
86
|
__decorate([
|
|
79
|
-
(0,
|
|
80
|
-
(0, class_validator_1.IsOptional)(),
|
|
81
|
-
__metadata("design:type", Array)
|
|
82
|
-
], CreateProductValidator.prototype, "files", void 0);
|
|
83
|
-
__decorate([
|
|
84
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
85
|
-
__metadata("design:type", Array)
|
|
86
|
-
], CreateProductValidator.prototype, "hashtags", void 0);
|
|
87
|
-
__decorate([
|
|
88
|
-
(0, class_validator_1.IsNumber)(),
|
|
89
|
-
__metadata("design:type", Number)
|
|
90
|
-
], CreateProductValidator.prototype, "price", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
(0, class_validator_1.ValidateNested)(),
|
|
93
|
-
(0, class_transformer_1.Type)(function () { return seo_validator_1.ProductSeoValidator; }),
|
|
94
|
-
__metadata("design:type", Object)
|
|
95
|
-
], CreateProductValidator.prototype, "seo", void 0);
|
|
96
|
-
__decorate([
|
|
87
|
+
(0, class_transformer_1.Type)(function () { return dimension_validator_1.DimensionValidator; }),
|
|
97
88
|
(0, class_validator_1.ValidateNested)(),
|
|
98
|
-
(0,
|
|
89
|
+
(0, class_validator_1.IsOptional)(),
|
|
99
90
|
__metadata("design:type", Object)
|
|
100
91
|
], CreateProductValidator.prototype, "dimension", void 0);
|
|
101
92
|
__decorate([
|
|
93
|
+
(0, class_transformer_1.Type)(function () { return attributes_validator_1.AttributesValidator; }),
|
|
102
94
|
(0, class_validator_1.ValidateNested)(),
|
|
103
|
-
(0,
|
|
95
|
+
(0, class_validator_1.IsOptional)(),
|
|
104
96
|
__metadata("design:type", Object)
|
|
105
|
-
], CreateProductValidator.prototype, "
|
|
97
|
+
], CreateProductValidator.prototype, "attributes", void 0);
|
|
98
|
+
return CreateProductValidator;
|
|
99
|
+
}(abstract_validator_1.AbstractValidator));
|
|
100
|
+
var UpdateProductValidator = exports.UpdateProductValidator = (function () {
|
|
101
|
+
function UpdateProductValidator(entity) {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
this.hashtags = [];
|
|
104
|
+
this.pictures = [];
|
|
105
|
+
this.attributes = new attributes_validator_1.AttributesValidator();
|
|
106
|
+
this.active = entity.active;
|
|
107
|
+
this.name = entity.name;
|
|
108
|
+
this.description = entity.description;
|
|
109
|
+
this.price = entity.price;
|
|
110
|
+
this.hashtags = entity.hashtags;
|
|
111
|
+
this.category = (_a = entity.category) === null || _a === void 0 ? void 0 : _a._id;
|
|
112
|
+
this.brand = (_b = entity.brand) === null || _b === void 0 ? void 0 : _b._id;
|
|
113
|
+
this.pictures = entity.pictures.map(function (file) { return file._id; });
|
|
114
|
+
this.attributes.sku = entity.attributes.sku;
|
|
115
|
+
this.attributes.stock = entity.attributes.stock;
|
|
116
|
+
this.attributes.units = entity.attributes.units;
|
|
117
|
+
this.dimension.depth = entity.dimension.depth;
|
|
118
|
+
this.dimension.height = entity.dimension.height;
|
|
119
|
+
this.dimension.weight = entity.dimension.weight;
|
|
120
|
+
this.dimension.width = entity.dimension.width;
|
|
121
|
+
}
|
|
106
122
|
__decorate([
|
|
107
|
-
(0, class_validator_1.
|
|
123
|
+
(0, class_validator_1.IsBoolean)(),
|
|
108
124
|
(0, class_validator_1.IsOptional)(),
|
|
109
|
-
(
|
|
110
|
-
|
|
111
|
-
], CreateProductValidator.prototype, "stock", void 0);
|
|
125
|
+
__metadata("design:type", Boolean)
|
|
126
|
+
], UpdateProductValidator.prototype, "active", void 0);
|
|
112
127
|
__decorate([
|
|
113
|
-
(0, class_validator_1.
|
|
114
|
-
(0,
|
|
128
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
129
|
+
(0, class_validator_1.IsNotEmpty)({ each: true }),
|
|
115
130
|
(0, class_validator_1.IsOptional)(),
|
|
116
131
|
__metadata("design:type", Array)
|
|
117
|
-
],
|
|
118
|
-
return CreateProductValidator;
|
|
119
|
-
}(abstract_validator_1.AbstractValidator));
|
|
120
|
-
exports.CreateProductValidator = CreateProductValidator;
|
|
121
|
-
var UpdateProductValidator = (function () {
|
|
122
|
-
function UpdateProductValidator(product) {
|
|
123
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
124
|
-
this.seo = new seo_validator_1.ProductSeoValidator();
|
|
125
|
-
this.dimension = new dimension_validator_1.ProductDimensionValidator();
|
|
126
|
-
this.code = new code_validator_1.ProductCodeValidator();
|
|
127
|
-
this.variants = [];
|
|
128
|
-
if (!product) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
this.name = product.name;
|
|
132
|
-
this.description = product.description;
|
|
133
|
-
this.active = product.active;
|
|
134
|
-
this.category = (_a = product.category) === null || _a === void 0 ? void 0 : _a._id;
|
|
135
|
-
this.brand = (_b = product.brand) === null || _b === void 0 ? void 0 : _b._id;
|
|
136
|
-
this.files = product.files.map(function (file) { return file._id; });
|
|
137
|
-
this.hashtags = product.hashtags;
|
|
138
|
-
this.price = product.price;
|
|
139
|
-
this.seo.title = (_c = product.seo) === null || _c === void 0 ? void 0 : _c.title;
|
|
140
|
-
this.seo.slug = (_d = product.seo) === null || _d === void 0 ? void 0 : _d.slug;
|
|
141
|
-
this.seo.description = (_e = product.seo) === null || _e === void 0 ? void 0 : _e.description;
|
|
142
|
-
this.dimension.depth = (_f = product.dimension) === null || _f === void 0 ? void 0 : _f.depth;
|
|
143
|
-
this.dimension.height = (_g = product.dimension) === null || _g === void 0 ? void 0 : _g.height;
|
|
144
|
-
this.dimension.weight = (_h = product.dimension) === null || _h === void 0 ? void 0 : _h.weight;
|
|
145
|
-
this.dimension.width = (_j = product.dimension) === null || _j === void 0 ? void 0 : _j.width;
|
|
146
|
-
this.code.gtin = (_k = product.code) === null || _k === void 0 ? void 0 : _k.gtin;
|
|
147
|
-
this.code.mpn = (_l = product.code) === null || _l === void 0 ? void 0 : _l.mpn;
|
|
148
|
-
this.code.sku = (_m = product.code) === null || _m === void 0 ? void 0 : _m.sku;
|
|
149
|
-
this.dimension.height = (_o = product.dimension) === null || _o === void 0 ? void 0 : _o.height;
|
|
150
|
-
this.dimension.weight = (_p = product.dimension) === null || _p === void 0 ? void 0 : _p.weight;
|
|
151
|
-
this.dimension.width = (_q = product.dimension) === null || _q === void 0 ? void 0 : _q.width;
|
|
152
|
-
this.variants = product.variants.map(function (variant) { return ({
|
|
153
|
-
price: variant.price,
|
|
154
|
-
stock: variant.stock,
|
|
155
|
-
title: variant.title,
|
|
156
|
-
combinations: variant.combinations.map(function (combination) { return ({
|
|
157
|
-
property: combination.property,
|
|
158
|
-
value: combination.value
|
|
159
|
-
}); }),
|
|
160
|
-
}); });
|
|
161
|
-
}
|
|
132
|
+
], UpdateProductValidator.prototype, "hashtags", void 0);
|
|
162
133
|
__decorate([
|
|
134
|
+
(0, class_validator_1.IsOptional)(),
|
|
163
135
|
(0, class_validator_1.IsString)(),
|
|
164
136
|
(0, class_validator_1.IsNotEmpty)(),
|
|
165
|
-
(0, class_validator_1.IsOptional)(),
|
|
166
137
|
__metadata("design:type", String)
|
|
167
138
|
], UpdateProductValidator.prototype, "name", void 0);
|
|
168
139
|
__decorate([
|
|
140
|
+
(0, class_validator_1.IsOptional)(),
|
|
169
141
|
(0, class_validator_1.IsString)(),
|
|
170
142
|
(0, class_validator_1.IsOptional)(),
|
|
171
143
|
__metadata("design:type", String)
|
|
172
144
|
], UpdateProductValidator.prototype, "description", void 0);
|
|
173
145
|
__decorate([
|
|
174
|
-
(0, class_validator_1.IsBoolean)(),
|
|
175
146
|
(0, class_validator_1.IsOptional)(),
|
|
176
|
-
|
|
177
|
-
|
|
147
|
+
(0, class_validator_1.IsNumber)(),
|
|
148
|
+
__metadata("design:type", Number)
|
|
149
|
+
], UpdateProductValidator.prototype, "price", void 0);
|
|
178
150
|
__decorate([
|
|
179
151
|
(0, class_validator_1.IsOptional)(),
|
|
180
152
|
(0, class_validator_1.IsMongoId)(),
|
|
@@ -187,49 +159,21 @@ var UpdateProductValidator = (function () {
|
|
|
187
159
|
], UpdateProductValidator.prototype, "brand", void 0);
|
|
188
160
|
__decorate([
|
|
189
161
|
(0, class_validator_1.IsMongoId)({ each: true }),
|
|
162
|
+
(0, class_validator_1.IsArray)(),
|
|
190
163
|
(0, class_validator_1.IsOptional)(),
|
|
191
164
|
__metadata("design:type", Array)
|
|
192
|
-
], UpdateProductValidator.prototype, "
|
|
193
|
-
__decorate([
|
|
194
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
195
|
-
(0, class_validator_1.IsOptional)(),
|
|
196
|
-
__metadata("design:type", Array)
|
|
197
|
-
], UpdateProductValidator.prototype, "hashtags", void 0);
|
|
198
|
-
__decorate([
|
|
199
|
-
(0, class_validator_1.IsNumber)(),
|
|
200
|
-
(0, class_validator_1.IsOptional)(),
|
|
201
|
-
__metadata("design:type", Number)
|
|
202
|
-
], UpdateProductValidator.prototype, "price", void 0);
|
|
203
|
-
__decorate([
|
|
204
|
-
(0, class_validator_1.ValidateNested)(),
|
|
205
|
-
(0, class_transformer_1.Type)(function () { return seo_validator_1.ProductSeoValidator; }),
|
|
206
|
-
(0, class_validator_1.IsOptional)(),
|
|
207
|
-
__metadata("design:type", Object)
|
|
208
|
-
], UpdateProductValidator.prototype, "seo", void 0);
|
|
165
|
+
], UpdateProductValidator.prototype, "pictures", void 0);
|
|
209
166
|
__decorate([
|
|
167
|
+
(0, class_transformer_1.Type)(function () { return dimension_validator_1.DimensionValidator; }),
|
|
210
168
|
(0, class_validator_1.ValidateNested)(),
|
|
211
|
-
(0, class_transformer_1.Type)(function () { return dimension_validator_1.ProductDimensionValidator; }),
|
|
212
169
|
(0, class_validator_1.IsOptional)(),
|
|
213
|
-
__metadata("design:type",
|
|
170
|
+
__metadata("design:type", dimension_validator_1.DimensionValidator)
|
|
214
171
|
], UpdateProductValidator.prototype, "dimension", void 0);
|
|
215
172
|
__decorate([
|
|
173
|
+
(0, class_transformer_1.Type)(function () { return attributes_validator_1.AttributesValidator; }),
|
|
216
174
|
(0, class_validator_1.ValidateNested)(),
|
|
217
|
-
(0, class_transformer_1.Type)(function () { return code_validator_1.ProductCodeValidator; }),
|
|
218
|
-
(0, class_validator_1.IsOptional)(),
|
|
219
|
-
__metadata("design:type", Object)
|
|
220
|
-
], UpdateProductValidator.prototype, "code", void 0);
|
|
221
|
-
__decorate([
|
|
222
|
-
(0, class_validator_1.IsNumber)(),
|
|
223
|
-
(0, class_validator_1.IsOptional)(),
|
|
224
|
-
(0, class_validator_1.Min)(0),
|
|
225
|
-
__metadata("design:type", Number)
|
|
226
|
-
], UpdateProductValidator.prototype, "stock", void 0);
|
|
227
|
-
__decorate([
|
|
228
|
-
(0, class_validator_1.ValidateNested)(),
|
|
229
|
-
(0, class_transformer_1.Type)(function () { return variant_validator_1.ProductVariantValidator; }),
|
|
230
175
|
(0, class_validator_1.IsOptional)(),
|
|
231
|
-
__metadata("design:type",
|
|
232
|
-
], UpdateProductValidator.prototype, "
|
|
176
|
+
__metadata("design:type", attributes_validator_1.AttributesValidator)
|
|
177
|
+
], UpdateProductValidator.prototype, "attributes", void 0);
|
|
233
178
|
return UpdateProductValidator;
|
|
234
179
|
}());
|
|
235
|
-
exports.UpdateProductValidator = UpdateProductValidator;
|
package/.output/modules/inventory/products/validators/{seo.validator.js → attributes.validator.js}
RENAMED
|
@@ -9,26 +9,27 @@ 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.
|
|
12
|
+
exports.AttributesValidator = void 0;
|
|
13
13
|
var class_validator_1 = require("class-validator");
|
|
14
|
-
var
|
|
15
|
-
function
|
|
14
|
+
var AttributesValidator = exports.AttributesValidator = (function () {
|
|
15
|
+
function AttributesValidator() {
|
|
16
|
+
this.units = 1;
|
|
17
|
+
this.stock = null;
|
|
16
18
|
}
|
|
17
19
|
__decorate([
|
|
18
|
-
(0, class_validator_1.
|
|
19
|
-
(
|
|
20
|
-
|
|
21
|
-
], ProductSeoValidator.prototype, "title", void 0);
|
|
20
|
+
(0, class_validator_1.IsPositive)(),
|
|
21
|
+
__metadata("design:type", Object)
|
|
22
|
+
], AttributesValidator.prototype, "units", void 0);
|
|
22
23
|
__decorate([
|
|
23
|
-
(0, class_validator_1.
|
|
24
|
+
(0, class_validator_1.IsNumber)(),
|
|
24
25
|
(0, class_validator_1.IsOptional)(),
|
|
25
|
-
__metadata("design:type",
|
|
26
|
-
],
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], AttributesValidator.prototype, "stock", void 0);
|
|
27
28
|
__decorate([
|
|
28
29
|
(0, class_validator_1.IsString)(),
|
|
29
30
|
(0, class_validator_1.IsOptional)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
32
|
__metadata("design:type", String)
|
|
31
|
-
],
|
|
32
|
-
return
|
|
33
|
+
], AttributesValidator.prototype, "sku", void 0);
|
|
34
|
+
return AttributesValidator;
|
|
33
35
|
}());
|
|
34
|
-
exports.ProductSeoValidator = ProductSeoValidator;
|