@merkaly/api 0.2.2-9 → 0.2.2

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 (159) hide show
  1. package/.output/abstract/abstract.document.d.ts +10 -0
  2. package/.output/abstract/abstract.document.js +13 -0
  3. package/.output/{configs/app.entity.d.ts → abstract/abstract.entity.d.ts} +3 -3
  4. package/.output/abstract/abstract.entity.js +54 -0
  5. package/.output/abstract/abstract.fixture.d.ts +4 -0
  6. package/.output/abstract/abstract.fixture.js +11 -0
  7. package/.output/abstract/abstract.validator.d.ts +18 -0
  8. package/.output/abstract/abstract.validator.js +73 -0
  9. package/.output/modules/assets/asset.entity.d.ts +2 -2
  10. package/.output/modules/assets/asset.entity.js +59 -33
  11. package/.output/modules/content/banners/banner.document.d.ts +6 -0
  12. package/.output/modules/content/banners/banner.document.js +30 -0
  13. package/.output/modules/content/banners/banner.entity.d.ts +7 -0
  14. package/.output/modules/content/banners/banner.entity.js +54 -0
  15. package/.output/modules/content/banners/banner.fixture.d.ts +5 -0
  16. package/.output/modules/content/banners/banner.fixture.js +39 -0
  17. package/.output/modules/content/banners/banner.validator.d.ts +8 -0
  18. package/.output/modules/content/banners/banner.validator.js +63 -0
  19. package/.output/modules/content/pages/page.document.d.ts +10 -0
  20. package/.output/modules/content/pages/page.document.js +32 -0
  21. package/.output/modules/content/pages/page.entity.d.ts +11 -0
  22. package/.output/modules/content/pages/page.entity.js +69 -0
  23. package/.output/modules/content/pages/page.fixture.d.ts +5 -0
  24. package/.output/modules/content/pages/page.fixture.js +39 -0
  25. package/.output/modules/content/pages/page.types.d.ts +8 -0
  26. package/.output/modules/content/pages/page.types.js +13 -0
  27. package/.output/modules/content/pages/page.validator.d.ts +11 -0
  28. package/.output/modules/content/pages/page.validator.js +73 -0
  29. package/.output/modules/insight/validators/order.validator.d.ts +4 -0
  30. package/.output/modules/insight/validators/order.validator.js +27 -0
  31. package/.output/modules/inventory/brands/brand.document.d.ts +5 -0
  32. package/.output/modules/inventory/brands/brand.document.js +30 -0
  33. package/.output/modules/inventory/brands/brand.entity.d.ts +2 -2
  34. package/.output/modules/inventory/brands/brand.entity.js +40 -17
  35. package/.output/modules/inventory/brands/brand.validator.js +34 -25
  36. package/.output/modules/inventory/categories/category.document.d.ts +6 -0
  37. package/.output/modules/inventory/categories/category.document.js +31 -0
  38. package/.output/modules/inventory/categories/category.entity.d.ts +5 -2
  39. package/.output/modules/inventory/categories/category.entity.js +51 -17
  40. package/.output/modules/inventory/categories/category.fixture.d.ts +5 -0
  41. package/.output/modules/inventory/categories/category.fixture.js +38 -0
  42. package/.output/modules/inventory/categories/category.validator.d.ts +2 -0
  43. package/.output/modules/inventory/categories/category.validator.js +46 -25
  44. package/.output/modules/inventory/products/entities/code.entity.d.ts +5 -0
  45. package/.output/modules/inventory/products/entities/code.entity.js +53 -0
  46. package/.output/modules/inventory/products/entities/dimension.entity.d.ts +6 -0
  47. package/.output/modules/inventory/products/entities/dimension.entity.js +57 -0
  48. package/.output/modules/inventory/products/entities/price.entity.d.ts +4 -0
  49. package/.output/modules/inventory/products/entities/price.entity.js +49 -0
  50. package/.output/modules/inventory/products/entities/seo.entity.d.ts +5 -0
  51. package/.output/modules/inventory/products/entities/seo.entity.js +53 -0
  52. package/.output/modules/inventory/products/product.document.d.ts +24 -0
  53. package/.output/modules/inventory/products/product.document.js +33 -0
  54. package/.output/modules/inventory/products/product.entity.d.ts +13 -3
  55. package/.output/modules/inventory/products/product.entity.js +91 -36
  56. package/.output/modules/inventory/products/product.fixture.d.ts +5 -0
  57. package/.output/modules/inventory/products/product.fixture.js +54 -0
  58. package/.output/modules/inventory/products/product.validator.d.ts +15 -11
  59. package/.output/modules/inventory/products/product.validator.js +107 -65
  60. package/.output/modules/inventory/products/validators/code.validator.d.ts +5 -0
  61. package/.output/modules/inventory/products/validators/code.validator.js +37 -0
  62. package/.output/modules/inventory/products/validators/dimension.validator.d.ts +6 -0
  63. package/.output/modules/inventory/products/validators/dimension.validator.js +43 -0
  64. package/.output/modules/inventory/products/validators/price.validator.d.ts +4 -0
  65. package/.output/modules/inventory/products/validators/price.validator.js +30 -0
  66. package/.output/modules/inventory/products/validators/seo.validator.d.ts +5 -0
  67. package/.output/modules/inventory/products/validators/seo.validator.js +37 -0
  68. package/.output/modules/inventory/properties/property.entity.d.ts +7 -0
  69. package/.output/modules/inventory/properties/property.entity.js +55 -0
  70. package/.output/modules/inventory/properties/property.validator.d.ts +12 -0
  71. package/.output/modules/inventory/properties/property.validator.js +51 -0
  72. package/.output/modules/sales/clients/client.entity.d.ts +12 -0
  73. package/.output/modules/sales/clients/client.entity.js +73 -0
  74. package/.output/modules/sales/clients/client.validator.d.ts +12 -0
  75. package/.output/modules/sales/clients/client.validator.js +67 -0
  76. package/.output/modules/{store/orders/billing/billing.validator.d.ts → sales/orders/billing/billing.document.d.ts} +4 -4
  77. package/.output/modules/sales/orders/billing/billing.document.js +9 -0
  78. package/.output/modules/{store → sales}/orders/billing/billing.entity.d.ts +0 -0
  79. package/.output/modules/sales/orders/billing/billing.entity.js +44 -0
  80. package/.output/modules/sales/orders/billing/billing.validator.d.ts +7 -0
  81. package/.output/modules/sales/orders/billing/billing.validator.js +40 -0
  82. package/.output/modules/sales/orders/item/item.document.d.ts +6 -0
  83. package/.output/modules/sales/orders/item/item.document.js +9 -0
  84. package/.output/modules/sales/orders/item/item.entity.d.ts +7 -0
  85. package/.output/modules/sales/orders/item/item.entity.js +54 -0
  86. package/.output/modules/{store/orders/item/item.entity.d.ts → sales/orders/item/item.schema.d.ts} +3 -9
  87. package/.output/modules/sales/orders/item/item.schema.js +6 -0
  88. package/.output/modules/{store → sales}/orders/item/item.validator.d.ts +0 -0
  89. package/.output/modules/sales/orders/item/item.validator.js +29 -0
  90. package/.output/modules/sales/orders/order.entity.d.ts +19 -0
  91. package/.output/modules/sales/orders/order.entity.js +82 -0
  92. package/.output/modules/sales/orders/order.validator.d.ts +18 -0
  93. package/.output/modules/sales/orders/order.validator.js +75 -0
  94. package/.output/modules/sales/orders/payment/payment.entity.d.ts +4 -0
  95. package/.output/modules/sales/orders/payment/payment.entity.js +28 -0
  96. package/.output/modules/sales/orders/payment/payment.schema.d.ts +27 -0
  97. package/.output/modules/sales/orders/payment/payment.schema.js +6 -0
  98. package/.output/modules/sales/orders/payment/payment.validator.d.ts +6 -0
  99. package/.output/modules/sales/orders/payment/payment.validator.js +10 -0
  100. package/.output/modules/{store/orders/shipping/shipping.validator.d.ts → sales/orders/shipping/shipping.document.d.ts} +4 -4
  101. package/.output/modules/sales/orders/shipping/shipping.document.js +9 -0
  102. package/.output/modules/{store → sales}/orders/shipping/shipping.entity.d.ts +0 -0
  103. package/.output/modules/sales/orders/shipping/shipping.entity.js +44 -0
  104. package/.output/modules/sales/orders/shipping/shipping.validator.d.ts +7 -0
  105. package/.output/modules/sales/orders/shipping/shipping.validator.js +40 -0
  106. package/.output/modules/sales/orders/status/status.document.d.ts +5 -0
  107. package/.output/modules/sales/orders/status/status.document.js +9 -0
  108. package/.output/modules/sales/orders/status/status.entity.d.ts +6 -0
  109. package/.output/modules/sales/orders/status/status.entity.js +37 -0
  110. package/.output/modules/sales/orders/status/status.validator.d.ts +8 -0
  111. package/.output/modules/sales/orders/status/status.validator.js +12 -0
  112. package/.output/modules/search/search.validator.d.ts +6 -0
  113. package/.output/modules/search/search.validator.js +49 -0
  114. package/.output/modules/{auth → setting}/connections/connection.validator.d.ts +0 -1
  115. package/.output/modules/setting/connections/connection.validator.js +37 -0
  116. package/.output/modules/setting/layout/layout.document.d.ts +5 -0
  117. package/.output/modules/setting/layout/layout.document.js +29 -0
  118. package/.output/modules/setting/layout/layout.entity.d.ts +6 -0
  119. package/.output/modules/setting/layout/layout.entity.js +46 -0
  120. package/.output/modules/{auth → setting}/members/member.validator.d.ts +0 -1
  121. package/.output/modules/{auth → setting}/members/member.validator.js +0 -1
  122. package/.output/modules/setting/organization/organization.document.d.ts +15 -0
  123. package/.output/modules/setting/organization/organization.document.js +31 -0
  124. package/.output/modules/setting/organization/organization.entity.d.ts +4 -0
  125. package/.output/modules/setting/organization/organization.entity.js +28 -0
  126. package/.output/modules/setting/organization/organization.types.d.ts +22 -0
  127. package/.output/modules/setting/organization/organization.types.js +102 -0
  128. package/.output/modules/setting/organization/organization.validator.d.ts +17 -0
  129. package/.output/modules/setting/organization/organization.validator.js +83 -0
  130. package/.output/modules/setting/theme/theme.entity.d.ts +6 -0
  131. package/.output/modules/setting/theme/theme.entity.js +46 -0
  132. package/.output/modules/users/user.validator.d.ts +10 -0
  133. package/.output/modules/users/user.validator.js +50 -0
  134. package/.output/types.d.ts +23 -0
  135. package/.output/types.js +2 -0
  136. package/package.json +21 -9
  137. package/.output/configs/app.entity.js +0 -28
  138. package/.output/main.d.ts +0 -0
  139. package/.output/modules/auth/connections/connection.validator.js +0 -29
  140. package/.output/modules/auth/organizations/organization.validator.d.ts +0 -6
  141. package/.output/modules/auth/organizations/organization.validator.js +0 -27
  142. package/.output/modules/settings/payments/payment.entity.d.ts +0 -10
  143. package/.output/modules/settings/payments/payment.entity.js +0 -35
  144. package/.output/modules/store/cart/cart.entity.d.ts +0 -14
  145. package/.output/modules/store/cart/cart.entity.js +0 -39
  146. package/.output/modules/store/cart/cart.validator.d.ts +0 -13
  147. package/.output/modules/store/cart/cart.validator.js +0 -48
  148. package/.output/modules/store/orders/billing/billing.entity.js +0 -38
  149. package/.output/modules/store/orders/billing/billing.validator.js +0 -36
  150. package/.output/modules/store/orders/item/item.entity.js +0 -32
  151. package/.output/modules/store/orders/item/item.validator.js +0 -22
  152. package/.output/modules/store/orders/order.entity.d.ts +0 -15
  153. package/.output/modules/store/orders/order.entity.js +0 -47
  154. package/.output/modules/store/orders/order.validator.d.ts +0 -12
  155. package/.output/modules/store/orders/order.validator.js +0 -42
  156. package/.output/modules/store/orders/shipping/shipping.entity.js +0 -38
  157. package/.output/modules/store/orders/shipping/shipping.validator.js +0 -36
  158. package/.output/modules/store/orders/status/status.entity.d.ts +0 -13
  159. package/.output/modules/store/orders/status/status.entity.js +0 -39
