@merkaly/api 0.2.2-25 → 0.2.2-27

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.
Files changed (64) hide show
  1. package/.output/abstract/abstract.document.js +4 -6
  2. package/.output/abstract/abstract.entity.js +41 -21
  3. package/.output/abstract/abstract.validator.js +60 -43
  4. package/.output/modules/assets/asset.entity.js +56 -39
  5. package/.output/modules/insight/validators/order.validator.js +14 -13
  6. package/.output/modules/inventory/brands/brand.document.js +26 -5
  7. package/.output/modules/inventory/brands/brand.entity.js +37 -19
  8. package/.output/modules/inventory/brands/brand.validator.js +31 -29
  9. package/.output/modules/inventory/categories/category.document.js +27 -6
  10. package/.output/modules/inventory/categories/category.entity.js +48 -30
  11. package/.output/modules/inventory/categories/category.validator.js +43 -41
  12. package/.output/modules/inventory/products/entities/code.entity.d.ts +5 -0
  13. package/.output/modules/inventory/products/entities/code.entity.js +53 -0
  14. package/.output/modules/inventory/products/entities/dimension.entity.d.ts +6 -0
  15. package/.output/modules/inventory/products/entities/dimension.entity.js +57 -0
  16. package/.output/modules/inventory/products/entities/price.entity.d.ts +4 -0
  17. package/.output/modules/inventory/products/entities/price.entity.js +49 -0
  18. package/.output/modules/inventory/products/entities/seo.entity.d.ts +5 -0
  19. package/.output/modules/inventory/products/entities/seo.entity.js +53 -0
  20. package/.output/modules/inventory/products/product.document.js +28 -9
  21. package/.output/modules/inventory/products/product.entity.d.ts +10 -1
  22. package/.output/modules/inventory/products/product.entity.js +84 -42
  23. package/.output/modules/inventory/products/product.validator.d.ts +14 -11
  24. package/.output/modules/inventory/products/product.validator.js +99 -77
  25. package/.output/modules/inventory/products/validators/code.validator.d.ts +5 -0
  26. package/.output/modules/inventory/products/validators/code.validator.js +37 -0
  27. package/.output/modules/inventory/products/validators/dimension.validator.d.ts +6 -0
  28. package/.output/modules/inventory/products/validators/dimension.validator.js +43 -0
  29. package/.output/modules/inventory/products/validators/price.validator.d.ts +4 -0
  30. package/.output/modules/inventory/products/validators/price.validator.js +30 -0
  31. package/.output/modules/inventory/products/validators/seo.validator.d.ts +5 -0
  32. package/.output/modules/inventory/products/validators/seo.validator.js +37 -0
  33. package/.output/modules/inventory/properties/property.entity.js +42 -25
  34. package/.output/modules/inventory/properties/property.validator.js +33 -32
  35. package/.output/modules/search/search.validator.js +36 -26
  36. package/.output/modules/setting/connections/connection.validator.d.ts +0 -1
  37. package/.output/modules/setting/connections/connection.validator.js +23 -21
  38. package/.output/modules/setting/members/member.validator.d.ts +0 -1
  39. package/.output/modules/setting/members/member.validator.js +0 -1
  40. package/.output/modules/setting/organization/organization.types.js +86 -86
  41. package/.output/modules/setting/organization/organization.validator.js +68 -68
  42. package/.output/modules/setting/social/social.validator.js +15 -14
  43. package/.output/modules/store/clients/client.entity.js +60 -44
  44. package/.output/modules/store/clients/client.validator.js +53 -52
  45. package/.output/modules/store/orders/billing/billing.document.js +5 -7
  46. package/.output/modules/store/orders/billing/billing.entity.js +31 -33
  47. package/.output/modules/store/orders/billing/billing.validator.js +27 -28
  48. package/.output/modules/store/orders/item/item.document.js +5 -5
  49. package/.output/modules/store/orders/item/item.entity.js +41 -24
  50. package/.output/modules/store/orders/item/item.schema.js +2 -2
  51. package/.output/modules/store/orders/item/item.validator.js +16 -14
  52. package/.output/modules/store/orders/order.entity.d.ts +2 -1
  53. package/.output/modules/store/orders/order.entity.js +77 -55
  54. package/.output/modules/store/orders/order.validator.js +60 -57
  55. package/.output/modules/store/orders/payment/payment.entity.js +15 -13
  56. package/.output/modules/store/orders/payment/payment.schema.js +2 -2
  57. package/.output/modules/store/orders/shipping/shipping.document.js +5 -7
  58. package/.output/modules/store/orders/shipping/shipping.entity.js +31 -33
  59. package/.output/modules/store/orders/shipping/shipping.validator.js +27 -28
  60. package/.output/modules/store/orders/status/status.document.js +5 -5
  61. package/.output/modules/store/orders/status/status.entity.js +24 -24
  62. package/.output/modules/users/user.validator.js +37 -41
  63. package/.output/types.d.ts +2 -4
  64. package/package.json +11 -3
