@merkaly/api 0.2.3-4 → 0.2.4-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/.output/abstract/abstract.entity.d.ts +2 -1
  2. package/.output/abstract/abstract.entity.js +53 -0
  3. package/.output/abstract/abstract.validator.d.ts +7 -8
  4. package/.output/abstract/abstract.validator.js +6 -0
  5. package/.output/modules/assets/asset.entity.js +69 -0
  6. package/.output/modules/content/banners/banner.entity.js +54 -0
  7. package/.output/modules/content/banners/banner.fixture.d.ts +2 -2
  8. package/.output/modules/content/banners/banner.fixture.js +2 -2
  9. package/.output/modules/content/pages/page.entity.js +69 -0
  10. package/.output/modules/inventory/brands/brand.entity.js +50 -0
  11. package/.output/modules/inventory/categories/category.entity.js +61 -0
  12. package/.output/modules/inventory/categories/category.fixture.d.ts +2 -2
  13. package/.output/modules/inventory/categories/category.fixture.js +2 -2
  14. package/.output/modules/inventory/products/entities/code.entity.js +53 -0
  15. package/.output/modules/inventory/products/entities/dimension.entity.js +57 -0
  16. package/.output/modules/inventory/products/entities/price.entity.js +49 -0
  17. package/.output/modules/inventory/products/entities/seo.entity.js +53 -0
  18. package/.output/modules/inventory/products/product.entity.js +101 -0
  19. package/.output/modules/inventory/products/product.fixture.d.ts +2 -2
  20. package/.output/modules/inventory/products/product.fixture.js +3 -18
  21. package/.output/modules/inventory/properties/property.entity.js +55 -0
  22. package/.output/modules/sales/clients/client.entity.js +64 -0
  23. package/.output/modules/sales/orders/address/address.entity.d.ts +4 -3
  24. package/.output/modules/sales/orders/address/address.entity.js +68 -0
  25. package/.output/modules/sales/orders/address/address.validator.d.ts +3 -2
  26. package/.output/modules/sales/orders/address/address.validator.js +19 -7
  27. package/.output/modules/sales/orders/billing/billing.entity.d.ts +5 -4
  28. package/.output/modules/{search/search.validator.js → sales/orders/billing/billing.entity.js} +25 -34
  29. package/.output/modules/sales/orders/billing/billing.validator.d.ts +1 -1
  30. package/.output/modules/sales/orders/billing/billing.validator.js +4 -2
  31. package/.output/modules/sales/orders/customer/customer.entity.d.ts +1 -1
  32. package/.output/modules/sales/orders/customer/customer.entity.js +52 -0
  33. package/.output/modules/sales/orders/customer/customer.validator.js +5 -2
  34. package/.output/modules/sales/orders/item/item.entity.d.ts +1 -0
  35. package/.output/modules/sales/orders/item/item.entity.js +58 -0
  36. package/.output/modules/sales/orders/order.entity.d.ts +7 -8
  37. package/.output/modules/sales/orders/order.entity.js +89 -0
  38. package/.output/modules/sales/orders/order.validator.d.ts +2 -1
  39. package/.output/modules/sales/orders/order.validator.js +13 -7
  40. package/.output/modules/sales/orders/shipping/shipping.entity.d.ts +7 -4
  41. package/.output/modules/sales/orders/shipping/shipping.entity.js +63 -0
  42. package/.output/modules/sales/orders/shipping/shipping.validator.d.ts +1 -1
  43. package/.output/modules/sales/orders/shipping/shipping.validator.js +4 -2
  44. package/.output/modules/sales/orders/status/status.entity.js +37 -0
  45. package/.output/modules/setting/layout/layout.entity.js +46 -0
  46. package/.output/modules/setting/organization/organization.entity.d.ts +11 -0
  47. package/.output/modules/setting/{layout/layout.document.js → organization/organization.entity.js} +10 -11
  48. package/.output/modules/setting/organization/organization.types.d.ts +4 -3
  49. package/.output/modules/setting/organization/organization.types.js +7 -2
  50. package/.output/modules/setting/theme/theme.entity.js +46 -0
  51. package/.output/modules/users/user.validator.d.ts +3 -3
  52. package/.output/modules/users/user.validator.js +6 -6
  53. package/.output/types.d.ts +5 -13
  54. package/package.json +2 -4
  55. package/.output/abstract/abstract.document.d.ts +0 -10
  56. package/.output/abstract/abstract.document.js +0 -13
  57. package/.output/modules/content/banners/banner.document.d.ts +0 -6
  58. package/.output/modules/content/banners/banner.document.js +0 -30
  59. package/.output/modules/content/pages/page.document.d.ts +0 -10
  60. package/.output/modules/content/pages/page.document.js +0 -32
  61. package/.output/modules/inventory/brands/brand.document.d.ts +0 -5
  62. package/.output/modules/inventory/brands/brand.document.js +0 -30
  63. package/.output/modules/inventory/categories/category.document.d.ts +0 -6
  64. package/.output/modules/inventory/categories/category.document.js +0 -31
  65. package/.output/modules/inventory/products/product.document.d.ts +0 -25
  66. package/.output/modules/inventory/products/product.document.js +0 -34
  67. package/.output/modules/sales/clients/client.document.d.ts +0 -9
  68. package/.output/modules/sales/clients/client.document.js +0 -33
  69. package/.output/modules/sales/orders/billing/billing.document.d.ts +0 -7
  70. package/.output/modules/sales/orders/billing/billing.document.js +0 -9
  71. package/.output/modules/sales/orders/item/item.document.d.ts +0 -6
  72. package/.output/modules/sales/orders/item/item.document.js +0 -9
  73. package/.output/modules/sales/orders/payment/payment.entity.d.ts +0 -4
  74. package/.output/modules/sales/orders/payment/payment.validator.d.ts +0 -6
  75. package/.output/modules/sales/orders/payment/payment.validator.js +0 -10
  76. package/.output/modules/sales/orders/shipping/shipping.document.d.ts +0 -7
  77. package/.output/modules/sales/orders/shipping/shipping.document.js +0 -9
  78. package/.output/modules/sales/orders/status/status.document.d.ts +0 -5
  79. package/.output/modules/sales/orders/status/status.document.js +0 -9
  80. package/.output/modules/search/search.validator.d.ts +0 -7
  81. package/.output/modules/setting/layout/layout.document.d.ts +0 -5
  82. package/.output/modules/setting/organization/organization.document.d.ts +0 -15
  83. package/.output/modules/setting/organization/organization.document.js +0 -31