@@ -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,5 @@
1
+ import { AbstractFixture } from '../../../abstract/abstract.fixture';
2
+ import { CreatePageValidator } from './page.validator';
3
+ export declare class PageFixture extends AbstractFixture {
4
+ normal(): CreatePageValidator;
5
+ }
@@ -0,0 +1,39 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.PageFixture = void 0;
19
+ var abstract_fixture_1 = require("../../../abstract/abstract.fixture");
20
+ var page_types_1 = require("./page.types");
21
+ var page_validator_1 = require("./page.validator");
22
+ var PageFixture = (function (_super) {
23
+ __extends(PageFixture, _super);
24
+ function PageFixture() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ PageFixture.prototype.normal = function () {
28
+ var page = new page_validator_1.CreatePageValidator();
29
+ page.title = this.$faker.random.words(6);
30
+ page.slug = this.$faker.helpers.slugify(page.title);
31
+ page.description = this.$faker.lorem.words(45);
32
+ page.image = this.$faker.image.image(850, 400, true);
33
+ page.content = this.$faker.lorem.paragraph(this.$faker.datatype.number({ min: 30, max: 60 }));
34
+ page.type = this.$faker.helpers.arrayElement(Object.values(page_types_1.PageTypes));
35
+ return page;
36
+ };
37
+ return PageFixture;
38
+ }(abstract_fixture_1.AbstractFixture));
39
+ exports.PageFixture = PageFixture;
@@ -0,0 +1,8 @@
1
+ export declare enum PageTypes {
2
+ PAGE = "PAGE",
3
+ POST = "POST"
4
+ }
5
+ export declare enum PageEvents {
6
+ VALIDATE = "database.content.pages.validate",
7
+ UPSERT_ES_DOCUMENT = "database.content.pages.upsert-es-document"
8
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageEvents = exports.PageTypes = void 0;
4
+ var PageTypes;
5
+ (function (PageTypes) {
6
+ PageTypes["PAGE"] = "PAGE";
7
+ PageTypes["POST"] = "POST";
8
+ })(PageTypes = exports.PageTypes || (exports.PageTypes = {}));
9
+ var PageEvents;
10
+ (function (PageEvents) {
11
+ PageEvents["VALIDATE"] = "database.content.pages.validate";
12
+ PageEvents["UPSERT_ES_DOCUMENT"] = "database.content.pages.upsert-es-document";
13
+ })(PageEvents = exports.PageEvents || (exports.PageEvents = {}));
@@ -0,0 +1,11 @@
1
+ import { PageTypes } from './page.types';
2
+ export declare class CreatePageValidator {
3
+ slug: string;
4
+ title: string;
5
+ description: string;
6
+ image: string;
7
+ type: PageTypes;
8
+ content: string;
9
+ }
10
+ export declare class UpdatePageValidator extends CreatePageValidator {
11
+ }
@@ -0,0 +1,73 @@
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.UpdatePageValidator = exports.CreatePageValidator = void 0;
28
+ var class_validator_1 = require("class-validator");
29
+ var page_types_1 = require("./page.types");
30
+ var CreatePageValidator = (function () {
31
+ function CreatePageValidator() {
32
+ this.description = null;
33
+ this.image = null;
34
+ this.type = page_types_1.PageTypes.PAGE;
35
+ }
36
+ __decorate([
37
+ (0, class_validator_1.IsString)(),
38
+ __metadata("design:type", String)
39
+ ], CreatePageValidator.prototype, "slug", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsString)(),
42
+ __metadata("design:type", String)
43
+ ], CreatePageValidator.prototype, "title", void 0);
44
+ __decorate([
45
+ (0, class_validator_1.IsString)(),
46
+ (0, class_validator_1.IsOptional)(),
47
+ __metadata("design:type", String)
48
+ ], CreatePageValidator.prototype, "description", void 0);
49
+ __decorate([
50
+ (0, class_validator_1.IsUrl)(),
51
+ (0, class_validator_1.IsOptional)(),
52
+ __metadata("design:type", String)
53
+ ], CreatePageValidator.prototype, "image", void 0);
54
+ __decorate([
55
+ (0, class_validator_1.IsString)(),
56
+ (0, class_validator_1.IsEnum)(page_types_1.PageTypes),
57
+ __metadata("design:type", Object)
58
+ ], CreatePageValidator.prototype, "type", void 0);
59
+ __decorate([
60
+ (0, class_validator_1.IsString)(),
61
+ __metadata("design:type", String)
62
+ ], CreatePageValidator.prototype, "content", void 0);
63
+ return CreatePageValidator;
64
+ }());
65
+ exports.CreatePageValidator = CreatePageValidator;
66
+ var UpdatePageValidator = (function (_super) {
67
+ __extends(UpdatePageValidator, _super);
68
+ function UpdatePageValidator() {
69
+ return _super !== null && _super.apply(this, arguments) || this;
70
+ }
71
+ return UpdatePageValidator;
72
+ }(CreatePageValidator));
73
+ exports.UpdatePageValidator = UpdatePageValidator;
@@ -0,0 +1,4 @@
1
+ export declare class SalesByRangeValdiator {
2
+ from: Date;
3
+ to: Date;
4
+ }
@@ -0,0 +1,27 @@
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.SalesByRangeValdiator = void 0;
13
+ var class_validator_1 = require("class-validator");
14
+ var SalesByRangeValdiator = (function () {
15
+ function SalesByRangeValdiator() {
16
+ }
17
+ __decorate([
18
+ (0, class_validator_1.IsDateString)(),
19
+ __metadata("design:type", Date)
20
+ ], SalesByRangeValdiator.prototype, "from", void 0);
21
+ __decorate([
22
+ (0, class_validator_1.IsDateString)(),
23
+ __metadata("design:type", Date)
24
+ ], SalesByRangeValdiator.prototype, "to", void 0);
25
+ return SalesByRangeValdiator;
26
+ }());
27
+ exports.SalesByRangeValdiator = SalesByRangeValdiator;
@@ -0,0 +1,5 @@
1
+ import { AbstractDocument } from '../../../abstract/abstract.document';
2
+ export declare class BrandDocument extends AbstractDocument {
3
+ name: string;
4
+ description: string;
5
+ }
@@ -0,0 +1,30 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.BrandDocument = void 0;
19
+ var abstract_document_1 = require("../../../abstract/abstract.document");
20
+ var BrandDocument = (function (_super) {
21
+ __extends(BrandDocument, _super);
22
+ function BrandDocument() {
23
+ var _this = _super !== null && _super.apply(this, arguments) || this;
24
+ _this.name = String();
25
+ _this.description = String();
26
+ return _this;
27
+ }
28
+ return BrandDocument;
29
+ }(abstract_document_1.AbstractDocument));
30
+ exports.BrandDocument = BrandDocument;
@@ -1,5 +1,5 @@
1
- import { AppEntity } from '../../../configs/app.entity';
2
- export declare class BrandEntity extends AppEntity {
1
+ import { AbstractEntity } from '../../../abstract/abstract.entity';
2
+ export declare class BrandEntity extends AbstractEntity {
3
3
  static readonly $index = "inventory_brands";
4
4
  name: string;
5
5
  description: string;
@@ -1,27 +1,50 @@
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);
5
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;
6
21
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
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
+ };
8
26
  Object.defineProperty(exports, "__esModule", { value: true });