@@ -10,46 +10,48 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.UpdateCategoryValidator = exports.CreateCategoryValidator = void 0;
13
- const class_validator_1 = require("class-validator");
14
- class CreateCategoryValidator {
15
- name;
16
- description;
17
- icon = 'tag';
18
- }
19
- __decorate([
20
- (0, class_validator_1.IsString)(),
21
- (0, class_validator_1.Length)(5, 32),
22
- __metadata("design:type", String)
23
- ], CreateCategoryValidator.prototype, "name", void 0);
24
- __decorate([
25
- (0, class_validator_1.IsString)(),
26
- (0, class_validator_1.IsOptional)(),
27
- __metadata("design:type", String)
28
- ], CreateCategoryValidator.prototype, "description", void 0);
29
- __decorate([
30
- (0, class_validator_1.IsString)(),
31
- (0, class_validator_1.IsOptional)(),
32
- __metadata("design:type", Object)
33
- ], CreateCategoryValidator.prototype, "icon", void 0);
13
+ var class_validator_1 = require("class-validator");
14
+ var CreateCategoryValidator = (function () {
15
+ function CreateCategoryValidator() {
16
+ this.icon = 'tag';
17
+ }
18
+ __decorate([
19
+ (0, class_validator_1.IsString)(),
20
+ (0, class_validator_1.Length)(5, 32),
21
+ __metadata("design:type", String)
22
+ ], CreateCategoryValidator.prototype, "name", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.IsOptional)(),
26
+ __metadata("design:type", String)
27
+ ], CreateCategoryValidator.prototype, "description", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.IsOptional)(),
31
+ __metadata("design:type", Object)
32
+ ], CreateCategoryValidator.prototype, "icon", void 0);
33
+ return CreateCategoryValidator;
34
+ }());
34
35
  exports.CreateCategoryValidator = CreateCategoryValidator;
35
- class UpdateCategoryValidator {
36
- name;
37
- description;
38
- icon = 'tag';
39
- }
40
- __decorate([
41
- (0, class_validator_1.IsString)(),
42
- (0, class_validator_1.IsOptional)(),
43
- __metadata("design:type", String)
44
- ], UpdateCategoryValidator.prototype, "name", void 0);
45
- __decorate([
46
- (0, class_validator_1.IsString)(),
47
- (0, class_validator_1.IsOptional)(),
48
- __metadata("design:type", String)
49
- ], UpdateCategoryValidator.prototype, "description", void 0);
50
- __decorate([
51
- (0, class_validator_1.IsString)(),
52
- (0, class_validator_1.IsOptional)(),
53
- __metadata("design:type", Object)
54
- ], UpdateCategoryValidator.prototype, "icon", void 0);
36
+ var UpdateCategoryValidator = (function () {
37
+ function UpdateCategoryValidator() {
38
+ this.icon = 'tag';
39
+ }
40
+ __decorate([
41
+ (0, class_validator_1.IsString)(),
42
+ (0, class_validator_1.IsOptional)(),
43
+ __metadata("design:type", String)
44
+ ], UpdateCategoryValidator.prototype, "name", void 0);
45
+ __decorate([
46
+ (0, class_validator_1.IsString)(),
47
+ (0, class_validator_1.IsOptional)(),
48
+ __metadata("design:type", String)
49
+ ], UpdateCategoryValidator.prototype, "description", void 0);
50
+ __decorate([
51
+ (0, class_validator_1.IsString)(),
52
+ (0, class_validator_1.IsOptional)(),
53
+ __metadata("design:type", Object)
54
+ ], UpdateCategoryValidator.prototype, "icon", void 0);
55
+ return UpdateCategoryValidator;
56
+ }());
55
57
  exports.UpdateCategoryValidator = UpdateCategoryValidator;