@@ -1,7 +1,8 @@
1
1
  import { Document } from 'mongoose';
2
- export declare abstract class AbstractEntity extends Document {
2
+ export declare abstract class AbstractEntity {
3
3
  static $index: string;
4
4
  readonly _id: string;
5
+ id: string;
5
6
  readonly createdAt: Date;
6
7
  readonly updatedAt?: Date;
7
8
  readonly deletedAt?: Date;
@@ -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.AbstractEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var mongoose_2 = require("mongoose");
30
+ var AbstractEntity = (function (_super) {
31
+ __extends(AbstractEntity, _super);
32
+ function AbstractEntity() {
33
+ var _this = _super !== null && _super.apply(this, arguments) || this;
34
+ _this._id = String();
35
+ _this.updatedAt = null;
36
+ _this.deletedAt = null;
37
+ return _this;
38
+ }
39
+ __decorate([
40
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
41
+ __metadata("design:type", Date)
42
+ ], AbstractEntity.prototype, "createdAt", void 0);
43
+ __decorate([
44
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
45
+ __metadata("design:type", Date)
46
+ ], AbstractEntity.prototype, "updatedAt", void 0);
47
+ __decorate([
48
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date, default: null }),
49
+ __metadata("design:type", Date)
50
+ ], AbstractEntity.prototype, "deletedAt", void 0);
51
+ return AbstractEntity;
52
+ }(mongoose_2.Document));
53
+ exports.AbstractEntity = AbstractEntity;
@@ -1,4 +1,4 @@
1
- import { PopulateOptions, QuerySelector, SortOrder } from 'mongoose';
1
+ import { FilterQuery, PopulateOptions, SortOrder } from 'mongoose';
2
2
  import { AbstractEntity } from './abstract.entity';
