@merkaly/api 0.2.4-1 → 0.2.4-11

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 (77) hide show
  1. package/.output/abstract/abstract.entity.d.ts +1 -1
  2. package/.output/abstract/abstract.exception.d.ts +11 -0
  3. package/.output/abstract/abstract.exception.js +53 -0
  4. package/.output/abstract/abstract.validator.d.ts +1 -1
  5. package/.output/abstract/abstract.validator.js +1 -0
  6. package/.output/exceptions/missing-identity.exception.d.ts +5 -0
  7. package/.output/{modules/setting/organization/organization.entity.js → exceptions/missing-identity.exception.js} +12 -10
  8. package/.output/exceptions/store-not-implemented.exception.d.ts +5 -0
  9. package/.output/exceptions/store-not-implemented.exception.js +31 -0
  10. package/.output/exceptions/store-not-recognized.exception.d.ts +5 -0
  11. package/.output/exceptions/store-not-recognized.exception.js +30 -0
  12. package/.output/modules/inventory/brands/brand.exception.d.ts +5 -0
  13. package/.output/modules/{setting/theme/theme.entity.js → inventory/brands/brand.exception.js} +15 -21
  14. package/.output/modules/inventory/categories/category.exception.d.ts +5 -0
  15. package/.output/modules/{setting/layout/layout.entity.js → inventory/categories/category.exception.js} +15 -21
  16. package/.output/modules/inventory/products/product.entity.d.ts +1 -0
  17. package/.output/modules/inventory/products/product.exception.d.ts +5 -0
  18. package/.output/modules/inventory/products/{entities/price.entity.js → product.exception.js} +15 -24
  19. package/.output/modules/inventory/products/product.validator.d.ts +2 -1
  20. package/.output/modules/inventory/products/product.validator.js +7 -0
  21. package/.output/modules/inventory/properties/property.exception.d.ts +5 -0
  22. package/.output/modules/inventory/{brands/brand.entity.js → properties/property.exception.js} +15 -25
  23. package/.output/modules/sales/clients/client.exception.d.ts +5 -0
  24. package/.output/modules/sales/clients/client.exception.js +40 -0
  25. package/.output/modules/sales/orders/billing/billing.entity.d.ts +8 -6
  26. package/.output/modules/sales/orders/billing/billing.types.d.ts +9 -0
  27. package/.output/modules/sales/orders/billing/billing.types.js +14 -0
  28. package/.output/modules/sales/orders/billing/billing.validator.d.ts +6 -10
  29. package/.output/modules/sales/orders/billing/billing.validator.js +10 -15
  30. package/.output/modules/sales/orders/{address → billing/entities}/address.entity.d.ts +2 -1
  31. package/.output/modules/sales/orders/billing/entities/customer.entity.d.ts +5 -0
  32. package/.output/modules/sales/orders/billing/entities/status.entity.d.ts +6 -0
  33. package/.output/modules/sales/orders/{address → billing/validators}/address.validator.d.ts +2 -1
  34. package/.output/modules/sales/orders/{address → billing/validators}/address.validator.js +12 -14
  35. package/.output/modules/sales/orders/billing/validators/customer.validator.d.ts +5 -0
  36. package/.output/modules/sales/orders/{status/status.entity.js → billing/validators/customer.validator.js} +20 -21
  37. package/.output/modules/sales/orders/customer/customer.validator.d.ts +1 -1
  38. package/.output/modules/sales/orders/customer/customer.validator.js +8 -8
  39. package/.output/modules/sales/orders/order.entity.d.ts +1 -1
  40. package/.output/modules/sales/orders/order.exception.d.ts +13 -0
  41. package/.output/modules/sales/orders/order.exception.js +46 -0
  42. package/.output/modules/sales/orders/order.validator.d.ts +2 -2
  43. package/.output/modules/sales/orders/order.validator.js +3 -4
  44. package/.output/modules/sales/orders/shipping/entities/address.entity.d.ts +10 -0
  45. package/.output/modules/sales/orders/shipping/entities/customer.entity.d.ts +5 -0
  46. package/.output/modules/sales/orders/shipping/entities/status.entity.d.ts +6 -0
  47. package/.output/modules/sales/orders/shipping/shipping.entity.d.ts +8 -6
  48. package/.output/modules/sales/orders/shipping/shipping.types.d.ts +11 -0
  49. package/.output/modules/sales/orders/shipping/shipping.types.js +16 -0
  50. package/.output/modules/sales/orders/shipping/shipping.validator.d.ts +6 -9
  51. package/.output/modules/sales/orders/shipping/shipping.validator.js +10 -14
  52. package/.output/modules/sales/orders/shipping/validators/address.validator.d.ts +10 -0
  53. package/.output/modules/sales/orders/shipping/validators/address.validator.js +56 -0
  54. package/.output/modules/sales/orders/shipping/validators/customer.validator.d.ts +5 -0
  55. package/.output/modules/sales/orders/shipping/validators/customer.validator.js +36 -0
  56. package/.output/services/logger.service.d.ts +11 -0
  57. package/.output/services/logger.service.js +54 -0
  58. package/.output/types.d.ts +4 -1
  59. package/README.md +14 -14
  60. package/package.json +8 -11
  61. package/.output/abstract/abstract.entity.js +0 -53
  62. package/.output/modules/assets/asset.entity.js +0 -69
  63. package/.output/modules/content/banners/banner.entity.js +0 -54
  64. package/.output/modules/content/pages/page.entity.js +0 -69
  65. package/.output/modules/inventory/categories/category.entity.js +0 -61
  66. package/.output/modules/inventory/products/entities/code.entity.js +0 -53
  67. package/.output/modules/inventory/products/entities/dimension.entity.js +0 -57
  68. package/.output/modules/inventory/products/entities/seo.entity.js +0 -53
  69. package/.output/modules/inventory/products/product.entity.js +0 -101
  70. package/.output/modules/inventory/properties/property.entity.js +0 -55
  71. package/.output/modules/sales/clients/client.entity.js +0 -64
  72. package/.output/modules/sales/orders/address/address.entity.js +0 -68
  73. package/.output/modules/sales/orders/billing/billing.entity.js +0 -59
  74. package/.output/modules/sales/orders/customer/customer.entity.js +0 -52
  75. package/.output/modules/sales/orders/item/item.entity.js +0 -58
  76. package/.output/modules/sales/orders/order.entity.js +0 -89
  77. package/.output/modules/sales/orders/shipping/shipping.entity.js +0 -63