@@ -0,0 +1,5 @@
1
+ export declare class CodeEntity extends Map {
2
+ sku: string;
3
+ gtin: string;
4
+ mpn: string;
5
+ }
@@ -0,0 +1,53 @@
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
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ 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;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.CodeEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
30
+ var mongoose_2 = require("mongoose");
31
+ var CodeEntity = (function (_super) {
32
+ __extends(CodeEntity, _super);
33
+ function CodeEntity() {
34
+ return _super !== null && _super.apply(this, arguments) || this;
35
+ }
36
+ __decorate([
37
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
38
+ __metadata("design:type", String)
39
+ ], CodeEntity.prototype, "sku", void 0);
40
+ __decorate([
41
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
42
+ __metadata("design:type", String)
43
+ ], CodeEntity.prototype, "gtin", void 0);
44
+ __decorate([
45
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
46
+ __metadata("design:type", String)
47
+ ], CodeEntity.prototype, "mpn", void 0);
48
+ CodeEntity = __decorate([
49
+ (0, schema_decorator_1.Schema)()
50
+ ], CodeEntity);
51
+ return CodeEntity;
52
+ }(Map));
53
+ exports.CodeEntity = CodeEntity;
@@ -0,0 +1,6 @@
1
+ export declare class DimensionEntity extends Map {
2
+ weight: number;
3
+ height: number;
4
+ width: number;
5
+ depth: number;
6
+ }
@@ -0,0 +1,57 @@
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
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ 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;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.DimensionEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
30
+ var mongoose_2 = require("mongoose");
31
+ var DimensionEntity = (function (_super) {
32
+ __extends(DimensionEntity, _super);
33
+ function DimensionEntity() {
34
+ return _super !== null && _super.apply(this, arguments) || this;
35
+ }
36
+ __decorate([
37
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
38
+ __metadata("design:type", Number)
39
+ ], DimensionEntity.prototype, "weight", void 0);
40
+ __decorate([
41
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
42
+ __metadata("design:type", Number)
43
+ ], DimensionEntity.prototype, "height", void 0);
44
+ __decorate([
45
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
46
+ __metadata("design:type", Number)
47
+ ], DimensionEntity.prototype, "width", void 0);
48
+ __decorate([
49
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
50
+ __metadata("design:type", Number)
51
+ ], DimensionEntity.prototype, "depth", void 0);
52
+ DimensionEntity = __decorate([
53
+ (0, schema_decorator_1.Schema)()
54
+ ], DimensionEntity);
55
+ return DimensionEntity;
56
+ }(Map));
57
+ exports.DimensionEntity = DimensionEntity;
@@ -0,0 +1,4 @@
1
+ export declare class PriceEntity extends Map {
2
+ sale: number;
3
+ purchase: number;
4
+ }
@@ -0,0 +1,49 @@
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
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ 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;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.PriceEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
30
+ var mongoose_2 = require("mongoose");
31
+ var PriceEntity = (function (_super) {
32
+ __extends(PriceEntity, _super);
33
+ function PriceEntity() {
34
+ return _super !== null && _super.apply(this, arguments) || this;
35
+ }
36
+ __decorate([
37
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, required: true }),
38
+ __metadata("design:type", Number)
39
+ ], PriceEntity.prototype, "sale", void 0);
40
+ __decorate([
41
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
42
+ __metadata("design:type", Number)
43
+ ], PriceEntity.prototype, "purchase", void 0);
44
+ PriceEntity = __decorate([
45
+ (0, schema_decorator_1.Schema)()
46
+ ], PriceEntity);
47
+ return PriceEntity;
48
+ }(Map));
49
+ exports.PriceEntity = PriceEntity;
@@ -0,0 +1,5 @@
1
+ export declare class SeoEntity extends Map {
2
+ title: string;
3
+ slug: string;
4
+ description: string;
5
+ }
@@ -0,0 +1,53 @@
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
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ 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;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.SeoEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
30
+ var mongoose_2 = require("mongoose");
31
+ var SeoEntity = (function (_super) {
32
+ __extends(SeoEntity, _super);
33
+ function SeoEntity() {
34
+ return _super !== null && _super.apply(this, arguments) || this;
35
+ }
36
+ __decorate([
37
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
38
+ __metadata("design:type", String)
39
+ ], SeoEntity.prototype, "title", void 0);
40
+ __decorate([
41
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
42
+ __metadata("design:type", String)
43
+ ], SeoEntity.prototype, "slug", void 0);
44
+ __decorate([
45
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
46
+ __metadata("design:type", String)
47
+ ], SeoEntity.prototype, "description", void 0);
48
+ SeoEntity = __decorate([
49
+ (0, schema_decorator_1.Schema)()
50
+ ], SeoEntity);
51
+ return SeoEntity;
52
+ }(Map));
53
+ exports.SeoEntity = SeoEntity;
@@ -1,13 +1,32 @@
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
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.ProductDocument = void 0;
4
- const abstract_document_1 = require("../../../abstract/abstract.document");
5
- class ProductDocument extends abstract_document_1.AbstractDocument {
6
- name = String();
7
- description = String();
8
- price = Number();
9
- brand;
10
- category;
11
- files = [];
12
- }
19
+ var abstract_document_1 = require("../../../abstract/abstract.document");
20
+ var ProductDocument = (function (_super) {
21
+ __extends(ProductDocument, _super);
22
+ function ProductDocument() {
23
+ var _this = _super !== null && _super.apply(this, arguments) || this;
24
+ _this.name = String();
25
+ _this.description = String();
26
+ _this.price = Number();
27
+ _this.files = [];
28
+ return _this;
29
+ }
30
+ return ProductDocument;
31
+ }(abstract_document_1.AbstractDocument));
13
32
  exports.ProductDocument = ProductDocument;