9
27
  exports.BrandEntity = void 0;
10
- const mongoose_1 = require("@nestjs/mongoose");
11
- const mongoose_2 = require("mongoose");
12
- const app_entity_1 = require("../../../configs/app.entity");
13
- let BrandEntity = class BrandEntity extends app_entity_1.AppEntity {
14
- static $index = 'inventory_brands';
15
- name;
16
- description;
17
- };
18
- __decorate([
19
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true, length: 32 })
20
- ], BrandEntity.prototype, "name", void 0);
21
- __decorate([
22
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String })
23
- ], BrandEntity.prototype, "description", void 0);
24
- BrandEntity = __decorate([
25
- (0, mongoose_1.Schema)({ timestamps: true })
26
- ], BrandEntity);
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));
27
50
  exports.BrandEntity = BrandEntity;
@@ -5,32 +5,41 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
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
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
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
+ };
8
11
  Object.defineProperty(exports, "__esModule", { value: true });
9
12
  exports.UpdateBrandValidator = exports.CreateBrandValidator = void 0;
10
- const class_validator_1 = require("class-validator");
11
- class CreateBrandValidator {
12
- name;
13
- description;
14
- }
15
- __decorate([
16
- (0, class_validator_1.IsString)(),
17
- (0, class_validator_1.Length)(2, 32)
18
- ], CreateBrandValidator.prototype, "name", void 0);
19
- __decorate([
20
- (0, class_validator_1.IsString)(),
21
- (0, class_validator_1.IsOptional)()
22
- ], CreateBrandValidator.prototype, "description", void 0);
13
+ var class_validator_1 = require("class-validator");
14
+ var CreateBrandValidator = (function () {
15
+ function CreateBrandValidator() {
16
+ }
17
+ __decorate([
18
+ (0, class_validator_1.IsString)(),
19
+ (0, class_validator_1.Length)(2, 32),
20
+ __metadata("design:type", String)
21
+ ], CreateBrandValidator.prototype, "name", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsString)(),
24
+ (0, class_validator_1.IsOptional)(),
25
+ __metadata("design:type", String)
26
+ ], CreateBrandValidator.prototype, "description", void 0);
27
+ return CreateBrandValidator;
28
+ }());
23
29
  exports.CreateBrandValidator = CreateBrandValidator;
