@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.
- package/.output/abstract/abstract.entity.d.ts +2 -1
- package/.output/abstract/abstract.entity.js +53 -0
- package/.output/abstract/abstract.validator.d.ts +7 -8
- package/.output/abstract/abstract.validator.js +6 -0
- package/.output/modules/assets/asset.entity.js +69 -0
- package/.output/modules/content/banners/banner.entity.js +54 -0
- package/.output/modules/content/banners/banner.fixture.d.ts +2 -2
- package/.output/modules/content/banners/banner.fixture.js +2 -2
- package/.output/modules/content/pages/page.entity.js +69 -0
- package/.output/modules/inventory/brands/brand.entity.js +50 -0
- package/.output/modules/inventory/categories/category.entity.js +61 -0
- package/.output/modules/inventory/categories/category.fixture.d.ts +2 -2
- package/.output/modules/inventory/categories/category.fixture.js +2 -2
- package/.output/modules/inventory/products/entities/code.entity.js +53 -0
- package/.output/modules/inventory/products/entities/dimension.entity.js +57 -0
- package/.output/modules/inventory/products/entities/price.entity.js +49 -0
- package/.output/modules/inventory/products/entities/seo.entity.js +53 -0
- package/.output/modules/inventory/products/product.entity.js +101 -0
- package/.output/modules/inventory/products/product.fixture.d.ts +2 -2
- package/.output/modules/inventory/products/product.fixture.js +3 -18
- package/.output/modules/inventory/properties/property.entity.js +55 -0
- package/.output/modules/sales/clients/client.entity.js +64 -0
- package/.output/modules/sales/orders/address/address.entity.d.ts +4 -3
- package/.output/modules/sales/orders/address/address.entity.js +68 -0
- package/.output/modules/sales/orders/address/address.validator.d.ts +3 -2
- package/.output/modules/sales/orders/address/address.validator.js +19 -7
- package/.output/modules/sales/orders/billing/billing.entity.d.ts +5 -4
- package/.output/modules/{search/search.validator.js → sales/orders/billing/billing.entity.js} +25 -34
- package/.output/modules/sales/orders/billing/billing.validator.d.ts +1 -1
- package/.output/modules/sales/orders/billing/billing.validator.js +4 -2
- package/.output/modules/sales/orders/customer/customer.entity.d.ts +1 -1
- package/.output/modules/sales/orders/customer/customer.entity.js +52 -0
- package/.output/modules/sales/orders/customer/customer.validator.js +5 -2
- package/.output/modules/sales/orders/item/item.entity.d.ts +1 -0
- package/.output/modules/sales/orders/item/item.entity.js +58 -0
- package/.output/modules/sales/orders/order.entity.d.ts +7 -8
- package/.output/modules/sales/orders/order.entity.js +89 -0
- package/.output/modules/sales/orders/order.validator.d.ts +2 -1
- package/.output/modules/sales/orders/order.validator.js +13 -7
- package/.output/modules/sales/orders/shipping/shipping.entity.d.ts +7 -4
- package/.output/modules/sales/orders/shipping/shipping.entity.js +63 -0
- package/.output/modules/sales/orders/shipping/shipping.validator.d.ts +1 -1
- package/.output/modules/sales/orders/shipping/shipping.validator.js +4 -2
- package/.output/modules/sales/orders/status/status.entity.js +37 -0
- package/.output/modules/setting/layout/layout.entity.js +46 -0
- package/.output/modules/setting/organization/organization.entity.d.ts +11 -0
- package/.output/modules/setting/{layout/layout.document.js → organization/organization.entity.js} +10 -11
- package/.output/modules/setting/organization/organization.types.d.ts +4 -3
- package/.output/modules/setting/organization/organization.types.js +7 -2
- package/.output/modules/setting/theme/theme.entity.js +46 -0
- package/.output/modules/users/user.validator.d.ts +3 -3
- package/.output/modules/users/user.validator.js +6 -6
- package/.output/types.d.ts +5 -13
- package/package.json +2 -4
- package/.output/abstract/abstract.document.d.ts +0 -10
- package/.output/abstract/abstract.document.js +0 -13
- package/.output/modules/content/banners/banner.document.d.ts +0 -6
- package/.output/modules/content/banners/banner.document.js +0 -30
- package/.output/modules/content/pages/page.document.d.ts +0 -10
- package/.output/modules/content/pages/page.document.js +0 -32
- package/.output/modules/inventory/brands/brand.document.d.ts +0 -5
- package/.output/modules/inventory/brands/brand.document.js +0 -30
- package/.output/modules/inventory/categories/category.document.d.ts +0 -6
- package/.output/modules/inventory/categories/category.document.js +0 -31
- package/.output/modules/inventory/products/product.document.d.ts +0 -25
- package/.output/modules/inventory/products/product.document.js +0 -34
- package/.output/modules/sales/clients/client.document.d.ts +0 -9
- package/.output/modules/sales/clients/client.document.js +0 -33
- package/.output/modules/sales/orders/billing/billing.document.d.ts +0 -7
- package/.output/modules/sales/orders/billing/billing.document.js +0 -9
- package/.output/modules/sales/orders/item/item.document.d.ts +0 -6
- package/.output/modules/sales/orders/item/item.document.js +0 -9
- package/.output/modules/sales/orders/payment/payment.entity.d.ts +0 -4
- package/.output/modules/sales/orders/payment/payment.validator.d.ts +0 -6
- package/.output/modules/sales/orders/payment/payment.validator.js +0 -10
- package/.output/modules/sales/orders/shipping/shipping.document.d.ts +0 -7
- package/.output/modules/sales/orders/shipping/shipping.document.js +0 -9
- package/.output/modules/sales/orders/status/status.document.d.ts +0 -5
- package/.output/modules/sales/orders/status/status.document.js +0 -9
- package/.output/modules/search/search.validator.d.ts +0 -7
- package/.output/modules/setting/layout/layout.document.d.ts +0 -5
- package/.output/modules/setting/organization/organization.document.d.ts +0 -15
- package/.output/modules/setting/organization/organization.document.js +0 -31
|
@@ -0,0 +1,52 @@
|
|
|
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;
|
|
@@ -13,15 +13,18 @@ exports.CreateCustomerValidator = void 0;
|
|
|
13
13
|
var class_validator_1 = require("class-validator");
|
|
14
14
|
var CreateCustomerValidator = (function () {
|
|
15
15
|
function CreateCustomerValidator() {
|
|
16
|
+
this.name = String();
|
|
17
|
+
this.email = String();
|
|
18
|
+
this.phone = undefined;
|
|
16
19
|
}
|
|
17
20
|
__decorate([
|
|
18
21
|
(0, class_validator_1.IsString)(),
|
|
19
22
|
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
-
__metadata("design:type",
|
|
23
|
+
__metadata("design:type", Object)
|
|
21
24
|
], CreateCustomerValidator.prototype, "name", void 0);
|
|
22
25
|
__decorate([
|
|
23
26
|
(0, class_validator_1.IsEmail)(),
|
|
24
|
-
__metadata("design:type",
|
|
27
|
+
__metadata("design:type", Object)
|
|
25
28
|
], CreateCustomerValidator.prototype, "email", void 0);
|
|
26
29
|
__decorate([
|
|
27
30
|
(0, class_validator_1.IsString)(),
|
|
@@ -0,0 +1,58 @@
|
|
|
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,24 +1,23 @@
|
|
|
1
|
-
import { Types } from 'mongoose';
|
|
2
1
|
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
2
|
+
import { BillingEntity } from './billing/billing.entity';
|
|
3
3
|
import { ItemEntity } from './item/item.entity';
|
|
4
|
+
import { ShippingEntity } from './shipping/shipping.entity';
|
|
4
5
|
import { StatusEntity } from './status/status.entity';
|
|
5
6
|
import { ClientEntity } from "../clients/client.entity";
|
|
7
|
+
import { CustomerEntity } from "./customer/customer.entity";
|
|
6
8
|
export declare class OrderEntity extends AbstractEntity {
|
|
7
9
|
static readonly $index = "store_orders";
|
|
8
10
|
number: number;
|
|
9
11
|
status: StatusEntity[];
|
|
10
12
|
items: ItemEntity[];
|
|
11
|
-
refundItems: {
|
|
12
|
-
quantity: number;
|
|
13
|
-
item: ItemEntity;
|
|
14
|
-
}[];
|
|
15
|
-
billing?: Types.Map<any>;
|
|
16
|
-
shipping?: Types.Map<any>;
|
|
17
13
|
client: ClientEntity;
|
|
18
|
-
|
|
14
|
+
billing: BillingEntity;
|
|
15
|
+
shipping: ShippingEntity;
|
|
16
|
+
customer: CustomerEntity;
|
|
19
17
|
notes: string;
|
|
20
18
|
createdBy: string;
|
|
21
19
|
readonly fullNumber: string;
|
|
22
20
|
readonly total: number;
|
|
21
|
+
readonly subtotal: number;
|
|
23
22
|
readonly currentStatus: StatusEntity;
|
|
24
23
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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;
|
|
@@ -12,7 +12,8 @@ export declare class CreateOrderValidator extends AbstractValidator {
|
|
|
12
12
|
customer: CreateCustomerValidator;
|
|
13
13
|
notes?: string;
|
|
14
14
|
}
|
|
15
|
-
export declare class UpdateOrderValidator
|
|
15
|
+
export declare class UpdateOrderValidator {
|
|
16
|
+
client?: string;
|
|
16
17
|
}
|
|
17
18
|
export declare class ChangeOrderStatusValidator extends AbstractValidator {
|
|
18
19
|
status: StatusType;
|
|
@@ -38,6 +38,9 @@ var CreateOrderValidator = (function (_super) {
|
|
|
38
38
|
function CreateOrderValidator() {
|
|
39
39
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
40
40
|
_this.items = [];
|
|
41
|
+
_this.billing = new billing_validator_1.CreateBillingValidator();
|
|
42
|
+
_this.shipping = new shipping_validator_1.CreateShippingValidator();
|
|
43
|
+
_this.customer = new customer_validator_1.CreateCustomerValidator();
|
|
41
44
|
return _this;
|
|
42
45
|
}
|
|
43
46
|
__decorate([
|
|
@@ -55,19 +58,19 @@ var CreateOrderValidator = (function (_super) {
|
|
|
55
58
|
(0, class_validator_1.ValidateNested)(),
|
|
56
59
|
(0, class_transformer_1.Type)(function () { return billing_validator_1.CreateBillingValidator; }),
|
|
57
60
|
(0, class_validator_1.IsNotEmptyObject)(),
|
|
58
|
-
__metadata("design:type",
|
|
61
|
+
__metadata("design:type", Object)
|
|
59
62
|
], CreateOrderValidator.prototype, "billing", void 0);
|
|
60
63
|
__decorate([
|
|
61
64
|
(0, class_validator_1.ValidateNested)(),
|
|
62
65
|
(0, class_transformer_1.Type)(function () { return shipping_validator_1.CreateShippingValidator; }),
|
|
63
66
|
(0, class_validator_1.IsNotEmptyObject)(),
|
|
64
|
-
__metadata("design:type",
|
|
67
|
+
__metadata("design:type", Object)
|
|
65
68
|
], CreateOrderValidator.prototype, "shipping", void 0);
|
|
66
69
|
__decorate([
|
|
67
70
|
(0, class_validator_1.ValidateNested)(),
|
|
68
71
|
(0, class_transformer_1.Type)(function () { return customer_validator_1.CreateCustomerValidator; }),
|
|
69
72
|
(0, class_validator_1.IsNotEmptyObject)(),
|
|
70
|
-
__metadata("design:type",
|
|
73
|
+
__metadata("design:type", Object)
|
|
71
74
|
], CreateOrderValidator.prototype, "customer", void 0);
|
|
72
75
|
__decorate([
|
|
73
76
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -77,13 +80,16 @@ var CreateOrderValidator = (function (_super) {
|
|
|
77
80
|
return CreateOrderValidator;
|
|
78
81
|
}(abstract_validator_1.AbstractValidator));
|
|
79
82
|
exports.CreateOrderValidator = CreateOrderValidator;
|
|
80
|
-
var UpdateOrderValidator = (function (
|
|
81
|
-
__extends(UpdateOrderValidator, _super);
|
|
83
|
+
var UpdateOrderValidator = (function () {
|
|
82
84
|
function UpdateOrderValidator() {
|
|
83
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
84
85
|
}
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.IsOptional)(),
|
|
88
|
+
(0, class_validator_1.IsMongoId)(),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], UpdateOrderValidator.prototype, "client", void 0);
|
|
85
91
|
return UpdateOrderValidator;
|
|
86
|
-
}(
|
|
92
|
+
}());
|
|
87
93
|
exports.UpdateOrderValidator = UpdateOrderValidator;
|
|
88
94
|
var ChangeOrderStatusValidator = (function (_super) {
|
|
89
95
|
__extends(ChangeOrderStatusValidator, _super);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { CustomerEntity } from "../customer/customer.entity";
|
|
2
|
+
import { AddressEntity } from "../address/address.entity";
|
|
3
|
+
import { ShippingType } from "./shipping.validator";
|
|
4
|
+
export declare class ShippingEntity extends Map {
|
|
5
|
+
address: AddressEntity;
|
|
6
|
+
customer: CustomerEntity;
|
|
7
|
+
type: ShippingType;
|
|
5
8
|
price: number;
|
|
6
9
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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;
|
|
@@ -22,19 +22,21 @@ var ShippingType;
|
|
|
22
22
|
})(ShippingType = exports.ShippingType || (exports.ShippingType = {}));
|
|
23
23
|
var CreateShippingValidator = (function () {
|
|
24
24
|
function CreateShippingValidator() {
|
|
25
|
+
this.customer = new customer_validator_1.CreateCustomerValidator();
|
|
26
|
+
this.address = new address_validator_1.AddressValidator();
|
|
25
27
|
this.price = 0;
|
|
26
28
|
}
|
|
27
29
|
__decorate([
|
|
28
30
|
(0, class_validator_1.ValidateNested)(),
|
|
29
31
|
(0, class_transformer_1.Type)(function () { return customer_validator_1.CreateCustomerValidator; }),
|
|
30
32
|
(0, class_validator_1.IsNotEmptyObject)(),
|
|
31
|
-
__metadata("design:type",
|
|
33
|
+
__metadata("design:type", Object)
|
|
32
34
|
], CreateShippingValidator.prototype, "customer", void 0);
|
|
33
35
|
__decorate([
|
|
34
36
|
(0, class_validator_1.ValidateNested)(),
|
|
35
37
|
(0, class_transformer_1.Type)(function () { return address_validator_1.AddressValidator; }),
|
|
36
38
|
(0, class_validator_1.IsNotEmptyObject)(),
|
|
37
|
-
__metadata("design:type",
|
|
39
|
+
__metadata("design:type", Object)
|
|
38
40
|
], CreateShippingValidator.prototype, "address", void 0);
|
|
39
41
|
__decorate([
|
|
40
42
|
(0, class_validator_1.IsEnum)(ShippingType),
|
|
@@ -0,0 +1,37 @@
|
|
|
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.StatusEntity = void 0;
|
|
13
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
var schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
|
|
15
|
+
var mongoose_2 = require("mongoose");
|
|
16
|
+
var status_validator_1 = require("./status.validator");
|
|
17
|
+
var StatusEntity = (function () {
|
|
18
|
+
function StatusEntity() {
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, enum: status_validator_1.StatusType, required: true }),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], StatusEntity.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], StatusEntity.prototype, "user", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], StatusEntity.prototype, "date", void 0);
|
|
32
|
+
StatusEntity = __decorate([
|
|
33
|
+
(0, schema_decorator_1.Schema)({ timestamps: true })
|
|
34
|
+
], StatusEntity);
|
|
35
|
+
return StatusEntity;
|
|
36
|
+
}());
|
|
37
|
+
exports.StatusEntity = StatusEntity;
|
|
@@ -0,0 +1,46 @@
|
|
|
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.LayoutEntity = 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 LayoutEntity = (function (_super) {
|
|
32
|
+
__extends(LayoutEntity, _super);
|
|
33
|
+
function LayoutEntity() {
|
|
34
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
}
|
|
36
|
+
LayoutEntity.$index = 'settings_layout';
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true, length: 128 }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], LayoutEntity.prototype, "path", void 0);
|
|
41
|
+
LayoutEntity = __decorate([
|
|
42
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
43
|
+
], LayoutEntity);
|
|
44
|
+
return LayoutEntity;
|
|
45
|
+
}(abstract_entity_1.AbstractEntity));
|
|
46
|
+
exports.LayoutEntity = LayoutEntity;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
2
|
+
import { OrganizationMetadataAddress, OrganizationMetadataInformation, OrganizationMetadataLocalization, OrganizationMetadataSocial } from "./organization.types";
|
|
3
|
+
interface OrganizationMetadata {
|
|
4
|
+
address?: OrganizationMetadataAddress;
|
|
5
|
+
domain: string;
|
|
6
|
+
information?: OrganizationMetadataInformation;
|
|
7
|
+
localization?: OrganizationMetadataLocalization;
|
|
8
|
+
social?: OrganizationMetadataSocial[];
|
|
9
|
+
theme: string;
|
|
10
|
+
}
|
|
2
11
|
export declare class OrganizationEntity extends AbstractEntity {
|
|
3
12
|
static readonly $index = "setting_organization";
|
|
13
|
+
metadata: OrganizationMetadata;
|
|
4
14
|
}
|
|
15
|
+
export {};
|
package/.output/modules/setting/{layout/layout.document.js → organization/organization.entity.js}
RENAMED
|
@@ -15,15 +15,14 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
__extends(
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
_this.content = {};
|
|
25
|
-
return _this;
|
|
18
|
+
exports.OrganizationEntity = void 0;
|
|
19
|
+
var abstract_entity_1 = require("../../../abstract/abstract.entity");
|
|
20
|
+
var OrganizationEntity = (function (_super) {
|
|
21
|
+
__extends(OrganizationEntity, _super);
|
|
22
|
+
function OrganizationEntity() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
OrganizationEntity.$index = 'setting_organization';
|
|
26
|
+
return OrganizationEntity;
|
|
27
|
+
}(abstract_entity_1.AbstractEntity));
|
|
28
|
+
exports.OrganizationEntity = OrganizationEntity;
|
|
@@ -12,11 +12,12 @@ export declare class OrganizationMetadataSocial {
|
|
|
12
12
|
name: string;
|
|
13
13
|
url: string;
|
|
14
14
|
}
|
|
15
|
-
export declare class OrganizationMetadataAddress implements
|
|
15
|
+
export declare class OrganizationMetadataAddress implements MetaAddress {
|
|
16
16
|
country: string;
|
|
17
17
|
code: string;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
street: string;
|
|
19
|
+
number: string;
|
|
20
|
+
complement?: string;
|
|
20
21
|
city: string;
|
|
21
22
|
state: string;
|
|
22
23
|
}
|
|
@@ -81,12 +81,17 @@ var OrganizationMetadataAddress = (function () {
|
|
|
81
81
|
(0, class_validator_1.IsString)(),
|
|
82
82
|
(0, class_validator_1.IsOptional)(),
|
|
83
83
|
__metadata("design:type", String)
|
|
84
|
-
], OrganizationMetadataAddress.prototype, "
|
|
84
|
+
], OrganizationMetadataAddress.prototype, "street", void 0);
|
|
85
85
|
__decorate([
|
|
86
86
|
(0, class_validator_1.IsString)(),
|
|
87
87
|
(0, class_validator_1.IsOptional)(),
|
|
88
88
|
__metadata("design:type", String)
|
|
89
|
-
], OrganizationMetadataAddress.prototype, "
|
|
89
|
+
], OrganizationMetadataAddress.prototype, "number", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, class_validator_1.IsString)(),
|
|
92
|
+
(0, class_validator_1.IsOptional)(),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], OrganizationMetadataAddress.prototype, "complement", void 0);
|
|
90
95
|
__decorate([
|
|
91
96
|
(0, class_validator_1.IsOptional)(),
|
|
92
97
|
(0, class_validator_1.IsString)(),
|