@merkaly/api 0.2.2-2 → 0.2.2-20
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.document.d.ts +4 -0
- package/.output/abstract/abstract.document.js +10 -0
- package/.output/abstract/abstract.entity.d.ts +8 -0
- package/.output/abstract/abstract.entity.js +34 -0
- package/.output/abstract/abstract.validator.d.ts +18 -0
- package/.output/abstract/abstract.validator.js +56 -0
- package/.output/modules/assets/asset.entity.d.ts +10 -0
- package/.output/modules/assets/asset.entity.js +52 -0
- package/.output/modules/inventory/brands/brand.document.d.ts +5 -0
- package/.output/modules/inventory/brands/brand.document.js +9 -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.document.d.ts +6 -0
- package/.output/modules/inventory/categories/category.document.js +10 -0
- package/.output/modules/inventory/categories/category.entity.d.ts +9 -0
- package/.output/modules/inventory/categories/category.entity.js +43 -0
- package/.output/modules/inventory/categories/category.validator.d.ts +10 -0
- package/.output/modules/inventory/categories/category.validator.js +55 -0
- package/.output/modules/inventory/products/product.document.d.ts +23 -0
- package/.output/modules/inventory/products/product.document.js +13 -0
- package/.output/modules/inventory/products/product.entity.d.ts +13 -0
- 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/inventory/properties/property.entity.d.ts +7 -0
- package/.output/modules/inventory/properties/property.entity.js +38 -0
- package/.output/modules/inventory/properties/property.validator.d.ts +12 -0
- package/.output/modules/inventory/properties/property.validator.js +50 -0
- package/.output/modules/search/search.validator.d.ts +6 -0
- package/.output/modules/search/search.validator.js +39 -0
- package/.output/{module/organization → modules/settings}/connections/connection.validator.d.ts +0 -0
- package/.output/modules/settings/connections/connection.validator.js +35 -0
- package/.output/{module/organization → modules/settings}/members/member.validator.d.ts +0 -0
- package/.output/modules/settings/members/member.validator.js +3 -0
- package/.output/modules/settings/organization/organization.validator.d.ts +16 -0
- package/.output/modules/settings/organization/organization.validator.js +77 -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/modules/store/orders/item/item.validator.d.ts +4 -0
- package/.output/modules/store/orders/item/item.validator.js +27 -0
- package/.output/modules/store/orders/order.entity.d.ts +16 -0
- package/.output/modules/store/orders/order.entity.js +61 -0
- package/.output/modules/store/orders/order.validator.d.ts +12 -0
- package/.output/modules/store/orders/order.validator.js +48 -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.d.ts +9 -0
- package/.output/types.js +2 -0
- package/package.json +42 -44
- package/.output/config/app.config.d.ts +0 -26
- package/.output/config/app.document.d.ts +0 -10
- 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 -10
- package/.output/main.d.ts +0 -54
- package/.output/module/auth/auth.repository.d.ts +0 -10
- package/.output/module/auth/auth.repository.d.ts.map +0 -1
- package/.output/module/auth/auth.repository.js +0 -46
- package/.output/module/auth/auth.repository.js.map +0 -1
- 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.entity.d.ts +0 -14
- 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/items/item.validator.d.ts +0 -5
- 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.AbstractEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
class AbstractEntity extends mongoose_2.Document {
|
|
16
|
+
static $index;
|
|
17
|
+
_id = String();
|
|
18
|
+
createdAt = null;
|
|
19
|
+
updatedAt = null;
|
|
20
|
+
deletedAt = null;
|
|
21
|
+
}
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
24
|
+
__metadata("design:type", Date)
|
|
25
|
+
], AbstractEntity.prototype, "createdAt", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
28
|
+
__metadata("design:type", Date)
|
|
29
|
+
], AbstractEntity.prototype, "updatedAt", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
32
|
+
__metadata("design:type", Date)
|
|
33
|
+
], AbstractEntity.prototype, "deletedAt", void 0);
|
|
34
|
+
exports.AbstractEntity = AbstractEntity;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PopulateOptions, QuerySelector, SortOrder } from 'mongoose';
|
|
2
|
+
import { AbstractEntity } from './abstract.entity';
|
|
3
|
+
export interface SearchResults<I> {
|
|
4
|
+
page: number;
|
|
5
|
+
total: number;
|
|
6
|
+
items: I[];
|
|
7
|
+
}
|
|
8
|
+
export declare class FindValidator<E extends AbstractEntity> {
|
|
9
|
+
limit?: number;
|
|
10
|
+
page?: number;
|
|
11
|
+
sort?: {
|
|
12
|
+
[x: string]: SortOrder;
|
|
13
|
+
};
|
|
14
|
+
filters?: {
|
|
15
|
+
[x: string]: string | QuerySelector<any>;
|
|
16
|
+
};
|
|
17
|
+
join?: (keyof E | string | PopulateOptions)[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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.FindValidator = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class FindValidator {
|
|
16
|
+
limit = 10;
|
|
17
|
+
page = 1;
|
|
18
|
+
sort = {};
|
|
19
|
+
filters = {};
|
|
20
|
+
join;
|
|
21
|
+
}
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_transformer_1.Transform)(({ value }) => value ? Number(value) : 10),
|
|
24
|
+
(0, class_validator_1.IsInt)(),
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
__metadata("design:type", Object)
|
|
27
|
+
], FindValidator.prototype, "limit", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Transform)(({ value }) => value ? Number(value) : 1),
|
|
30
|
+
(0, class_validator_1.IsInt)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], FindValidator.prototype, "page", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_transformer_1.Transform)(({ value }) => value && JSON.parse(value)),
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], FindValidator.prototype, "sort", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_transformer_1.Transform)(({ value }) => value && JSON.parse(value)),
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], FindValidator.prototype, "filters", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_transformer_1.Transform)(({ value }) => value.map((path) => {
|
|
46
|
+
try {
|
|
47
|
+
return JSON.parse(path);
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
return path;
|
|
51
|
+
}
|
|
52
|
+
})),
|
|
53
|
+
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
__metadata("design:type", Array)
|
|
55
|
+
], FindValidator.prototype, "join", void 0);
|
|
56
|
+
exports.FindValidator = FindValidator;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractEntity } from '../../abstract/abstract.entity';
|
|
2
|
+
export declare class AssetEntity extends AbstractEntity {
|
|
3
|
+
static readonly $index = "assets";
|
|
4
|
+
name: string;
|
|
5
|
+
url: string;
|
|
6
|
+
weak: boolean;
|
|
7
|
+
description: string;
|
|
8
|
+
type: string;
|
|
9
|
+
size: number;
|
|
10
|
+
}
|
|
@@ -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 abstract_entity_1 = require("../../abstract/abstract.entity");
|
|
16
|
+
let AssetEntity = class AssetEntity extends abstract_entity_1.AbstractEntity {
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrandDocument = void 0;
|
|
4
|
+
const abstract_document_1 = require("../../../abstract/abstract.document");
|
|
5
|
+
class BrandDocument extends abstract_document_1.AbstractDocument {
|
|
6
|
+
name = String();
|
|
7
|
+
description = String();
|
|
8
|
+
}
|
|
9
|
+
exports.BrandDocument = BrandDocument;
|
|
@@ -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 abstract_entity_1 = require("../../../abstract/abstract.entity");
|
|
16
|
+
let BrandEntity = class BrandEntity extends abstract_entity_1.AbstractEntity {
|
|
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,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CategoryDocument = void 0;
|
|
4
|
+
const abstract_document_1 = require("../../../abstract/abstract.document");
|
|
5
|
+
class CategoryDocument extends abstract_document_1.AbstractDocument {
|
|
6
|
+
name = String();
|
|
7
|
+
description = String();
|
|
8
|
+
icon = String();
|
|
9
|
+
}
|
|
10
|
+
exports.CategoryDocument = CategoryDocument;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
2
|
+
import { PropertyEntity } from '../properties/property.entity';
|
|
3
|
+
export declare class CategoryEntity extends AbstractEntity {
|
|
4
|
+
static readonly $index = "inventory_categories";
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
properties: PropertyEntity[];
|
|
9
|
+
}
|
|
@@ -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.CategoryEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const abstract_entity_1 = require("../../../abstract/abstract.entity");
|
|
16
|
+
const property_entity_1 = require("../properties/property.entity");
|
|
17
|
+
let CategoryEntity = class CategoryEntity extends abstract_entity_1.AbstractEntity {
|
|
18
|
+
static $index = 'inventory_categories';
|
|
19
|
+
name;
|
|
20
|
+
description;
|
|
21
|
+
icon;
|
|
22
|
+
properties = [];
|
|
23
|
+
};
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, length: 32, unique: true, required: true }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CategoryEntity.prototype, "name", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CategoryEntity.prototype, "description", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, length: 32, default: 'tag' }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], CategoryEntity.prototype, "icon", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, mongoose_1.Prop)({ type: [{ type: mongoose_2.Types.ObjectId, ref: property_entity_1.PropertyEntity.$index }] }),
|
|
38
|
+
__metadata("design:type", Array)
|
|
39
|
+
], CategoryEntity.prototype, "properties", void 0);
|
|
40
|
+
CategoryEntity = __decorate([
|
|
41
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
42
|
+
], CategoryEntity);
|
|
43
|
+
exports.CategoryEntity = CategoryEntity;
|
|
@@ -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.UpdateCategoryValidator = exports.CreateCategoryValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CreateCategoryValidator {
|
|
15
|
+
name;
|
|
16
|
+
description;
|
|
17
|
+
icon = 'tag';
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
(0, class_validator_1.Length)(5, 32),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], CreateCategoryValidator.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CreateCategoryValidator.prototype, "description", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], CreateCategoryValidator.prototype, "icon", void 0);
|
|
34
|
+
exports.CreateCategoryValidator = CreateCategoryValidator;
|
|
35
|
+
class UpdateCategoryValidator {
|
|
36
|
+
name;
|
|
37
|
+
description;
|
|
38
|
+
icon = 'tag';
|
|
39
|
+
}
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], UpdateCategoryValidator.prototype, "name", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsString)(),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], UpdateCategoryValidator.prototype, "description", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsString)(),
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], UpdateCategoryValidator.prototype, "icon", void 0);
|
|
55
|
+
exports.UpdateCategoryValidator = UpdateCategoryValidator;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AbstractDocument } from '../../../abstract/abstract.document';
|
|
2
|
+
export declare class ProductDocument extends AbstractDocument {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
price: number;
|
|
6
|
+
brand?: ProductBrand;
|
|
7
|
+
category?: ProductCategory;
|
|
8
|
+
files: ProductFile[];
|
|
9
|
+
}
|
|
10
|
+
interface ProductCategory {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
interface ProductBrand {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
interface ProductFile {
|
|
19
|
+
id: string;
|
|
20
|
+
url: string;
|
|
21
|
+
alt: string;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductDocument = void 0;
|
|
4
|
+
const abstract_document_1 = require("../../../abstract/abstract.document");
|
|
5
|
+
class ProductDocument extends abstract_document_1.AbstractDocument {
|
|
6
|
+
name = String();
|
|
7
|
+
description = String();
|
|
8
|
+
price = Number();
|
|
9
|
+
brand;
|
|
10
|
+
category;
|
|
11
|
+
files = [];
|
|
12
|
+
}
|
|
13
|
+
exports.ProductDocument = ProductDocument;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
2
|
+
import { AssetEntity } from '../../assets/asset.entity';
|
|
3
|
+
import { BrandEntity } from '../brands/brand.entity';
|
|
4
|
+
import { CategoryEntity } from '../categories/category.entity';
|
|
5
|
+
export declare class ProductEntity extends AbstractEntity {
|
|
6
|
+
static readonly $index = "inventory_products";
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
price: number;
|
|
10
|
+
category?: CategoryEntity;
|
|
11
|
+
brand?: BrandEntity;
|
|
12
|
+
files: AssetEntity[];
|
|
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 abstract_entity_1 = require("../../../abstract/abstract.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 abstract_entity_1.AbstractEntity {
|
|
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
|
+
}
|