@merkaly/api 0.3.0 → 0.3.3
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/dist/abstract.entity.d.ts +11 -0
- package/dist/abstract.entity.js +45 -0
- package/dist/abstract.repository.d.ts +56 -0
- package/dist/abstract.repository.js +200 -0
- package/dist/abstract.validator.d.ts +22 -0
- package/dist/abstract.validator.js +98 -0
- package/dist/account/address/address.entity.d.ts +3 -3
- package/dist/account/address/address.entity.js +34 -0
- package/dist/account/address/address.validator.d.ts +2 -2
- package/dist/account/address/address.validator.js +67 -0
- package/dist/account/address/index.d.ts +2 -2
- package/dist/account/address/index.js +10 -0
- package/dist/account/cart/cart.entity.d.ts +8 -0
- package/dist/account/cart/cart.entity.js +34 -0
- package/dist/account/cart/cart.validator.d.ts +13 -0
- package/dist/account/cart/cart.validator.js +45 -0
- package/dist/account/cart/index.d.ts +2 -0
- package/dist/account/cart/index.js +12 -0
- package/dist/account/payment/index.d.ts +2 -0
- package/dist/account/payment/index.js +12 -0
- package/dist/account/payment/payment.entity.d.ts +11 -0
- package/dist/account/payment/payment.entity.js +57 -0
- package/dist/account/payment/payment.validator.d.ts +15 -0
- package/dist/account/payment/payment.validator.js +57 -0
- package/dist/account/user/index.d.ts +2 -2
- package/dist/account/user/index.js +10 -0
- package/dist/account/user/user.entity.d.ts +1 -1
- package/dist/account/user/user.entity.js +46 -0
- package/dist/account/user/user.validator.d.ts +2 -2
- package/dist/account/user/user.validator.js +68 -0
- package/dist/account/wishlist/index.d.ts +2 -0
- package/dist/account/wishlist/index.js +12 -0
- package/dist/account/wishlist/wishlist.entity.d.ts +8 -0
- package/dist/account/wishlist/wishlist.entity.js +38 -0
- package/dist/account/wishlist/wishlist.validator.d.ts +12 -0
- package/dist/account/wishlist/wishlist.validator.js +39 -0
- package/dist/address.entity.d.ts +14 -0
- package/dist/address.entity.js +59 -0
- package/dist/assets/asset/asset.entity.d.ts +11 -0
- package/dist/assets/asset/asset.entity.js +58 -0
- package/dist/assets/asset/asset.enum.d.ts +6 -0
- package/dist/assets/asset/asset.enum.js +11 -0
- package/dist/assets/asset/index.d.ts +2 -0
- package/dist/assets/asset/index.js +12 -0
- package/dist/billing/payment/index.d.ts +2 -2
- package/dist/billing/payment/index.js +10 -3
- package/dist/billing/payment/payment.enum.d.ts +2 -2
- package/dist/billing/payment/payment.enum.js +18 -18
- package/dist/billing/payment/transaction.entity.d.ts +9 -9
- package/dist/billing/payment/transaction.entity.js +55 -0
- package/dist/billing/status/index.d.ts +1 -1
- package/dist/billing/status/index.js +5 -0
- package/dist/billing/status/status.entity.d.ts +5 -5
- package/dist/billing/status/status.entity.js +40 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/inventory/catalog/attribute/attribute.entity.d.ts +1 -1
- package/dist/inventory/catalog/attribute/attribute.entity.js +47 -0
- package/dist/inventory/catalog/attribute/attribute.validator.d.ts +2 -2
- package/dist/inventory/catalog/attribute/attribute.validator.js +58 -0
- package/dist/inventory/catalog/attribute/index.d.ts +2 -2
- package/dist/inventory/catalog/attribute/index.js +10 -0
- package/dist/inventory/catalog/brand/brand.entity.d.ts +2 -2
- package/dist/inventory/catalog/brand/brand.entity.js +33 -0
- package/dist/inventory/catalog/brand/brand.validator.d.ts +2 -2
- package/dist/inventory/catalog/brand/brand.validator.js +39 -0
- package/dist/inventory/catalog/brand/index.d.ts +2 -2
- package/dist/inventory/catalog/brand/index.js +10 -0
- package/dist/inventory/catalog/category/category.entity.d.ts +2 -2
- package/dist/inventory/catalog/category/category.entity.js +33 -0
- package/dist/inventory/catalog/category/category.validator.d.ts +2 -2
- package/dist/inventory/catalog/category/category.validator.js +39 -0
- package/dist/inventory/catalog/category/index.d.ts +2 -2
- package/dist/inventory/catalog/category/index.js +10 -0
- package/dist/inventory/catalog/collection/collection.entity.d.ts +2 -2
- package/dist/inventory/catalog/collection/collection.entity.js +42 -0
- package/dist/inventory/catalog/collection/collection.validator.d.ts +2 -2
- package/dist/inventory/catalog/collection/collection.validator.js +45 -0
- package/dist/inventory/catalog/collection/index.d.ts +2 -2
- package/dist/inventory/catalog/collection/index.js +10 -0
- package/dist/inventory/catalog/product/index.d.ts +3 -3
- package/dist/inventory/catalog/product/index.js +15 -2
- package/dist/inventory/catalog/product/product.entity.d.ts +10 -10
- package/dist/inventory/catalog/product/product.entity.js +115 -0
- package/dist/inventory/catalog/product/product.validator.d.ts +4 -4
- package/dist/inventory/catalog/product/product.validator.js +135 -0
- package/dist/inventory/configuration/label/index.d.ts +2 -2
- package/dist/inventory/configuration/label/index.js +10 -0
- package/dist/inventory/configuration/label/label.entity.d.ts +1 -1
- package/dist/inventory/configuration/label/label.entity.js +42 -0
- package/dist/inventory/configuration/label/label.validator.d.ts +2 -2
- package/dist/inventory/configuration/label/label.validator.js +51 -0
- package/dist/inventory/configuration/measurement/index.d.ts +2 -1
- package/dist/inventory/configuration/measurement/index.js +10 -0
- package/dist/inventory/configuration/measurement/measurement.entity.d.ts +4 -4
- package/dist/inventory/configuration/measurement/measurement.entity.js +42 -0
- package/dist/inventory/configuration/measurement/measurement.validator.d.ts +21 -0
- package/dist/inventory/configuration/measurement/measurement.validator.js +87 -0
- package/dist/inventory/configuration/unit/index.d.ts +1 -1
- package/dist/inventory/configuration/unit/index.js +5 -0
- package/dist/inventory/configuration/unit/unit.entity.d.ts +2 -2
- package/dist/inventory/configuration/unit/unit.entity.js +46 -0
- package/dist/inventory/stock/backorder/backorder.entity.d.ts +5 -5
- package/dist/inventory/stock/backorder/backorder.entity.js +106 -0
- package/dist/inventory/stock/backorder/backorder.validator.d.ts +2 -2
- package/dist/inventory/stock/backorder/backorder.validator.js +112 -0
- package/dist/inventory/stock/backorder/index.d.ts +2 -2
- package/dist/inventory/stock/backorder/index.js +10 -0
- package/dist/inventory/stock/transfer/index.d.ts +2 -2
- package/dist/inventory/stock/transfer/index.js +10 -0
- package/dist/inventory/stock/transfer/transfer.entity.d.ts +6 -6
- package/dist/inventory/stock/transfer/transfer.entity.js +108 -0
- package/dist/inventory/stock/transfer/transfer.validator.d.ts +4 -4
- package/dist/inventory/stock/transfer/transfer.validator.js +108 -0
- package/dist/inventory/stock/warehouse/index.d.ts +2 -2
- package/dist/inventory/stock/warehouse/index.js +10 -0
- package/dist/inventory/stock/warehouse/warehouse.entity.d.ts +1 -1
- package/dist/inventory/stock/warehouse/warehouse.entity.js +67 -0
- package/dist/inventory/stock/warehouse/warehouse.validator.d.ts +4 -4
- package/dist/inventory/stock/warehouse/warehouse.validator.js +115 -0
- package/dist/logistic/carrier/carrier.entity.d.ts +1 -1
- package/dist/logistic/carrier/carrier.entity.js +57 -0
- package/dist/logistic/carrier/carrier.validator.d.ts +2 -2
- package/dist/logistic/carrier/carrier.validator.js +69 -0
- package/dist/logistic/carrier/index.d.ts +2 -2
- package/dist/logistic/carrier/index.js +10 -0
- package/dist/logistic/shipment/index.d.ts +3 -3
- package/dist/logistic/shipment/index.js +15 -3
- package/dist/logistic/shipment/shipment.entity.d.ts +11 -11
- package/dist/logistic/shipment/shipment.entity.js +67 -0
- package/dist/logistic/shipment/shipment.enum.d.ts +2 -2
- package/dist/logistic/shipment/shipment.enum.js +19 -19
- package/dist/logistic/shipment/shipment.validator.d.ts +8 -8
- package/dist/logistic/shipment/shipment.validator.js +65 -0
- package/dist/order/purchase/item/index.d.ts +2 -2
- package/dist/order/purchase/item/index.js +10 -0
- package/dist/order/purchase/item/item.entity.d.ts +3 -3
- package/dist/order/purchase/item/item.entity.js +46 -0
- package/dist/order/purchase/item/item.validator.d.ts +1 -1
- package/dist/order/purchase/item/item.validator.js +41 -0
- package/dist/order/purchase/transaction/index.d.ts +3 -3
- package/dist/order/purchase/transaction/index.js +15 -2
- package/dist/order/purchase/transaction/transaction.entity.d.ts +6 -6
- package/dist/order/purchase/transaction/transaction.entity.js +67 -0
- package/dist/order/purchase/transaction/transaction.validator.d.ts +4 -4
- package/dist/order/purchase/transaction/transaction.validator.js +87 -0
- package/dist/order/purchase/vendor/index.d.ts +2 -2
- package/dist/order/purchase/vendor/index.js +10 -0
- package/dist/order/purchase/vendor/vendor.entity.d.ts +1 -1
- package/dist/order/purchase/vendor/vendor.entity.js +62 -0
- package/dist/order/purchase/vendor/vendor.validator.d.ts +2 -2
- package/dist/order/purchase/vendor/vendor.validator.js +75 -0
- package/dist/order/sale/address/address.validator.d.ts +11 -0
- package/dist/order/sale/address/address.validator.js +70 -0
- package/dist/order/sale/address/index.d.ts +1 -0
- package/dist/order/sale/address/index.js +7 -0
- package/dist/order/sale/customer/customer.entity.d.ts +1 -1
- package/dist/order/sale/customer/customer.entity.js +62 -0
- package/dist/order/sale/customer/customer.validator.d.ts +2 -2
- package/dist/order/sale/customer/customer.validator.js +77 -0
- package/dist/order/sale/customer/index.d.ts +2 -2
- package/dist/order/sale/customer/index.js +10 -0
- package/dist/order/sale/item/index.d.ts +2 -2
- package/dist/order/sale/item/index.js +10 -0
- package/dist/order/sale/item/item.entity.d.ts +3 -3
- package/dist/order/sale/item/item.entity.js +45 -0
- package/dist/order/sale/item/item.validator.d.ts +1 -1
- package/dist/order/sale/item/item.validator.js +34 -0
- package/dist/order/sale/payment/index.d.ts +1 -0
- package/dist/order/sale/payment/index.js +7 -0
- package/dist/order/sale/payment/payment.validator.d.ts +16 -0
- package/dist/order/sale/payment/payment.validator.js +51 -0
- package/dist/order/sale/transaction/index.d.ts +3 -3
- package/dist/order/sale/transaction/index.js +15 -2
- package/dist/order/sale/transaction/transaction.entity.d.ts +11 -11
- package/dist/order/sale/transaction/transaction.entity.js +56 -0
- package/dist/order/sale/transaction/transaction.enum.d.ts +1 -1
- package/dist/order/sale/transaction/transaction.enum.js +10 -10
- package/dist/order/sale/transaction/transaction.validator.d.ts +8 -8
- package/dist/order/sale/transaction/transaction.validator.js +76 -0
- package/dist/repository.types.d.ts +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
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 = exports.ReadCategoryValidator = exports.SearchCategoryValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const abstract_validator_1 = require("../../../../infrastructure/abstracts/abstract.validator");
|
|
15
|
+
class SearchCategoryValidator extends abstract_validator_1.SearchValidator {
|
|
16
|
+
}
|
|
17
|
+
exports.SearchCategoryValidator = SearchCategoryValidator;
|
|
18
|
+
class ReadCategoryValidator extends abstract_validator_1.ReadValidator {
|
|
19
|
+
}
|
|
20
|
+
exports.ReadCategoryValidator = ReadCategoryValidator;
|
|
21
|
+
class CreateCategoryValidator extends abstract_validator_1.AbstractValidator {
|
|
22
|
+
name;
|
|
23
|
+
description;
|
|
24
|
+
}
|
|
25
|
+
exports.CreateCategoryValidator = CreateCategoryValidator;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], CreateCategoryValidator.prototype, "name", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsString)(),
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], CreateCategoryValidator.prototype, "description", void 0);
|
|
36
|
+
class UpdateCategoryValidator extends CreateCategoryValidator {
|
|
37
|
+
}
|
|
38
|
+
exports.UpdateCategoryValidator = UpdateCategoryValidator;
|
|
39
|
+
//# sourceMappingURL=category.validator.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './category.entity';
|
|
2
|
+
export * from './category.validator';
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var category_entity_1 = require("./category.entity");
|
|
4
|
+
Object.keys(category_entity_1).forEach(function (key) {
|
|
5
|
+
if (key === "default" || key === "__esModule") return;
|
|
6
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return category_entity_1[key]; } });
|
|
7
|
+
});
|
|
8
|
+
var category_validator_1 = require("./category.validator");
|
|
9
|
+
Object.keys(category_validator_1).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return category_validator_1[key]; } });
|
|
12
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractEntity, type MongoEntity } from '
|
|
2
|
-
import { CatalogProductEntity } from '
|
|
1
|
+
import { AbstractEntity, type MongoEntity } from '../../..';
|
|
2
|
+
import { CatalogProductEntity } from '../product';
|
|
3
3
|
export declare class CatalogCollectionEntity extends AbstractEntity {
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
@@ -0,0 +1,42 @@
|
|
|
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.CatalogCollectionEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const product_schema_1 = require("../schemas/product.schema");
|
|
16
|
+
const abstract_entity_1 = require("../../../../infrastructure/abstracts/abstract.entity");
|
|
17
|
+
let CatalogCollectionEntity = class CatalogCollectionEntity extends abstract_entity_1.AbstractEntity {
|
|
18
|
+
name;
|
|
19
|
+
description;
|
|
20
|
+
products = [];
|
|
21
|
+
};
|
|
22
|
+
exports.CatalogCollectionEntity = CatalogCollectionEntity;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, mongoose_1.Prop)({ length: 32, required: true, trim: true, type: mongoose_2.Schema.Types.String, unique: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CatalogCollectionEntity.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: '' }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], CatalogCollectionEntity.prototype, "description", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, mongoose_1.Prop)({
|
|
33
|
+
default: [],
|
|
34
|
+
ref: product_schema_1.InventoryCatalogProductSchema.name,
|
|
35
|
+
type: [{ type: mongoose_2.Schema.Types.ObjectId }],
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", Array)
|
|
38
|
+
], CatalogCollectionEntity.prototype, "products", void 0);
|
|
39
|
+
exports.CatalogCollectionEntity = CatalogCollectionEntity = __decorate([
|
|
40
|
+
(0, mongoose_1.Schema)(abstract_entity_1.$collection)
|
|
41
|
+
], CatalogCollectionEntity);
|
|
42
|
+
//# sourceMappingURL=collection.entity.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CatalogCollectionEntity } from '
|
|
2
|
-
import { AbstractValidator, ReadValidator, SearchValidator } from '
|
|
1
|
+
import { CatalogCollectionEntity } from './';
|
|
2
|
+
import { AbstractValidator, ReadValidator, SearchValidator } from '../../..';
|
|
3
3
|
export declare class SearchCollectionValidator extends SearchValidator<CatalogCollectionEntity> {
|
|
4
4
|
}
|
|
5
5
|
export declare class ReadCollectionValidator extends ReadValidator<CatalogCollectionEntity> {
|
|
@@ -0,0 +1,45 @@
|
|
|
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.UpdateCollectionValidator = exports.CreateCollectionValidator = exports.ReadCollectionValidator = exports.SearchCollectionValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const abstract_validator_1 = require("../../../../infrastructure/abstracts/abstract.validator");
|
|
15
|
+
class SearchCollectionValidator extends abstract_validator_1.SearchValidator {
|
|
16
|
+
}
|
|
17
|
+
exports.SearchCollectionValidator = SearchCollectionValidator;
|
|
18
|
+
class ReadCollectionValidator extends abstract_validator_1.ReadValidator {
|
|
19
|
+
}
|
|
20
|
+
exports.ReadCollectionValidator = ReadCollectionValidator;
|
|
21
|
+
class CreateCollectionValidator extends abstract_validator_1.AbstractValidator {
|
|
22
|
+
name;
|
|
23
|
+
description;
|
|
24
|
+
products = [];
|
|
25
|
+
}
|
|
26
|
+
exports.CreateCollectionValidator = CreateCollectionValidator;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CreateCollectionValidator.prototype, "name", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CreateCollectionValidator.prototype, "description", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsMongoId)({ each: true }),
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
__metadata("design:type", Array)
|
|
41
|
+
], CreateCollectionValidator.prototype, "products", void 0);
|
|
42
|
+
class UpdateCollectionValidator extends CreateCollectionValidator {
|
|
43
|
+
}
|
|
44
|
+
exports.UpdateCollectionValidator = UpdateCollectionValidator;
|
|
45
|
+
//# sourceMappingURL=collection.validator.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './collection.entity';
|
|
2
|
+
export * from './collection.validator';
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var collection_entity_1 = require("./collection.entity");
|
|
4
|
+
Object.keys(collection_entity_1).forEach(function (key) {
|
|
5
|
+
if (key === "default" || key === "__esModule") return;
|
|
6
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return collection_entity_1[key]; } });
|
|
7
|
+
});
|
|
8
|
+
var collection_validator_1 = require("./collection.validator");
|
|
9
|
+
Object.keys(collection_validator_1).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return collection_validator_1[key]; } });
|
|
12
|
+
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './product.entity';
|
|
2
|
+
export * from './product.validator';
|
|
3
|
+
export * from './product.status.enum';
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
3
|
+
var product_entity_1 = require("./product.entity");
|
|
4
|
+
Object.keys(product_entity_1).forEach(function (key) {
|
|
5
|
+
if (key === "default" || key === "__esModule") return;
|
|
6
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return product_entity_1[key]; } });
|
|
7
|
+
});
|
|
8
|
+
var product_validator_1 = require("./product.validator");
|
|
9
|
+
Object.keys(product_validator_1).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return product_validator_1[key]; } });
|
|
12
|
+
});
|
|
13
|
+
var product_status_enum_1 = require("./product.status.enum");
|
|
14
|
+
Object.keys(product_status_enum_1).forEach(function (key) {
|
|
15
|
+
if (key === "default" || key === "__esModule") return;
|
|
16
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return product_status_enum_1[key]; } });
|
|
17
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AccountWishlistEntity } from '
|
|
2
|
-
import { AssetEntity } from '
|
|
3
|
-
import { CatalogProductStatus } from '
|
|
4
|
-
import { AbstractEntity } from '
|
|
5
|
-
import { CatalogAttributeEntity } from '
|
|
6
|
-
import type { CatalogBrandEntity } from '
|
|
7
|
-
import type { CatalogCategoryEntity } from '
|
|
8
|
-
import type {
|
|
9
|
-
import type { MongoEntity } from '
|
|
1
|
+
import { AccountWishlistEntity } from '../../../account/wishlist';
|
|
2
|
+
import { AssetEntity } from '../../../assets/asset';
|
|
3
|
+
import { CatalogProductStatus } from './';
|
|
4
|
+
import { AbstractEntity } from '../../..';
|
|
5
|
+
import { CatalogAttributeEntity } from '../attribute';
|
|
6
|
+
import type { CatalogBrandEntity } from '../brand';
|
|
7
|
+
import type { CatalogCategoryEntity } from '../category';
|
|
8
|
+
import type { ConfigurationMeasurementEntity } from '../../configuration/measurement';
|
|
9
|
+
import type { MongoEntity } from '../../..';
|
|
10
10
|
export declare class CatalogProductEntity extends AbstractEntity {
|
|
11
11
|
sku?: string;
|
|
12
12
|
name: string;
|
|
@@ -21,7 +21,7 @@ export declare class CatalogProductEntity extends AbstractEntity {
|
|
|
21
21
|
}[];
|
|
22
22
|
measure?: {
|
|
23
23
|
amount: number;
|
|
24
|
-
kind: MongoEntity<
|
|
24
|
+
kind: MongoEntity<ConfigurationMeasurementEntity>;
|
|
25
25
|
unit: string;
|
|
26
26
|
};
|
|
27
27
|
hashtags: string[];
|
|
@@ -0,0 +1,115 @@
|
|
|
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.CatalogProductEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const asset_schema_1 = require("../../../assets/schemas/asset.schema");
|
|
16
|
+
const product_status_enum_1 = require("../enums/product.status.enum");
|
|
17
|
+
const attribute_schema_1 = require("../schemas/attribute.schema");
|
|
18
|
+
const brand_schema_1 = require("../schemas/brand.schema");
|
|
19
|
+
const category_schema_1 = require("../schemas/category.schema");
|
|
20
|
+
const measurement_schema_1 = require("../../configuration/schemas/measurement.schema");
|
|
21
|
+
const abstract_entity_1 = require("../../../../infrastructure/abstracts/abstract.entity");
|
|
22
|
+
let CatalogProductEntity = class CatalogProductEntity extends abstract_entity_1.AbstractEntity {
|
|
23
|
+
sku;
|
|
24
|
+
name;
|
|
25
|
+
description;
|
|
26
|
+
price;
|
|
27
|
+
pictures = [];
|
|
28
|
+
category;
|
|
29
|
+
brand;
|
|
30
|
+
attributes = [];
|
|
31
|
+
measure;
|
|
32
|
+
hashtags = [];
|
|
33
|
+
status;
|
|
34
|
+
stock;
|
|
35
|
+
wishlist = [];
|
|
36
|
+
};
|
|
37
|
+
exports.CatalogProductEntity = CatalogProductEntity;
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, mongoose_1.Prop)({ trim: true, unique: true, sparse: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], CatalogProductEntity.prototype, "sku", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, mongoose_1.Prop)({ required: true, trim: true }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], CatalogProductEntity.prototype, "name", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, mongoose_1.Prop)({ default: '', trim: true }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], CatalogProductEntity.prototype, "description", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, mongoose_1.Prop)({
|
|
52
|
+
default: 0,
|
|
53
|
+
min: 0,
|
|
54
|
+
type: mongoose_2.Schema.Types.Number,
|
|
55
|
+
validate: { validator: Number.isInteger },
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], CatalogProductEntity.prototype, "price", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, mongoose_1.Prop)({ default: [], ref: asset_schema_1.AssetSchema.name, type: [{ type: mongoose_2.Schema.Types.ObjectId }] }),
|
|
61
|
+
__metadata("design:type", Array)
|
|
62
|
+
], CatalogProductEntity.prototype, "pictures", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, mongoose_1.Prop)({ ref: category_schema_1.InventoryCatalogCategorySchema.name, type: mongoose_2.Schema.Types.ObjectId }),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], CatalogProductEntity.prototype, "category", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, mongoose_1.Prop)({ ref: brand_schema_1.InventoryCatalogBrandSchema.name, type: mongoose_2.Schema.Types.ObjectId }),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], CatalogProductEntity.prototype, "brand", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, mongoose_1.Prop)({
|
|
73
|
+
_id: false,
|
|
74
|
+
default: () => ({}),
|
|
75
|
+
required: true,
|
|
76
|
+
type: [
|
|
77
|
+
{
|
|
78
|
+
content: { required: true, type: mongoose_2.Schema.Types.Mixed },
|
|
79
|
+
relation: { ref: attribute_schema_1.InventoryCatalogAttributeSchema.name, type: mongoose_2.Schema.Types.ObjectId },
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:type", Array)
|
|
84
|
+
], CatalogProductEntity.prototype, "attributes", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, mongoose_1.Prop)({
|
|
87
|
+
_id: false,
|
|
88
|
+
default: () => ({}),
|
|
89
|
+
type: {
|
|
90
|
+
amount: { default: 0, min: 0, type: mongoose_2.Schema.Types.Number },
|
|
91
|
+
kind: {
|
|
92
|
+
ref: measurement_schema_1.ConfigurationMeasurementSchema.name,
|
|
93
|
+
type: mongoose_2.Schema.Types.ObjectId,
|
|
94
|
+
},
|
|
95
|
+
unit: { type: mongoose_2.Schema.Types.String },
|
|
96
|
+
},
|
|
97
|
+
}),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], CatalogProductEntity.prototype, "measure", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
102
|
+
__metadata("design:type", Array)
|
|
103
|
+
], CatalogProductEntity.prototype, "hashtags", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, mongoose_1.Prop)({ default: product_status_enum_1.CatalogProductStatus.Draft, enum: product_status_enum_1.CatalogProductStatus }),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], CatalogProductEntity.prototype, "status", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, mongoose_1.Prop)({ default: 0, min: 0, type: mongoose_2.Schema.Types.Number }),
|
|
110
|
+
__metadata("design:type", Number)
|
|
111
|
+
], CatalogProductEntity.prototype, "stock", void 0);
|
|
112
|
+
exports.CatalogProductEntity = CatalogProductEntity = __decorate([
|
|
113
|
+
(0, mongoose_1.Schema)(abstract_entity_1.$collection)
|
|
114
|
+
], CatalogProductEntity);
|
|
115
|
+
//# sourceMappingURL=product.entity.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CatalogProductEntity } from '
|
|
2
|
-
import { CatalogProductStatus } from '
|
|
3
|
-
import { AbstractValidator, ReadValidator, SearchValidator } from '
|
|
1
|
+
import { CatalogProductEntity } from './';
|
|
2
|
+
import { CatalogProductStatus } from './';
|
|
3
|
+
import { AbstractValidator, ReadValidator, SearchValidator } from '../../..';
|
|
4
4
|
export declare class SearchProductValidator extends SearchValidator<CatalogProductEntity> {
|
|
5
5
|
}
|
|
6
6
|
export declare class ReadProductValidator extends ReadValidator<CatalogProductEntity> {
|
|
7
7
|
}
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class CatalogProductAttributeValidator extends AbstractValidator {
|
|
9
9
|
relation: string;
|
|
10
10
|
content: string;
|
|
11
11
|
required: boolean;
|
|
@@ -0,0 +1,135 @@
|
|
|
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 = exports.CatalogProductAttributeValidator = exports.ReadProductValidator = exports.SearchProductValidator = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const product_status_enum_1 = require("../enums/product.status.enum");
|
|
16
|
+
const abstract_validator_1 = require("../../../../infrastructure/abstracts/abstract.validator");
|
|
17
|
+
class SearchProductValidator extends abstract_validator_1.SearchValidator {
|
|
18
|
+
}
|
|
19
|
+
exports.SearchProductValidator = SearchProductValidator;
|
|
20
|
+
class ReadProductValidator extends abstract_validator_1.ReadValidator {
|
|
21
|
+
}
|
|
22
|
+
exports.ReadProductValidator = ReadProductValidator;
|
|
23
|
+
class CatalogProductAttributeValidator extends abstract_validator_1.AbstractValidator {
|
|
24
|
+
relation;
|
|
25
|
+
content;
|
|
26
|
+
required = false;
|
|
27
|
+
}
|
|
28
|
+
exports.CatalogProductAttributeValidator = CatalogProductAttributeValidator;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsMongoId)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CatalogProductAttributeValidator.prototype, "relation", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CatalogProductAttributeValidator.prototype, "content", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsBoolean)(),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], CatalogProductAttributeValidator.prototype, "required", void 0);
|
|
41
|
+
class CreateProductValidator extends abstract_validator_1.AbstractValidator {
|
|
42
|
+
sku;
|
|
43
|
+
name;
|
|
44
|
+
description;
|
|
45
|
+
price;
|
|
46
|
+
measure;
|
|
47
|
+
pictures = [];
|
|
48
|
+
stock = 0;
|
|
49
|
+
category;
|
|
50
|
+
brand;
|
|
51
|
+
hashtags = [];
|
|
52
|
+
attributes = [];
|
|
53
|
+
status = product_status_enum_1.CatalogProductStatus.Draft;
|
|
54
|
+
}
|
|
55
|
+
exports.CreateProductValidator = CreateProductValidator;
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_validator_1.IsString)(),
|
|
58
|
+
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], CreateProductValidator.prototype, "sku", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_validator_1.IsString)(),
|
|
63
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], CreateProductValidator.prototype, "name", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsString)(),
|
|
68
|
+
(0, class_validator_1.IsOptional)(),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], CreateProductValidator.prototype, "description", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsPositive)(),
|
|
73
|
+
__metadata("design:type", Number)
|
|
74
|
+
], CreateProductValidator.prototype, "price", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, class_validator_1.IsNotEmptyObject)(),
|
|
77
|
+
(0, class_validator_1.IsOptional)(),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], CreateProductValidator.prototype, "measure", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, class_validator_1.IsMongoId)({ each: true }),
|
|
82
|
+
(0, class_validator_1.IsArray)(),
|
|
83
|
+
(0, class_validator_1.IsOptional)(),
|
|
84
|
+
__metadata("design:type", Array)
|
|
85
|
+
], CreateProductValidator.prototype, "pictures", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.IsOptional)(),
|
|
88
|
+
__metadata("design:type", Object)
|
|
89
|
+
], CreateProductValidator.prototype, "stock", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, class_validator_1.IsOptional)(),
|
|
92
|
+
(0, class_validator_1.IsMongoId)(),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], CreateProductValidator.prototype, "category", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, class_validator_1.IsOptional)(),
|
|
97
|
+
(0, class_validator_1.IsMongoId)(),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], CreateProductValidator.prototype, "brand", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, class_validator_1.IsOptional)(),
|
|
102
|
+
(0, class_validator_1.IsArray)(),
|
|
103
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
104
|
+
__metadata("design:type", Array)
|
|
105
|
+
], CreateProductValidator.prototype, "hashtags", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, class_validator_1.IsArray)(),
|
|
108
|
+
(0, class_transformer_1.Type)(() => CatalogProductAttributeValidator),
|
|
109
|
+
(0, class_validator_1.ValidateNested)(),
|
|
110
|
+
__metadata("design:type", Array)
|
|
111
|
+
], CreateProductValidator.prototype, "attributes", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, class_validator_1.IsOptional)(),
|
|
114
|
+
(0, class_validator_1.IsEnum)(product_status_enum_1.CatalogProductStatus),
|
|
115
|
+
__metadata("design:type", String)
|
|
116
|
+
], CreateProductValidator.prototype, "status", void 0);
|
|
117
|
+
class UpdateProductValidator extends CreateProductValidator {
|
|
118
|
+
}
|
|
119
|
+
exports.UpdateProductValidator = UpdateProductValidator;
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, class_validator_1.IsString)(),
|
|
122
|
+
(0, class_validator_1.IsOptional)(),
|
|
123
|
+
__metadata("design:type", String)
|
|
124
|
+
], UpdateProductValidator.prototype, "name", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, class_validator_1.IsPositive)(),
|
|
127
|
+
(0, class_validator_1.IsOptional)(),
|
|
128
|
+
__metadata("design:type", Number)
|
|
129
|
+
], UpdateProductValidator.prototype, "price", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, class_validator_1.IsNotEmptyObject)(),
|
|
132
|
+
(0, class_validator_1.IsOptional)(),
|
|
133
|
+
__metadata("design:type", Object)
|
|
134
|
+
], UpdateProductValidator.prototype, "measure", void 0);
|
|
135
|
+
//# sourceMappingURL=product.validator.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './label.entity';
|
|
2
|
+
export * from './label.validator';
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var label_entity_1 = require("./label.entity");
|
|
4
|
+
Object.keys(label_entity_1).forEach(function (key) {
|
|
5
|
+
if (key === "default" || key === "__esModule") return;
|
|
6
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return label_entity_1[key]; } });
|
|
7
|
+
});
|
|
8
|
+
var label_validator_1 = require("./label.validator");
|
|
9
|
+
Object.keys(label_validator_1).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return label_validator_1[key]; } });
|
|
12
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
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.ConfigurationLabelEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const abstract_entity_1 = require("../../../../infrastructure/abstracts/abstract.entity");
|
|
16
|
+
let ConfigurationLabelEntity = class ConfigurationLabelEntity extends abstract_entity_1.AbstractEntity {
|
|
17
|
+
name;
|
|
18
|
+
description;
|
|
19
|
+
color;
|
|
20
|
+
active;
|
|
21
|
+
};
|
|
22
|
+
exports.ConfigurationLabelEntity = ConfigurationLabelEntity;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, mongoose_1.Prop)({ required: true, trim: true, unique: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], ConfigurationLabelEntity.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ConfigurationLabelEntity.prototype, "description", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, mongoose_1.Prop)({ default: '#6c757d' }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], ConfigurationLabelEntity.prototype, "color", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, mongoose_1.Prop)({ default: true }),
|
|
37
|
+
__metadata("design:type", Boolean)
|
|
38
|
+
], ConfigurationLabelEntity.prototype, "active", void 0);
|
|
39
|
+
exports.ConfigurationLabelEntity = ConfigurationLabelEntity = __decorate([
|
|
40
|
+
(0, mongoose_1.Schema)(abstract_entity_1.$collection)
|
|
41
|
+
], ConfigurationLabelEntity);
|
|
42
|
+
//# sourceMappingURL=label.entity.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigurationLabelEntity } from '
|
|
2
|
-
import { AbstractValidator, ReadValidator, SearchValidator } from '
|
|
1
|
+
import { ConfigurationLabelEntity } from './';
|
|
2
|
+
import { AbstractValidator, ReadValidator, SearchValidator } from '../../..';
|
|
3
3
|
export declare class SearchLabelValidator extends SearchValidator<ConfigurationLabelEntity> {
|
|
4
4
|
}
|
|
5
5
|
export declare class ReadLabelValidator extends ReadValidator<ConfigurationLabelEntity> {
|
|
@@ -0,0 +1,51 @@
|
|
|
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.UpdateLabelValidator = exports.CreateLabelValidator = exports.ReadLabelValidator = exports.SearchLabelValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const abstract_validator_1 = require("../../../../infrastructure/abstracts/abstract.validator");
|
|
15
|
+
class SearchLabelValidator extends abstract_validator_1.SearchValidator {
|
|
16
|
+
}
|
|
17
|
+
exports.SearchLabelValidator = SearchLabelValidator;
|
|
18
|
+
class ReadLabelValidator extends abstract_validator_1.ReadValidator {
|
|
19
|
+
}
|
|
20
|
+
exports.ReadLabelValidator = ReadLabelValidator;
|
|
21
|
+
class CreateLabelValidator extends abstract_validator_1.AbstractValidator {
|
|
22
|
+
name;
|
|
23
|
+
description;
|
|
24
|
+
color;
|
|
25
|
+
active;
|
|
26
|
+
}
|
|
27
|
+
exports.CreateLabelValidator = CreateLabelValidator;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreateLabelValidator.prototype, "name", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], CreateLabelValidator.prototype, "description", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], CreateLabelValidator.prototype, "color", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_validator_1.IsBoolean)(),
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
__metadata("design:type", Boolean)
|
|
47
|
+
], CreateLabelValidator.prototype, "active", void 0);
|
|
48
|
+
class UpdateLabelValidator extends CreateLabelValidator {
|
|
49
|
+
}
|
|
50
|
+
exports.UpdateLabelValidator = UpdateLabelValidator;
|
|
51
|
+
//# sourceMappingURL=label.validator.js.map
|