3
3
  import 'reflect-metadata';
4
4
  export interface SearchResults<I> {
@@ -8,14 +8,13 @@ export interface SearchResults<I> {
8
8
  }
9
9
  export declare abstract class AbstractValidator {
10
10
  }
11
+ export declare type KeyOfType<T, V> = keyof {
12
+ [P in keyof T as T[P] extends V ? P : never]: any;
13
+ };
11
14
  export declare class FindValidator<E extends AbstractEntity> extends AbstractValidator {
12
15
  limit?: number;
13
16
  page?: number;
14
- sort?: {
15
- [x: string]: SortOrder;
16
- };
17
- filters?: {
18
- [x: string]: string | QuerySelector<any>;
19
- };
20
- join?: (keyof E | string | PopulateOptions)[];
17
+ sort?: Partial<Record<keyof E, SortOrder>>;
18
+ filters?: FilterQuery<E>;
19
+ join?: KeyOfType<E, AbstractEntity | AbstractEntity[]>[] | PopulateOptions[];
21
20
  }
@@ -65,6 +65,9 @@ var FindValidator = (function (_super) {
65
65
  __decorate([
66
66
  (0, class_transformer_1.Transform)(function (_a) {
67
67
  var value = _a.value;
68
+ if ((0, class_validator_1.isObject)(value)) {
69
+ return value;
70
+ }
68
71
  return value && JSON.parse(value);
69
72
  }),
70
73
  (0, class_validator_1.IsOptional)(),
@@ -73,6 +76,9 @@ var FindValidator = (function (_super) {
73
76
  __decorate([
74
77
  (0, class_transformer_1.Transform)(function (_a) {
75
78
  var value = _a.value;
79
+ if ((0, class_validator_1.isObject)(value)) {
80
+ return value;
81
+ }
76
82
  return value && JSON.parse(value);
77
83
  }),
78
84
  (0, class_validator_1.IsOptional)(),
@@ -0,0 +1,69 @@
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.AssetEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var mongoose_2 = require("mongoose");
30
+ var abstract_entity_1 = require("../../abstract/abstract.entity");
31
+ var AssetEntity = (function (_super) {
32
+ __extends(AssetEntity, _super);
33
+ function AssetEntity() {
34
+ var _this = _super !== null && _super.apply(this, arguments) || this;
35
+ _this.weak = true;
36
+ _this.size = 0;
37
+ return _this;
38
+ }
39
+ AssetEntity.$index = 'assets';
40
+ __decorate([
41
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true }),
42
+ __metadata("design:type", String)
43
+ ], AssetEntity.prototype, "name", void 0);
44
+ __decorate([
45
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
46
+ __metadata("design:type", String)
47
+ ], AssetEntity.prototype, "url", void 0);
48
+ __decorate([
49
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Boolean, default: true }),
50
+ __metadata("design:type", Object)
51
+ ], AssetEntity.prototype, "weak", void 0);
52
+ __decorate([
53
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, nullable: true }),
54
+ __metadata("design:type", String)
55
+ ], AssetEntity.prototype, "description", void 0);
56
+ __decorate([
57
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
58
+ __metadata("design:type", String)
59
+ ], AssetEntity.prototype, "type", void 0);
60
+ __decorate([
61
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, required: true, default: 0 }),
62
+ __metadata("design:type", Object)
63
+ ], AssetEntity.prototype, "size", void 0);
64
+ AssetEntity = __decorate([
65
+ (0, mongoose_1.Schema)({ timestamps: true })
66
+ ], AssetEntity);
67
+ return AssetEntity;
68
+ }(abstract_entity_1.AbstractEntity));
69
+ exports.AssetEntity = AssetEntity;
@@ -0,0 +1,54 @@
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.BannerEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var mongoose_2 = require("mongoose");
30
+ var abstract_entity_1 = require("../../../abstract/abstract.entity");
31
+ var BannerEntity = (function (_super) {
32
+ __extends(BannerEntity, _super);
33
+ function BannerEntity() {
34
+ return _super !== null && _super.apply(this, arguments) || this;
35
+ }
36
+ BannerEntity.$index = 'content_banners';
37
+ __decorate([
38
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
39
+ __metadata("design:type", String)
40
+ ], BannerEntity.prototype, "name", void 0);
41
+ __decorate([
42
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
43
+ __metadata("design:type", String)
44
+ ], BannerEntity.prototype, "image", void 0);
45
+ __decorate([
46
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: '#' }),
47
+ __metadata("design:type", String)
48
+ ], BannerEntity.prototype, "href", void 0);
49
+ BannerEntity = __decorate([
50
+ (0, mongoose_1.Schema)({ timestamps: true })
51
+ ], BannerEntity);
52
+ return BannerEntity;
53
+ }(abstract_entity_1.AbstractEntity));
54
+ exports.BannerEntity = BannerEntity;
@@ -1,5 +1,5 @@
1
1
  import { AbstractFixture } from '../../../abstract/abstract.fixture';