24
- class UpdateBrandValidator {
25
- name;
26
- description;
27
- }
28
- __decorate([
29
- (0, class_validator_1.IsString)(),
30
- (0, class_validator_1.IsOptional)()
31
- ], UpdateBrandValidator.prototype, "name", void 0);
32
- __decorate([
33
- (0, class_validator_1.IsString)(),
34
- (0, class_validator_1.IsOptional)()
35
- ], UpdateBrandValidator.prototype, "description", void 0);
30
+ var UpdateBrandValidator = (function () {
31
+ function UpdateBrandValidator() {
32
+ }
33
+ __decorate([
34
+ (0, class_validator_1.IsString)(),
35
+ (0, class_validator_1.IsOptional)(),
36
+ __metadata("design:type", String)
37
+ ], UpdateBrandValidator.prototype, "name", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsString)(),
40
+ (0, class_validator_1.IsOptional)(),
41
+ __metadata("design:type", String)
42
+ ], UpdateBrandValidator.prototype, "description", void 0);
43
+ return UpdateBrandValidator;
44
+ }());
36
45
  exports.UpdateBrandValidator = UpdateBrandValidator;
@@ -0,0 +1,6 @@
1
+ import { AbstractDocument } from '../../../abstract/abstract.document';
2
+ export declare class CategoryDocument extends AbstractDocument {
3
+ name: string;
4
+ description: string;
5
+ icon: string;
6
+ }
@@ -0,0 +1,31 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CategoryDocument = void 0;
19
+ var abstract_document_1 = require("../../../abstract/abstract.document");
20
+ var CategoryDocument = (function (_super) {
21
+ __extends(CategoryDocument, _super);
22
+ function CategoryDocument() {
23
+ var _this = _super !== null && _super.apply(this, arguments) || this;
24
+ _this.name = String();
25
+ _this.description = String();
26
+ _this.icon = String();
27
+ return _this;
28
+ }
29
+ return CategoryDocument;
30
+ }(abstract_document_1.AbstractDocument));
31
+ exports.CategoryDocument = CategoryDocument;
@@ -1,6 +1,9 @@
1
- import { AppEntity } from '../../../configs/app.entity';
2
- export declare class CategoryEntity extends AppEntity {
1
+ import { AbstractEntity } from '../../../abstract/abstract.entity';
2
+ import { PropertyEntity } from '../properties/property.entity';
3
+ export declare class CategoryEntity extends AbstractEntity {
3
4
  static readonly $index = "inventory_categories";
4
5
  name: string;
5
6
  description: string;
7
+ icon: string;
8
+ properties: PropertyEntity[];
6
9
  }
@@ -1,27 +1,61 @@
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);
5
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;
6
21
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
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
+ };
8
26
  Object.defineProperty(exports, "__esModule", { value: true });
