@merkaly/api 0.2.2-0 → 0.2.2-10
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/configs/app.entity.d.ts +8 -0
- package/.output/configs/app.entity.js +34 -0
- package/.output/main.d.ts +0 -54
- package/.output/modules/assets/asset.entity.d.ts +10 -0
- package/.output/modules/assets/asset.entity.js +52 -0
- package/.output/{module/organization → modules/auth}/connections/connection.validator.d.ts +0 -0
- package/.output/modules/auth/connections/connection.validator.js +35 -0
- package/.output/{module/organization → modules/auth}/members/member.validator.d.ts +0 -0
- package/.output/modules/auth/members/member.validator.js +3 -0
- package/.output/modules/auth/organizations/organization.validator.d.ts +6 -0
- package/.output/modules/auth/organizations/organization.validator.js +33 -0
- package/.output/modules/inventory/brands/brand.entity.d.ts +6 -0
- package/.output/modules/inventory/brands/brand.entity.js +32 -0
- package/.output/modules/inventory/brands/brand.validator.d.ts +8 -0
- package/.output/modules/inventory/brands/brand.validator.js +43 -0
- package/.output/modules/inventory/categories/category.entity.d.ts +6 -0
- package/.output/modules/inventory/categories/category.entity.js +32 -0
- package/.output/modules/inventory/categories/category.validator.d.ts +8 -0
- package/.output/modules/inventory/categories/category.validator.js +43 -0
- package/.output/{module → modules}/inventory/products/product.entity.d.ts +5 -6
- package/.output/modules/inventory/products/product.entity.js +55 -0
- package/.output/modules/inventory/products/product.validator.d.ts +17 -0
- package/.output/modules/inventory/products/product.validator.js +91 -0
- package/.output/modules/settings/payments/payment.entity.d.ts +8 -0
- package/.output/modules/settings/payments/payment.entity.js +38 -0
- package/.output/modules/settings/payments/payment.validator.d.ts +3 -0
- package/.output/modules/settings/payments/payment.validator.js +7 -0
- package/.output/modules/store/cart/cart.entity.d.ts +9 -0
- package/.output/modules/store/cart/cart.entity.js +39 -0
- package/.output/modules/store/cart/cart.validator.d.ts +19 -0
- package/.output/modules/store/cart/cart.validator.js +64 -0
- package/.output/modules/store/orders/billing/billing.entity.d.ts +7 -0
- package/.output/modules/store/orders/billing/billing.entity.js +46 -0
- package/.output/modules/store/orders/billing/billing.validator.d.ts +7 -0
- package/.output/modules/store/orders/billing/billing.validator.js +44 -0
- package/.output/modules/store/orders/item/item.entity.d.ts +7 -0
- package/.output/modules/store/orders/item/item.entity.js +37 -0
- package/.output/modules/store/orders/item/item.schema.d.ts +27 -0
- package/.output/modules/store/orders/item/item.schema.js +6 -0
- package/.output/{module/store/items → modules/store/orders/item}/item.validator.d.ts +1 -1
- package/.output/modules/store/orders/item/item.validator.js +27 -0
- package/.output/modules/store/orders/order.entity.d.ts +15 -0
- package/.output/modules/store/orders/order.entity.js +56 -0
- package/.output/modules/store/orders/order.validator.d.ts +12 -0
- package/.output/modules/store/orders/order.validator.js +49 -0
- package/.output/modules/store/orders/shipping/shipping.entity.d.ts +7 -0
- package/.output/modules/store/orders/shipping/shipping.entity.js +46 -0
- package/.output/modules/store/orders/shipping/shipping.validator.d.ts +7 -0
- package/.output/modules/store/orders/shipping/shipping.validator.js +44 -0
- package/.output/modules/store/orders/status/status.entity.d.ts +6 -0
- package/.output/modules/store/orders/status/status.entity.js +37 -0
- package/.output/modules/store/orders/status/status.validator.d.ts +8 -0
- package/.output/modules/store/orders/status/status.validator.js +12 -0
- package/.output/types.js +0 -0
- package/package.json +39 -46
- package/.output/config/app.config.d.ts +0 -27
- package/.output/config/app.document.d.ts +0 -9
- package/.output/config/app.entity.d.ts +0 -8
- package/.output/config/app.repository.d.ts +0 -25
- package/.output/config/app.validator.d.ts +0 -4
- package/.output/module/inventory/brands/brand.document.d.ts +0 -7
- package/.output/module/inventory/brands/brand.entity.d.ts +0 -7
- package/.output/module/inventory/brands/brand.validator.d.ts +0 -12
- package/.output/module/inventory/categories/category.document.d.ts +0 -7
- package/.output/module/inventory/categories/category.entity.d.ts +0 -7
- package/.output/module/inventory/categories/category.validator.d.ts +0 -12
- package/.output/module/inventory/media/media.document.d.ts +0 -7
- package/.output/module/inventory/media/media.entity.d.ts +0 -7
- package/.output/module/inventory/media/media.validator.d.ts +0 -10
- package/.output/module/inventory/products/product.document.d.ts +0 -12
- package/.output/module/inventory/products/product.validator.d.ts +0 -21
- package/.output/module/inventory/variants/variant.document.d.ts +0 -6
- package/.output/module/inventory/variants/variant.entity.d.ts +0 -6
- package/.output/module/inventory/variants/variant.validator.d.ts +0 -12
- package/.output/module/store/carts/cart.document.d.ts +0 -6
- package/.output/module/store/carts/cart.entity.d.ts +0 -6
- package/.output/module/store/carts/cart.validator.d.ts +0 -8
- package/.output/module/store/items/item.document.d.ts +0 -8
- package/.output/module/store/items/item.entity.d.ts +0 -8
- package/.output/module/store/orders/order.document.d.ts +0 -7
- package/.output/module/store/orders/order.entity.d.ts +0 -5
- package/.output/module/store/orders/order.validator.d.ts +0 -8
|
@@ -0,0 +1,34 @@
|
|
|
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.AppEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
class AppEntity extends mongoose_2.Document {
|
|
16
|
+
static $index;
|
|
17
|
+
_id = '';
|
|
18
|
+
createdAt = new Date();
|
|
19
|
+
updatedAt = null;
|
|
20
|
+
deletedAt = null;
|
|
21
|
+
}
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date, default: new Date() }),
|
|
24
|
+
__metadata("design:type", Object)
|
|
25
|
+
], AppEntity.prototype, "createdAt", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
28
|
+
__metadata("design:type", Date)
|
|
29
|
+
], AppEntity.prototype, "updatedAt", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
32
|
+
__metadata("design:type", Date)
|
|
33
|
+
], AppEntity.prototype, "deletedAt", void 0);
|
|
34
|
+
exports.AppEntity = AppEntity;
|
package/.output/main.d.ts
CHANGED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { BrandDocument } from './module/inventory/brands/brand.document';
|
|
2
|
-
import * as BrandValidators from './module/inventory/brands/brand.validator';
|
|
3
|
-
import { CategoryDocument } from './module/inventory/categories/category.document';
|
|
4
|
-
import * as CategoryValidators from './module/inventory/categories/category.validator';
|
|
5
|
-
import { MediaDocument } from './module/inventory/media/media.document';
|
|
6
|
-
import * as MediaValidators from './module/inventory/media/media.validator';
|
|
7
|
-
import { ProductDocument } from './module/inventory/products/product.document';
|
|
8
|
-
import * as ProductValidators from './module/inventory/products/product.validator';
|
|
9
|
-
import { VariantDocument } from './module/inventory/variants/variant.document';
|
|
10
|
-
import * as VariantValidators from './module/inventory/variants/variant.validator';
|
|
11
|
-
import { CartDocument } from './module/store/carts/cart.document';
|
|
12
|
-
import * as CartValidator from './module/store/carts/cart.validator';
|
|
13
|
-
import { OrderDocument } from './module/store/orders/order.document';
|
|
14
|
-
import * as OrderValidators from './module/store/orders/order.validator';
|
|
15
|
-
export declare const Inventory: {
|
|
16
|
-
Brand: {
|
|
17
|
-
CreateBrandValidator: typeof BrandValidators.CreateBrandValidator;
|
|
18
|
-
UpdateBrandValidator: typeof BrandValidators.UpdateBrandValidator;
|
|
19
|
-
BrandDocument: typeof BrandDocument;
|
|
20
|
-
};
|
|
21
|
-
Category: {
|
|
22
|
-
CreateCategoryValidator: typeof CategoryValidators.CreateCategoryValidator;
|
|
23
|
-
UpdateCategoryValidator: typeof CategoryValidators.UpdateCategoryValidator;
|
|
24
|
-
CategoryDocument: typeof CategoryDocument;
|
|
25
|
-
};
|
|
26
|
-
Product: {
|
|
27
|
-
CreateProductValidator: typeof ProductValidators.CreateProductValidator;
|
|
28
|
-
UpdateProductValidator: typeof ProductValidators.UpdateProductValidator;
|
|
29
|
-
ProductDocument: typeof ProductDocument;
|
|
30
|
-
};
|
|
31
|
-
Media: {
|
|
32
|
-
CreateMediaValidator: typeof MediaValidators.CreateMediaValidator;
|
|
33
|
-
UpdateMediaValidator: typeof MediaValidators.UpdateMediaValidator;
|
|
34
|
-
MediaDocument: typeof MediaDocument;
|
|
35
|
-
};
|
|
36
|
-
Variant: {
|
|
37
|
-
CreateVariantValidator: typeof VariantValidators.CreateVariantValidator;
|
|
38
|
-
UpdateVariantValidator: typeof VariantValidators.UpdateVariantValidator;
|
|
39
|
-
VariantDocument: typeof VariantDocument;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export declare const Store: {
|
|
43
|
-
Order: {
|
|
44
|
-
CreateOrderValidator: typeof OrderValidators.CreateOrderValidator;
|
|
45
|
-
UpdateOrderValidator: typeof OrderValidators.UpdateOrderValidator;
|
|
46
|
-
OrderDocument: typeof OrderDocument;
|
|
47
|
-
};
|
|
48
|
-
Cart: {
|
|
49
|
-
CreateCartValidator: typeof CartValidator.CreateCartValidator;
|
|
50
|
-
UpdateCartValidator: typeof CartValidator.UpdateCartValidator;
|
|
51
|
-
CartDocument: typeof CartDocument;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
export { SearchParams } from './config/app.repository';
|
|
@@ -0,0 +1,52 @@
|
|
|
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.AssetEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const app_entity_1 = require("../../configs/app.entity");
|
|
16
|
+
let AssetEntity = class AssetEntity extends app_entity_1.AppEntity {
|
|
17
|
+
static $index = 'assets';
|
|
18
|
+
name;
|
|
19
|
+
url;
|
|
20
|
+
weak = true;
|
|
21
|
+
description;
|
|
22
|
+
type;
|
|
23
|
+
size = 0;
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AssetEntity.prototype, "name", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AssetEntity.prototype, "url", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Boolean, default: true }),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], AssetEntity.prototype, "weak", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, nullable: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], AssetEntity.prototype, "description", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AssetEntity.prototype, "type", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, required: true, default: 0 }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], AssetEntity.prototype, "size", void 0);
|
|
49
|
+
AssetEntity = __decorate([
|
|
50
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
51
|
+
], AssetEntity);
|
|
52
|
+
exports.AssetEntity = AssetEntity;
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
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.UpdateConnectionValidator = exports.CreateConnectionValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
require("reflect-metadata");
|
|
15
|
+
class CreateConnectionValidator {
|
|
16
|
+
connection_id;
|
|
17
|
+
assign_membership_on_login;
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
__metadata("design:type", Object)
|
|
22
|
+
], CreateConnectionValidator.prototype, "connection_id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsBoolean)(),
|
|
25
|
+
__metadata("design:type", Object)
|
|
26
|
+
], CreateConnectionValidator.prototype, "assign_membership_on_login", void 0);
|
|
27
|
+
exports.CreateConnectionValidator = CreateConnectionValidator;
|
|
28
|
+
class UpdateConnectionValidator {
|
|
29
|
+
assign_membership_on_login;
|
|
30
|
+
}
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsBoolean)(),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], UpdateConnectionValidator.prototype, "assign_membership_on_login", void 0);
|
|
35
|
+
exports.UpdateConnectionValidator = UpdateConnectionValidator;
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
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.CreateOrganizationValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CreateOrganizationValidator {
|
|
15
|
+
name;
|
|
16
|
+
email;
|
|
17
|
+
password;
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
(0, class_validator_1.Length)(3, 255),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], CreateOrganizationValidator.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsEmail)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CreateOrganizationValidator.prototype, "email", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreateOrganizationValidator.prototype, "password", void 0);
|
|
33
|
+
exports.CreateOrganizationValidator = CreateOrganizationValidator;
|
|
@@ -0,0 +1,32 @@
|
|
|
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.BrandEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const app_entity_1 = require("../../../configs/app.entity");
|
|
16
|
+
let BrandEntity = class BrandEntity extends app_entity_1.AppEntity {
|
|
17
|
+
static $index = 'inventory_brands';
|
|
18
|
+
name;
|
|
19
|
+
description;
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true, length: 32 }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], BrandEntity.prototype, "name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], BrandEntity.prototype, "description", void 0);
|
|
29
|
+
BrandEntity = __decorate([
|
|
30
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
31
|
+
], BrandEntity);
|
|
32
|
+
exports.BrandEntity = BrandEntity;
|
|
@@ -0,0 +1,43 @@
|
|
|
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.UpdateBrandValidator = exports.CreateBrandValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CreateBrandValidator {
|
|
15
|
+
name;
|
|
16
|
+
description;
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
(0, class_validator_1.Length)(2, 32),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], CreateBrandValidator.prototype, "name", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CreateBrandValidator.prototype, "description", void 0);
|
|
28
|
+
exports.CreateBrandValidator = CreateBrandValidator;
|
|
29
|
+
class UpdateBrandValidator {
|
|
30
|
+
name;
|
|
31
|
+
description;
|
|
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
|
+
exports.UpdateBrandValidator = UpdateBrandValidator;
|
|
@@ -0,0 +1,32 @@
|
|
|
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.CategoryEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const app_entity_1 = require("../../../configs/app.entity");
|
|
16
|
+
let CategoryEntity = class CategoryEntity extends app_entity_1.AppEntity {
|
|
17
|
+
static $index = 'inventory_categories';
|
|
18
|
+
name;
|
|
19
|
+
description;
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, length: 32, unique: true, required: true }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], CategoryEntity.prototype, "name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CategoryEntity.prototype, "description", void 0);
|
|
29
|
+
CategoryEntity = __decorate([
|
|
30
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
31
|
+
], CategoryEntity);
|
|
32
|
+
exports.CategoryEntity = CategoryEntity;
|
|
@@ -0,0 +1,43 @@
|
|
|
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.UpdateCategoryValidator = exports.CreateCategoryValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CreateCategoryValidator {
|
|
15
|
+
name;
|
|
16
|
+
description;
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
(0, class_validator_1.Length)(5, 32),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], CreateCategoryValidator.prototype, "name", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CreateCategoryValidator.prototype, "description", void 0);
|
|
28
|
+
exports.CreateCategoryValidator = CreateCategoryValidator;
|
|
29
|
+
class UpdateCategoryValidator {
|
|
30
|
+
name;
|
|
31
|
+
description;
|
|
32
|
+
}
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], UpdateCategoryValidator.prototype, "name", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], UpdateCategoryValidator.prototype, "description", void 0);
|
|
43
|
+
exports.UpdateCategoryValidator = UpdateCategoryValidator;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { AppEntity } from '../../../
|
|
1
|
+
import { AppEntity } from '../../../configs/app.entity';
|
|
2
|
+
import { AssetEntity } from '../../assets/asset.entity';
|
|
2
3
|
import { BrandEntity } from '../brands/brand.entity';
|
|
3
4
|
import { CategoryEntity } from '../categories/category.entity';
|
|
4
|
-
import { MediaEntity } from '../media/media.entity';
|
|
5
|
-
import { VariantEntity } from '../variants/variant.entity';
|
|
6
5
|
export declare class ProductEntity extends AppEntity {
|
|
6
|
+
static readonly $index = "inventory_products";
|
|
7
7
|
name: string;
|
|
8
|
-
description
|
|
8
|
+
description: string;
|
|
9
9
|
price: number;
|
|
10
10
|
category?: CategoryEntity;
|
|
11
11
|
brand?: BrandEntity;
|
|
12
|
-
|
|
13
|
-
media: MediaEntity[];
|
|
12
|
+
files: AssetEntity[];
|
|
14
13
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.ProductEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const app_entity_1 = require("../../../configs/app.entity");
|
|
16
|
+
const asset_entity_1 = require("../../assets/asset.entity");
|
|
17
|
+
const brand_entity_1 = require("../brands/brand.entity");
|
|
18
|
+
const category_entity_1 = require("../categories/category.entity");
|
|
19
|
+
let ProductEntity = class ProductEntity extends app_entity_1.AppEntity {
|
|
20
|
+
static $index = 'inventory_products';
|
|
21
|
+
name;
|
|
22
|
+
description;
|
|
23
|
+
price = 0;
|
|
24
|
+
category;
|
|
25
|
+
brand;
|
|
26
|
+
files = [];
|
|
27
|
+
};
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true, length: 64 }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ProductEntity.prototype, "name", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, nullable: true }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], ProductEntity.prototype, "description", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, default: 0 }),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], ProductEntity.prototype, "price", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: category_entity_1.CategoryEntity.$index }),
|
|
42
|
+
__metadata("design:type", category_entity_1.CategoryEntity)
|
|
43
|
+
], ProductEntity.prototype, "category", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: brand_entity_1.BrandEntity.$index }),
|
|
46
|
+
__metadata("design:type", brand_entity_1.BrandEntity)
|
|
47
|
+
], ProductEntity.prototype, "brand", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, mongoose_1.Prop)({ type: [{ type: mongoose_2.Types.ObjectId, ref: asset_entity_1.AssetEntity.$index }] }),
|
|
50
|
+
__metadata("design:type", Array)
|
|
51
|
+
], ProductEntity.prototype, "files", void 0);
|
|
52
|
+
ProductEntity = __decorate([
|
|
53
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
54
|
+
], ProductEntity);
|
|
55
|
+
exports.ProductEntity = ProductEntity;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AssetEntity } from '../../assets/asset.entity';
|
|
2
|
+
export declare class CreateProductValidator {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
price: number;
|
|
6
|
+
category?: string;
|
|
7
|
+
brand?: string;
|
|
8
|
+
files: AssetEntity[];
|
|
9
|
+
}
|
|
10
|
+
export declare class UpdateProductValidator {
|
|
11
|
+
name?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
price?: any;
|
|
14
|
+
category?: string;
|
|
15
|
+
brand?: string;
|
|
16
|
+
files: any[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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.UpdateProductValidator = exports.CreateProductValidator = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class CreateProductValidator {
|
|
16
|
+
name;
|
|
17
|
+
description;
|
|
18
|
+
price = 0;
|
|
19
|
+
category;
|
|
20
|
+
brand;
|
|
21
|
+
files = [];
|
|
22
|
+
}
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CreateProductValidator.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CreateProductValidator.prototype, "description", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsNumber)(),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], CreateProductValidator.prototype, "price", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsMongoId)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], CreateProductValidator.prototype, "category", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsMongoId)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], CreateProductValidator.prototype, "brand", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_transformer_1.Transform)(({ value }) => value.map(({ _id }) => _id)),
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
__metadata("design:type", Array)
|
|
51
|
+
], CreateProductValidator.prototype, "files", void 0);
|
|
52
|
+
exports.CreateProductValidator = CreateProductValidator;
|
|
53
|
+
class UpdateProductValidator {
|
|
54
|
+
name;
|
|
55
|
+
description;
|
|
56
|
+
price;
|
|
57
|
+
category;
|
|
58
|
+
brand;
|
|
59
|
+
files;
|
|
60
|
+
}
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_validator_1.IsString)(),
|
|
63
|
+
(0, class_validator_1.IsOptional)(),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], UpdateProductValidator.prototype, "name", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsString)(),
|
|
68
|
+
(0, class_validator_1.IsOptional)(),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], UpdateProductValidator.prototype, "description", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsNumber)(),
|
|
73
|
+
(0, class_validator_1.IsOptional)(),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], UpdateProductValidator.prototype, "price", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, class_validator_1.IsOptional)(),
|
|
78
|
+
(0, class_validator_1.IsMongoId)(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], UpdateProductValidator.prototype, "category", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_validator_1.IsOptional)(),
|
|
83
|
+
(0, class_validator_1.IsMongoId)(),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], UpdateProductValidator.prototype, "brand", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_transformer_1.Transform)(({ value }) => value.map(({ _id }) => _id)),
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
__metadata("design:type", Array)
|
|
90
|
+
], UpdateProductValidator.prototype, "files", void 0);
|
|
91
|
+
exports.UpdateProductValidator = UpdateProductValidator;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppEntity } from '../../../configs/app.entity';
|
|
2
|
+
import { PaymentType } from './payment.validator';
|
|
3
|
+
export declare class PaymentEntity extends AppEntity {
|
|
4
|
+
static readonly $index = "settings_payments";
|
|
5
|
+
name: PaymentType;
|
|
6
|
+
active: boolean;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|