@@ -1,101 +0,0 @@
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.ProductEntity = 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 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.String, length: 256 }),
54
- __metadata("design:type", String)
55
- ], ProductEntity.prototype, "measurement", void 0);
56
- __decorate([
57
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Boolean, default: true }),
58
- __metadata("design:type", Object)
59
- ], ProductEntity.prototype, "active", void 0);
60
- __decorate([
61
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, nullable: true }),
62
- __metadata("design:type", String)
63
- ], ProductEntity.prototype, "description", void 0);
64
- __decorate([
65
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Array, default: [] }),
66
- __metadata("design:type", Array)
67
- ], ProductEntity.prototype, "hashtags", void 0);
68
- __decorate([
69
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: category_entity_1.CategoryEntity.$index }),
70
- __metadata("design:type", category_entity_1.CategoryEntity)
71
- ], ProductEntity.prototype, "category", void 0);
72
- __decorate([
73
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: brand_entity_1.BrandEntity.$index }),
74
- __metadata("design:type", brand_entity_1.BrandEntity)
75
- ], ProductEntity.prototype, "brand", void 0);
76
- __decorate([
77
- (0, mongoose_1.Prop)({ type: [{ type: mongoose_2.Schema.Types.ObjectId, ref: asset_entity_1.AssetEntity.$index }] }),
78
- __metadata("design:type", Array)
79
- ], ProductEntity.prototype, "files", void 0);
80
- __decorate([
81
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return price_entity_1.PriceEntity; }, default: new Map() }),
82
- __metadata("design:type", price_entity_1.PriceEntity)
83
- ], ProductEntity.prototype, "price", void 0);
84
- __decorate([
85
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return code_entity_1.CodeEntity; }, default: new Map() }),
86
- __metadata("design:type", code_entity_1.CodeEntity)
87
- ], ProductEntity.prototype, "code", void 0);
88
- __decorate([
89
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return dimension_entity_1.DimensionEntity; }, default: new Map() }),
90
- __metadata("design:type", dimension_entity_1.DimensionEntity)
91
- ], ProductEntity.prototype, "dimension", void 0);
92
- __decorate([
93
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return seo_entity_1.SeoEntity; }, default: new Map() }),
94
- __metadata("design:type", seo_entity_1.SeoEntity)
95
- ], ProductEntity.prototype, "seo", void 0);
96
- ProductEntity = __decorate([
97
- (0, mongoose_1.Schema)({ timestamps: true, toJSON: { virtuals: true } })
98
- ], ProductEntity);
99
- return ProductEntity;
100
- }(abstract_entity_1.AbstractEntity));
101
- exports.ProductEntity = ProductEntity;
@@ -1,55 +0,0 @@
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.PropertyEntity = 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_validator_1 = require("./property.validator");
32
- var PropertyEntity = (function (_super) {
33
- __extends(PropertyEntity, _super);
34
- function PropertyEntity() {
35
- return _super !== null && _super.apply(this, arguments) || this;
36
- }
37
- PropertyEntity.$index = 'inventory_properties';
38
- __decorate([
39
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true, length: 32 }),
40
- __metadata("design:type", String)
41
- ], PropertyEntity.prototype, "name", void 0);
42
- __decorate([
43
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, length: 64 }),
44
- __metadata("design:type", String)
45
- ], PropertyEntity.prototype, "title", void 0);
46
- __decorate([
47
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: property_validator_1.PropertyType.STRING }),
48
- __metadata("design:type", String)
49
- ], PropertyEntity.prototype, "type", void 0);
50
- PropertyEntity = __decorate([
51
- (0, mongoose_1.Schema)({ timestamps: true })
52
- ], PropertyEntity);
53
- return PropertyEntity;
54
- }(abstract_entity_1.AbstractEntity));
55
- exports.PropertyEntity = PropertyEntity;
@@ -1,64 +0,0 @@
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.ClientEntity = 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 ClientEntity = (function (_super) {
32
- __extends(ClientEntity, _super);
33
- function ClientEntity() {
34
- var _this = _super !== null && _super.apply(this, arguments) || this;
35
- _this.addresses = [];
36
- return _this;
37
- }
38
- ClientEntity.$index = 'store_clients';
39
- __decorate([
40
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
41
- __metadata("design:type", String)
42
- ], ClientEntity.prototype, "name", void 0);
43
- __decorate([
44
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, unique: true, required: true }),
45
- __metadata("design:type", String)
46
- ], ClientEntity.prototype, "email", void 0);
47
- __decorate([
48
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
49
- __metadata("design:type", String)
50
- ], ClientEntity.prototype, "phone", void 0);
51
- __decorate([
52
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, unique: true }),
53
- __metadata("design:type", String)
54
- ], ClientEntity.prototype, "identificationNumber", void 0);
55
- __decorate([
56
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Array, default: [] }),
57
- __metadata("design:type", Array)
58
- ], ClientEntity.prototype, "addresses", void 0);
59
- ClientEntity = __decorate([
60
- (0, mongoose_1.Schema)({ timestamps: true })
61
- ], ClientEntity);
62
- return ClientEntity;
63
- }(abstract_entity_1.AbstractEntity));
64
- exports.ClientEntity = ClientEntity;
@@ -1,68 +0,0 @@
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.AddressEntity = void 0;
28
- var mongoose_1 = require("@nestjs/mongoose");
29
- var mongoose_2 = require("mongoose");
30
- var AddressEntity = (function (_super) {
31
- __extends(AddressEntity, _super);
32
- function AddressEntity() {
33
- return _super !== null && _super.apply(this, arguments) || this;
34
- }
35
- __decorate([
36
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
37
- __metadata("design:type", String)
38
- ], AddressEntity.prototype, "country", void 0);
39
- __decorate([
40
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
41
- __metadata("design:type", String)
42
- ], AddressEntity.prototype, "code", void 0);
43
- __decorate([
44
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
45
- __metadata("design:type", String)
46
- ], AddressEntity.prototype, "street", void 0);
47
- __decorate([
48
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
49
- __metadata("design:type", String)
50
- ], AddressEntity.prototype, "number", void 0);
51
- __decorate([
52
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
53
- __metadata("design:type", String)
54
- ], AddressEntity.prototype, "complement", void 0);
55
- __decorate([
56
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
57
- __metadata("design:type", String)
58
- ], AddressEntity.prototype, "city", void 0);
59
- __decorate([
60
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
61
- __metadata("design:type", String)
62
- ], AddressEntity.prototype, "state", void 0);
63
- AddressEntity = __decorate([
64
- (0, mongoose_1.Schema)()
65
- ], AddressEntity);
66
- return AddressEntity;
67
- }(Map));
68
- exports.AddressEntity = AddressEntity;
@@ -1,59 +0,0 @@
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.BillingEntity = 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 address_entity_1 = require("../address/address.entity");
32
- var customer_entity_1 = require("../customer/customer.entity");
33
- var billing_validator_1 = require("./billing.validator");
34
- var BillingEntity = (function (_super) {
35
- __extends(BillingEntity, _super);
36
- function BillingEntity() {
37
- var _this = _super !== null && _super.apply(this, arguments) || this;
38
- _this.address = new address_entity_1.AddressEntity();
39
- _this.customer = new customer_entity_1.CustomerEntity();
40
- return _this;
41
- }
42
- __decorate([
43
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return address_entity_1.AddressEntity; }, default: new address_entity_1.AddressEntity() }),
44
- __metadata("design:type", Object)
45
- ], BillingEntity.prototype, "address", void 0);
46
- __decorate([
47
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return customer_entity_1.CustomerEntity; }, default: new customer_entity_1.CustomerEntity() }),
48
- __metadata("design:type", Object)
49
- ], BillingEntity.prototype, "customer", void 0);
50
- __decorate([
51
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, enum: billing_validator_1.BillingType, required: true }),
52
- __metadata("design:type", String)
53
- ], BillingEntity.prototype, "type", void 0);
54
- BillingEntity = __decorate([
55
- (0, schema_decorator_1.Schema)({})
56
- ], BillingEntity);
57
- return BillingEntity;
58
- }(Map));
59
- exports.BillingEntity = BillingEntity;
@@ -1,52 +0,0 @@
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.CustomerEntity = void 0;
28
- var mongoose_1 = require("@nestjs/mongoose");
29
- var mongoose_2 = require("mongoose");
30
- var CustomerEntity = (function (_super) {
31
- __extends(CustomerEntity, _super);
32
- function CustomerEntity() {
33
- return _super !== null && _super.apply(this, arguments) || this;
34
- }
35
- __decorate([
36
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
37
- __metadata("design:type", String)
38
- ], CustomerEntity.prototype, "name", void 0);
39
- __decorate([
40
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
41
- __metadata("design:type", String)
42
- ], CustomerEntity.prototype, "email", void 0);
43
- __decorate([
44
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
45
- __metadata("design:type", String)
46
- ], CustomerEntity.prototype, "phone", void 0);
47
- CustomerEntity = __decorate([
48
- (0, mongoose_1.Schema)()
49
- ], CustomerEntity);
50
- return CustomerEntity;
51
- }(Map));
52
- exports.CustomerEntity = CustomerEntity;
@@ -1,58 +0,0 @@
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.ItemEntity = 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 product_entity_1 = require("../../../inventory/products/product.entity");
32
- var ItemEntity = (function (_super) {
33
- __extends(ItemEntity, _super);
34
- function ItemEntity() {
35
- return _super !== null && _super.apply(this, arguments) || this;
36
- }
37
- __decorate([
38
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, default: 1 }),
39
- __metadata("design:type", Number)
40
- ], ItemEntity.prototype, "quantity", void 0);
41
- __decorate([
42
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, default: 0 }),
43
- __metadata("design:type", Number)
44
- ], ItemEntity.prototype, "price", void 0);
45
- __decorate([
46
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, default: 0 }),
47
- __metadata("design:type", Number)
48
- ], ItemEntity.prototype, "refund", void 0);
49
- __decorate([
50
- (0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: product_entity_1.ProductEntity.$index, required: true }),
51
- __metadata("design:type", product_entity_1.ProductEntity)
52
- ], ItemEntity.prototype, "product", void 0);
53
- ItemEntity = __decorate([
54
- (0, mongoose_1.Schema)({ timestamps: true, toJSON: { virtuals: true } })
55
- ], ItemEntity);
56
- return ItemEntity;
57
- }(abstract_entity_1.AbstractEntity));
58
- exports.ItemEntity = ItemEntity;
@@ -1,89 +0,0 @@
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.OrderEntity = 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 billing_entity_1 = require("./billing/billing.entity");
32
- var item_schema_1 = require("./item/item.schema");
33
- var shipping_entity_1 = require("./shipping/shipping.entity");
34
- var client_entity_1 = require("../clients/client.entity");
35
- var customer_entity_1 = require("./customer/customer.entity");
36
- var OrderEntity = (function (_super) {
37
- __extends(OrderEntity, _super);
38
- function OrderEntity() {
39
- var _this = _super !== null && _super.apply(this, arguments) || this;
40
- _this.status = [];
41
- _this.items = [];
42
- _this.billing = new billing_entity_1.BillingEntity();
43
- _this.shipping = new shipping_entity_1.ShippingEntity();
44
- _this.customer = new customer_entity_1.CustomerEntity();
45
- return _this;
46
- }
47
- OrderEntity.$index = 'store_orders';
48
- __decorate([
49
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, required: true, unique: true }),
50
- __metadata("design:type", Number)
51
- ], OrderEntity.prototype, "number", void 0);
52
- __decorate([
53
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Array, default: [] }),
54
- __metadata("design:type", Array)
55
- ], OrderEntity.prototype, "status", void 0);
56
- __decorate([
57
- (0, mongoose_1.Prop)({ type: [item_schema_1.ItemSchema], default: [] }),
58
- __metadata("design:type", Array)
59
- ], OrderEntity.prototype, "items", void 0);
60
- __decorate([
61
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: client_entity_1.ClientEntity.$index }),
62
- __metadata("design:type", client_entity_1.ClientEntity)
63
- ], OrderEntity.prototype, "client", void 0);
64
- __decorate([
65
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return billing_entity_1.BillingEntity; }, default: new billing_entity_1.BillingEntity() }),
66
- __metadata("design:type", Object)
67
- ], OrderEntity.prototype, "billing", void 0);
68
- __decorate([
69
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return shipping_entity_1.ShippingEntity; }, default: new shipping_entity_1.ShippingEntity() }),
70
- __metadata("design:type", Object)
71
- ], OrderEntity.prototype, "shipping", void 0);
72
- __decorate([
73
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return customer_entity_1.CustomerEntity; }, default: new customer_entity_1.CustomerEntity() }),
74
- __metadata("design:type", Object)
75
- ], OrderEntity.prototype, "customer", void 0);
76
- __decorate([
77
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
78
- __metadata("design:type", String)
79
- ], OrderEntity.prototype, "notes", void 0);
80
- __decorate([
81
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
82
- __metadata("design:type", String)
83
- ], OrderEntity.prototype, "createdBy", void 0);
84
- OrderEntity = __decorate([
85
- (0, mongoose_1.Schema)({ timestamps: true, toJSON: { virtuals: true } })
86
- ], OrderEntity);
87
- return OrderEntity;
88
- }(abstract_entity_1.AbstractEntity));
89
- exports.OrderEntity = OrderEntity;
@@ -1,63 +0,0 @@
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.ShippingEntity = 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 customer_entity_1 = require("../customer/customer.entity");
32
- var address_entity_1 = require("../address/address.entity");
33
- var shipping_validator_1 = require("./shipping.validator");
34
- var ShippingEntity = (function (_super) {
35
- __extends(ShippingEntity, _super);
36
- function ShippingEntity() {
37
- var _this = _super !== null && _super.apply(this, arguments) || this;
38
- _this.address = new address_entity_1.AddressEntity();
39
- _this.customer = new customer_entity_1.CustomerEntity();
40
- return _this;
41
- }
42
- __decorate([
43
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return address_entity_1.AddressEntity; }, default: new address_entity_1.AddressEntity() }),
44
- __metadata("design:type", Object)
45
- ], ShippingEntity.prototype, "address", void 0);
46
- __decorate([
47
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: function () { return customer_entity_1.CustomerEntity; }, default: new customer_entity_1.CustomerEntity() }),
48
- __metadata("design:type", Object)
49
- ], ShippingEntity.prototype, "customer", void 0);
50
- __decorate([
51
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, enum: shipping_validator_1.ShippingType, required: true }),
52
- __metadata("design:type", String)
53
- ], ShippingEntity.prototype, "type", void 0);
54
- __decorate([
55
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, default: 0 }),
56
- __metadata("design:type", Number)
57
- ], ShippingEntity.prototype, "price", void 0);
58
- ShippingEntity = __decorate([
59
- (0, schema_decorator_1.Schema)({})
60
- ], ShippingEntity);
61
- return ShippingEntity;
62
- }(Map));
63
- exports.ShippingEntity = ShippingEntity;