2
- import { BannerDocument } from './banner.document';
2
+ import { BannerEntity } from "./banner.entity";
3
3
  export declare class BannerFixture extends AbstractFixture {
4
- normal(): BannerDocument;
4
+ normal(): BannerEntity;
5
5
  }
@@ -18,14 +18,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.BannerFixture = void 0;
19
19
  var faker_1 = require("@faker-js/faker");
20
20
  var abstract_fixture_1 = require("../../../abstract/abstract.fixture");
21
- var banner_document_1 = require("./banner.document");
21
+ var banner_entity_1 = require("./banner.entity");
22
22
  var BannerFixture = (function (_super) {
23
23
  __extends(BannerFixture, _super);
24
24
  function BannerFixture() {
25
25
  return _super !== null && _super.apply(this, arguments) || this;
26
26
  }
27
27
  BannerFixture.prototype.normal = function () {
28
- var banner = new banner_document_1.BannerDocument({
28
+ var banner = new banner_entity_1.BannerEntity({
29
29
  _id: this.$faker.datatype.uuid(),
30
30
  createdAt: this.$faker.date.past(1),
31
31
  updatedAt: this.$faker.date.past(1),
@@ -0,0 +1,69 @@
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.PageEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var mongoose_2 = require("mongoose");
30
+ var abstract_entity_1 = require("../../../abstract/abstract.entity");
31
+ var page_types_1 = require("./page.types");
32
+ var PageEntity = (function (_super) {
33
+ __extends(PageEntity, _super);
34
+ function PageEntity() {
35
+ var _this = _super !== null && _super.apply(this, arguments) || this;
36
+ _this.type = page_types_1.PageTypes.PAGE;
37
+ return _this;
38
+ }
39
+ PageEntity.$index = 'content_pages';
40
+ __decorate([
41
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true, length: 128 }),
42
+ __metadata("design:type", String)
43
+ ], PageEntity.prototype, "slug", void 0);
44
+ __decorate([
45
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
46
+ __metadata("design:type", String)
47
+ ], PageEntity.prototype, "title", void 0);
48
+ __decorate([
49
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
50
+ __metadata("design:type", String)
51
+ ], PageEntity.prototype, "description", void 0);
52
+ __decorate([
53
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
54
+ __metadata("design:type", String)
55
+ ], PageEntity.prototype, "image", void 0);
56
+ __decorate([
57
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, enum: page_types_1.PageTypes, required: true, default: page_types_1.PageTypes.PAGE }),
58
+ __metadata("design:type", Object)
59
+ ], PageEntity.prototype, "type", void 0);
60
+ __decorate([
61
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
62
+ __metadata("design:type", String)
63
+ ], PageEntity.prototype, "content", void 0);
64
+ PageEntity = __decorate([
65
+ (0, mongoose_1.Schema)({ timestamps: true })
66
+ ], PageEntity);
67
+ return PageEntity;
68
+ }(abstract_entity_1.AbstractEntity));
69
+ exports.PageEntity = PageEntity;
@@ -0,0 +1,50 @@
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.BrandEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var mongoose_2 = require("mongoose");
30
+ var abstract_entity_1 = require("../../../abstract/abstract.entity");
31
+ var BrandEntity = (function (_super) {
32
+ __extends(BrandEntity, _super);
33
+ function BrandEntity() {
34
+ return _super !== null && _super.apply(this, arguments) || this;
35
+ }
36
+ BrandEntity.$index = 'inventory_brands';
37
+ __decorate([
38
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true, length: 32 }),
39
+ __metadata("design:type", String)
40
+ ], BrandEntity.prototype, "name", void 0);
41
+ __decorate([
42
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
43
+ __metadata("design:type", String)
44
+ ], BrandEntity.prototype, "description", void 0);
45
+ BrandEntity = __decorate([
46
+ (0, mongoose_1.Schema)({ timestamps: true })
47
+ ], BrandEntity);
48
+ return BrandEntity;
49
+ }(abstract_entity_1.AbstractEntity));
50
+ exports.BrandEntity = BrandEntity;
@@ -0,0 +1,61 @@
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.CategoryEntity = void 0;
28
+ var mongoose_1 = require("@nestjs/mongoose");
29
+ var mongoose_2 = require("mongoose");
30
+ var abstract_entity_1 = require("../../../abstract/abstract.entity");
31
+ var property_entity_1 = require("../properties/property.entity");
32
+ var CategoryEntity = (function (_super) {
33
+ __extends(CategoryEntity, _super);
34
+ function CategoryEntity() {
35
+ var _this = _super !== null && _super.apply(this, arguments) || this;
36
+ _this.properties = [];
37
+ return _this;
38
+ }
39
+ CategoryEntity.$index = 'inventory_categories';
40
+ __decorate([
41
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, length: 32, unique: true, required: true }),
42
+ __metadata("design:type", String)
43
+ ], CategoryEntity.prototype, "name", void 0);
44
+ __decorate([
45
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
46
+ __metadata("design:type", String)
47
+ ], CategoryEntity.prototype, "description", void 0);
48
+ __decorate([
49
+ (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, length: 32, default: 'tag' }),
50
+ __metadata("design:type", String)
51
+ ], CategoryEntity.prototype, "icon", void 0);
52
+ __decorate([
53
+ (0, mongoose_1.Prop)({ type: [{ type: mongoose_2.Types.ObjectId, ref: property_entity_1.PropertyEntity.$index }] }),
54
+ __metadata("design:type", Array)
55
+ ], CategoryEntity.prototype, "properties", void 0);
56
+ CategoryEntity = __decorate([
57
+ (0, mongoose_1.Schema)({ timestamps: true })
58
+ ], CategoryEntity);
59
+ return CategoryEntity;
60
+ }(abstract_entity_1.AbstractEntity));
61
+ exports.CategoryEntity = CategoryEntity;
@@ -1,5 +1,5 @@
1
1
  import { AbstractFixture } from '../../../abstract/abstract.fixture';
2
- import { CategoryDocument } from './category.document';
2
+ import { CategoryEntity } from "./category.entity";
3
3
  export declare class CategoryFixture extends AbstractFixture {
4
- normal(): CategoryDocument;
4
+ normal(): CategoryEntity;
5
5
  }
@@ -17,14 +17,14 @@ var __extends = (this && this.__extends) || (function () {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.CategoryFixture = void 0;
19
19
  var abstract_fixture_1 = require("../../../abstract/abstract.fixture");
20
- var category_document_1 = require("./category.document");
20
+ var category_entity_1 = require("./category.entity");
21
21
  var CategoryFixture = (function (_super) {
22
22
  __extends(CategoryFixture, _super);
23
23
  function CategoryFixture() {
24
24
  return _super !== null && _super.apply(this, arguments) || this;
25
25
  }
26
26
  CategoryFixture.prototype.normal = function () {
27
- var category = new category_document_1.CategoryDocument({
27
+ var category = new category_entity_1.CategoryEntity({
28
28
  _id: this.$faker.datatype.uuid(),
29
29
  createdAt: this.$faker.date.past(1),
30
30
  updatedAt: this.$faker.date.past(1),
@@ -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,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,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;