@@ -2,12 +2,21 @@ import { AbstractEntity } from '../../../abstract/abstract.entity';
2
2
  import { AssetEntity } from '../../assets/asset.entity';
3
3
  import { BrandEntity } from '../brands/brand.entity';
4
4
  import { CategoryEntity } from '../categories/category.entity';
5
+ import { CodeEntity } from './entities/code.entity';
6
+ import { DimensionEntity } from './entities/dimension.entity';
7
+ import { PriceEntity } from './entities/price.entity';
8
+ import { SeoEntity } from './entities/seo.entity';
5
9
  export declare class ProductEntity extends AbstractEntity {
6
10
  static readonly $index = "inventory_products";
7
11
  name: string;
12
+ active: boolean;
8
13
  description: string;
9
- price: number;
14
+ hashtags: string[];
10
15
  category?: CategoryEntity;
11
16
  brand?: BrandEntity;
12
17
  files: AssetEntity[];
18
+ price: PriceEntity;
19
+ code: CodeEntity;
20
+ dimension: DimensionEntity;
21
+ seo: SeoEntity;
13
22
  }
@@ -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,46 +25,73 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
25
  };
11
26
  Object.defineProperty(exports, "__esModule", { value: true });
12
27
  exports.ProductEntity = void 0;
13
- const mongoose_1 = require("@nestjs/mongoose");
14
- const mongoose_2 = require("mongoose");
15
- const abstract_entity_1 = require("../../../abstract/abstract.entity");
16
- const asset_entity_1 = require("../../assets/asset.entity");
17
- const brand_entity_1 = require("../brands/brand.entity");
18
- const category_entity_1 = require("../categories/category.entity");
19
- let ProductEntity = class ProductEntity extends abstract_entity_1.AbstractEntity {
20
- static $index = 'inventory_products';
21
- name;
22
- description;
23
- price = 0;
24
- category;
25
- brand;
26
- files = [];
27
- };
28
- __decorate([
29
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, length: 64 }),
30
- __metadata("design:type", String)
31
- ], ProductEntity.prototype, "name", void 0);
32
- __decorate([
33
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, nullable: true }),
34
- __metadata("design:type", String)
35
- ], ProductEntity.prototype, "description", void 0);
36
- __decorate([
37
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, default: 0 }),
38
- __metadata("design:type", Object)
39
- ], ProductEntity.prototype, "price", void 0);
40
- __decorate([
41
- (0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: category_entity_1.CategoryEntity.$index }),
42
- __metadata("design:type", category_entity_1.CategoryEntity)
43
- ], ProductEntity.prototype, "category", void 0);
44
- __decorate([
45
- (0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: brand_entity_1.BrandEntity.$index }),
46
- __metadata("design:type", brand_entity_1.BrandEntity)
47
- ], ProductEntity.prototype, "brand", void 0);
48
- __decorate([
49
- (0, mongoose_1.Prop)({ type: [{ type: mongoose_2.Types.ObjectId, ref: asset_entity_1.AssetEntity.$index }] }),
50
- __metadata("design:type", Array)
51
- ], ProductEntity.prototype, "files", void 0);
52
- ProductEntity = __decorate([
53
- (0, mongoose_1.Schema)({ timestamps: true })
54
- ], ProductEntity);
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var mongoose_2 = require("mongoose");
30
+ var abstract_entity_1 = require("../../../abstract/abstract.entity");
31
+ var asset_entity_1 = require("../../assets/asset.entity");
32
+ var brand_entity_1 = require("../brands/brand.entity");
33
+ var category_entity_1 = require("../categories/category.entity");
34
+ var code_entity_1 = require("./entities/code.entity");
35
+ var dimension_entity_1 = require("./entities/dimension.entity");
36
+ var price_entity_1 = require("./entities/price.entity");
37
+ var seo_entity_1 = require("./entities/seo.entity");
38
+ var ProductEntity = (function (_super) {
39
+ __extends(ProductEntity, _super);
40
+ function ProductEntity() {
41
+ var _this = _super !== null && _super.apply(this, arguments) || this;
42
+ _this.active = true;
43
+ _this.hashtags = [];
44
+ _this.files = [];
45
+ return _this;
46
+ }
47
+ ProductEntity.$index = 'inventory_products';
48
+ __decorate([
49
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, length: 64 }),
50
+ __metadata("design:type", String)
51
+ ], ProductEntity.prototype, "name", void 0);
52
+ __decorate([
53
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Boolean, default: true }),
54
+ __metadata("design:type", Object)
55
+ ], ProductEntity.prototype, "active", void 0);
56
+ __decorate([
57
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, nullable: true }),
58
+ __metadata("design:type", String)
59
+ ], ProductEntity.prototype, "description", void 0);
60
+ __decorate([
61
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Array, default: [] }),
62
+ __metadata("design:type", Array)
63
+ ], ProductEntity.prototype, "hashtags", void 0);
64
+ __decorate([
65
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: category_entity_1.CategoryEntity.$index }),
66
+ __metadata("design:type", category_entity_1.CategoryEntity)
67
+ ], ProductEntity.prototype, "category", void 0);
68
+ __decorate([
69
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: brand_entity_1.BrandEntity.$index }),
70
+ __metadata("design:type", brand_entity_1.BrandEntity)
71
+ ], ProductEntity.prototype, "brand", void 0);
72
+ __decorate([
73
+ (0, mongoose_1.Prop)({ type: [{ type: mongoose_2.Schema.Types.ObjectId, ref: asset_entity_1.AssetEntity.$index }] }),
74
+ __metadata("design:type", Array)
75
+ ], ProductEntity.prototype, "files", void 0);
76
+ __decorate([
77
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return price_entity_1.PriceEntity; }, default: new Map() }),
78
+ __metadata("design:type", price_entity_1.PriceEntity)
79
+ ], ProductEntity.prototype, "price", void 0);
80
+ __decorate([
81
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return code_entity_1.CodeEntity; }, default: new Map() }),
82
+ __metadata("design:type", code_entity_1.CodeEntity)
83
+ ], ProductEntity.prototype, "code", void 0);
84
+ __decorate([
85
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return dimension_entity_1.DimensionEntity; }, default: new Map() }),
86
+ __metadata("design:type", dimension_entity_1.DimensionEntity)
87
+ ], ProductEntity.prototype, "dimension", void 0);
88
+ __decorate([
89
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return seo_entity_1.SeoEntity; }, default: new Map() }),
90
+ __metadata("design:type", seo_entity_1.SeoEntity)
91
+ ], ProductEntity.prototype, "seo", void 0);
92
+ ProductEntity = __decorate([
93
+ (0, mongoose_1.Schema)({ timestamps: true })
94
+ ], ProductEntity);
95
+ return ProductEntity;
96
+ }(abstract_entity_1.AbstractEntity));
55
97
  exports.ProductEntity = ProductEntity;
@@ -1,17 +1,20 @@
1
- import { AssetEntity } from '../../assets/asset.entity';
1
+ import 'reflect-metadata';
2
+ import { ProductCodeValidator } from './validators/code.validator';
3
+ import { ProductDimensionValidator } from './validators/dimension.validator';
4
+ import { ProductPriceValidator } from './validators/price.validator';
5
+ import { ProductSeoValidator } from './validators/seo.validator';
2
6
  export declare class CreateProductValidator {
3
7
  name: string;
4
- description?: string;
5
- price: number;
8
+ description: string;
9
+ active: boolean;
6
10
  category?: string;
7
11
  brand?: string;
8
- files: AssetEntity[];
12
+ files: string[];
13
+ hashtags: string[];
14
+ price: ProductPriceValidator;
15
+ seo: ProductSeoValidator;
16
+ dimension: ProductDimensionValidator;
17
+ code: ProductCodeValidator;
9
18
  }
10
- export declare class UpdateProductValidator {
11
- name?: string;
12
- description?: string;
13
- price?: any;
14
- category?: string;
15
- brand?: string;
16
- files: any[];
19
+ export declare class UpdateProductValidator extends CreateProductValidator {
17
20
  }