9
27
  exports.CategoryEntity = void 0;
10
- const mongoose_1 = require("@nestjs/mongoose");
11
- const mongoose_2 = require("mongoose");
12
- const app_entity_1 = require("../../../configs/app.entity");
13
- let CategoryEntity = class CategoryEntity extends app_entity_1.AppEntity {
14
- static $index = 'inventory_categories';
15
- name;
16
- description;
17
- };
18
- __decorate([
19
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, length: 32, unique: true, required: true })
20
- ], CategoryEntity.prototype, "name", void 0);
21
- __decorate([
22
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String })
23
- ], CategoryEntity.prototype, "description", void 0);
24
- CategoryEntity = __decorate([
25
- (0, mongoose_1.Schema)({ timestamps: true })
26
- ], CategoryEntity);
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));
27
61
  exports.CategoryEntity = CategoryEntity;
@@ -0,0 +1,5 @@
1
+ import { AbstractFixture } from '../../../abstract/abstract.fixture';
2
+ import { CategoryDocument } from './category.document';
3
+ export declare class CategoryFixture extends AbstractFixture {
4
+ normal(): CategoryDocument;
5
+ }
@@ -0,0 +1,38 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CategoryFixture = void 0;
19
+ var abstract_fixture_1 = require("../../../abstract/abstract.fixture");
20
+ var category_document_1 = require("./category.document");
21
+ var CategoryFixture = (function (_super) {
22
+ __extends(CategoryFixture, _super);
23
+ function CategoryFixture() {
24
+ return _super !== null && _super.apply(this, arguments) || this;
25
+ }
26
+ CategoryFixture.prototype.normal = function () {
27
+ var category = new category_document_1.CategoryDocument({
28
+ _id: this.$faker.datatype.uuid(),
29
+ createdAt: this.$faker.date.past(1),
30
+ updatedAt: this.$faker.date.past(1),
31
+ });
32
+ category.name = this.$faker.vehicle.manufacturer();
33
+ category.description = this.$faker.lorem.sentence();
34
+ return category;
35
+ };
36
+ return CategoryFixture;
37
+ }(abstract_fixture_1.AbstractFixture));
38
+ exports.CategoryFixture = CategoryFixture;
@@ -1,8 +1,10 @@
1
1
  export declare class CreateCategoryValidator {
2
2
  name: string;
3
3
  description?: string;
4
+ icon: string;
4
5
  }
5
6
  export declare class UpdateCategoryValidator {
6
7
  name: string;
7
8
  description?: string;
9
+ icon: string;
8
10
  }