@merkaly/api 0.2.2-25 → 0.2.2-26
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/modules/inventory/products/entities/code.entity.d.ts +5 -0
- package/.output/modules/inventory/products/entities/code.entity.js +36 -0
- package/.output/modules/inventory/products/entities/dimension.entity.d.ts +6 -0
- package/.output/modules/inventory/products/entities/dimension.entity.js +41 -0
- package/.output/modules/inventory/products/entities/price.entity.d.ts +4 -0
- package/.output/modules/inventory/products/entities/price.entity.js +31 -0
- package/.output/modules/inventory/products/entities/seo.entity.d.ts +5 -0
- package/.output/modules/inventory/products/entities/seo.entity.js +36 -0
- package/.output/modules/inventory/products/product.entity.d.ts +9 -1
- package/.output/modules/inventory/products/product.entity.js +32 -8
- package/.output/modules/inventory/products/product.validator.d.ts +10 -8
- package/.output/modules/inventory/products/product.validator.js +32 -40
- package/.output/modules/inventory/products/validators/code.validator.d.ts +5 -0
- package/.output/modules/inventory/products/validators/code.validator.js +34 -0
- package/.output/modules/inventory/products/validators/dimension.validator.d.ts +6 -0
- package/.output/modules/inventory/products/validators/dimension.validator.js +40 -0
- package/.output/modules/inventory/products/validators/price.validator.d.ts +4 -0
- package/.output/modules/inventory/products/validators/price.validator.js +27 -0
- package/.output/modules/inventory/products/validators/seo.validator.d.ts +5 -0
- package/.output/modules/inventory/products/validators/seo.validator.js +34 -0
- package/.output/modules/store/clients/client.entity.js +1 -1
- package/.output/modules/store/orders/order.entity.d.ts +2 -1
- package/.output/modules/store/orders/order.entity.js +6 -3
- package/.output/types.d.ts +2 -4
- package/package.json +11 -3
|
@@ -0,0 +1,36 @@
|
|
|
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.CodeEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
|
|
15
|
+
const mongoose_2 = require("mongoose");
|
|
16
|
+
let CodeEntity = class CodeEntity {
|
|
17
|
+
sku;
|
|
18
|
+
gtin;
|
|
19
|
+
mpn;
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], CodeEntity.prototype, "sku", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CodeEntity.prototype, "gtin", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CodeEntity.prototype, "mpn", void 0);
|
|
33
|
+
CodeEntity = __decorate([
|
|
34
|
+
(0, schema_decorator_1.Schema)()
|
|
35
|
+
], CodeEntity);
|
|
36
|
+
exports.CodeEntity = CodeEntity;
|
|
@@ -0,0 +1,41 @@
|
|
|
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.DimensionEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
|
|
15
|
+
const mongoose_2 = require("mongoose");
|
|
16
|
+
let DimensionEntity = class DimensionEntity {
|
|
17
|
+
weight;
|
|
18
|
+
height;
|
|
19
|
+
width;
|
|
20
|
+
depth;
|
|
21
|
+
};
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], DimensionEntity.prototype, "weight", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], DimensionEntity.prototype, "height", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], DimensionEntity.prototype, "width", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], DimensionEntity.prototype, "depth", void 0);
|
|
38
|
+
DimensionEntity = __decorate([
|
|
39
|
+
(0, schema_decorator_1.Schema)()
|
|
40
|
+
], DimensionEntity);
|
|
41
|
+
exports.DimensionEntity = DimensionEntity;
|
|
@@ -0,0 +1,31 @@
|
|
|
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.PriceEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
|
|
15
|
+
const mongoose_2 = require("mongoose");
|
|
16
|
+
let PriceEntity = class PriceEntity {
|
|
17
|
+
sale;
|
|
18
|
+
purchase;
|
|
19
|
+
};
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], PriceEntity.prototype, "sale", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], PriceEntity.prototype, "purchase", void 0);
|
|
28
|
+
PriceEntity = __decorate([
|
|
29
|
+
(0, schema_decorator_1.Schema)()
|
|
30
|
+
], PriceEntity);
|
|
31
|
+
exports.PriceEntity = PriceEntity;
|
|
@@ -0,0 +1,36 @@
|
|
|
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.SeoEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
|
|
15
|
+
const mongoose_2 = require("mongoose");
|
|
16
|
+
let SeoEntity = class SeoEntity {
|
|
17
|
+
title;
|
|
18
|
+
slug;
|
|
19
|
+
description;
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], SeoEntity.prototype, "title", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], SeoEntity.prototype, "slug", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], SeoEntity.prototype, "description", void 0);
|
|
33
|
+
SeoEntity = __decorate([
|
|
34
|
+
(0, schema_decorator_1.Schema)()
|
|
35
|
+
], SeoEntity);
|
|
36
|
+
exports.SeoEntity = SeoEntity;
|
|
@@ -2,12 +2,20 @@ import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
|
2
2
|
import { AssetEntity } from '../../assets/asset.entity';
|
|
3
3
|
import { BrandEntity } from '../brands/brand.entity';
|
|
4
4
|
import { CategoryEntity } from '../categories/category.entity';
|
|
5
|
+
import { CodeEntity } from './entities/code.entity';
|
|
6
|
+
import { DimensionEntity } from './entities/dimension.entity';
|
|
7
|
+
import { PriceEntity } from './entities/price.entity';
|
|
8
|
+
import { SeoEntity } from './entities/seo.entity';
|
|
5
9
|
export declare class ProductEntity extends AbstractEntity {
|
|
6
10
|
static readonly $index = "inventory_products";
|
|
7
11
|
name: string;
|
|
8
12
|
description: string;
|
|
9
|
-
price: number;
|
|
10
13
|
category?: CategoryEntity;
|
|
11
14
|
brand?: BrandEntity;
|
|
15
|
+
hashtags: string[];
|
|
12
16
|
files: AssetEntity[];
|
|
17
|
+
price: PriceEntity;
|
|
18
|
+
code?: CodeEntity;
|
|
19
|
+
dimension?: DimensionEntity;
|
|
20
|
+
seo: SeoEntity;
|
|
13
21
|
}
|
|
@@ -16,14 +16,22 @@ const abstract_entity_1 = require("../../../abstract/abstract.entity");
|
|
|
16
16
|
const asset_entity_1 = require("../../assets/asset.entity");
|
|
17
17
|
const brand_entity_1 = require("../brands/brand.entity");
|
|
18
18
|
const category_entity_1 = require("../categories/category.entity");
|
|
19
|
+
const code_entity_1 = require("./entities/code.entity");
|
|
20
|
+
const dimension_entity_1 = require("./entities/dimension.entity");
|
|
21
|
+
const price_entity_1 = require("./entities/price.entity");
|
|
22
|
+
const seo_entity_1 = require("./entities/seo.entity");
|
|
19
23
|
let ProductEntity = class ProductEntity extends abstract_entity_1.AbstractEntity {
|
|
20
24
|
static $index = 'inventory_products';
|
|
21
25
|
name;
|
|
22
26
|
description;
|
|
23
|
-
price = 0;
|
|
24
27
|
category;
|
|
25
28
|
brand;
|
|
29
|
+
hashtags = [];
|
|
26
30
|
files = [];
|
|
31
|
+
price;
|
|
32
|
+
code;
|
|
33
|
+
dimension;
|
|
34
|
+
seo;
|
|
27
35
|
};
|
|
28
36
|
__decorate([
|
|
29
37
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, length: 64 }),
|
|
@@ -34,21 +42,37 @@ __decorate([
|
|
|
34
42
|
__metadata("design:type", String)
|
|
35
43
|
], ProductEntity.prototype, "description", void 0);
|
|
36
44
|
__decorate([
|
|
37
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.
|
|
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 }),
|
|
45
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: category_entity_1.CategoryEntity.$index }),
|
|
42
46
|
__metadata("design:type", category_entity_1.CategoryEntity)
|
|
43
47
|
], ProductEntity.prototype, "category", void 0);
|
|
44
48
|
__decorate([
|
|
45
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: brand_entity_1.BrandEntity.$index }),
|
|
49
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, ref: brand_entity_1.BrandEntity.$index }),
|
|
46
50
|
__metadata("design:type", brand_entity_1.BrandEntity)
|
|
47
51
|
], ProductEntity.prototype, "brand", void 0);
|
|
48
52
|
__decorate([
|
|
49
|
-
(0, mongoose_1.Prop)({ type:
|
|
53
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
54
|
+
__metadata("design:type", Array)
|
|
55
|
+
], ProductEntity.prototype, "hashtags", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, mongoose_1.Prop)({ type: [{ type: mongoose_2.Schema.Types.ObjectId, ref: asset_entity_1.AssetEntity.$index }] }),
|
|
50
58
|
__metadata("design:type", Array)
|
|
51
59
|
], ProductEntity.prototype, "files", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: () => price_entity_1.PriceEntity }),
|
|
62
|
+
__metadata("design:type", price_entity_1.PriceEntity)
|
|
63
|
+
], ProductEntity.prototype, "price", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: () => code_entity_1.CodeEntity }),
|
|
66
|
+
__metadata("design:type", code_entity_1.CodeEntity)
|
|
67
|
+
], ProductEntity.prototype, "code", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: () => dimension_entity_1.DimensionEntity }),
|
|
70
|
+
__metadata("design:type", dimension_entity_1.DimensionEntity)
|
|
71
|
+
], ProductEntity.prototype, "dimension", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Map, ref: () => seo_entity_1.SeoEntity }),
|
|
74
|
+
__metadata("design:type", seo_entity_1.SeoEntity)
|
|
75
|
+
], ProductEntity.prototype, "seo", void 0);
|
|
52
76
|
ProductEntity = __decorate([
|
|
53
77
|
(0, mongoose_1.Schema)({ timestamps: true })
|
|
54
78
|
], ProductEntity);
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { AssetEntity } from '../../assets/asset.entity';
|
|
2
|
+
import { ProductCodeValidator } from './validators/code.validator';
|
|
3
|
+
import { ProductDimensionValidator } from './validators/dimension.validator';
|
|
4
|
+
import { ProductPriceValidator } from './validators/price.validator';
|
|
5
|
+
import { ProductSeoValidator } from './validators/seo.validator';
|
|
2
6
|
export declare class CreateProductValidator {
|
|
3
7
|
name: string;
|
|
4
8
|
description?: string;
|
|
5
|
-
price: number;
|
|
6
9
|
category?: string;
|
|
7
10
|
brand?: string;
|
|
8
11
|
files: AssetEntity[];
|
|
12
|
+
hashtags: string[];
|
|
13
|
+
price: ProductPriceValidator;
|
|
14
|
+
seo?: ProductSeoValidator;
|
|
15
|
+
dimension?: ProductDimensionValidator;
|
|
16
|
+
code?: ProductCodeValidator;
|
|
9
17
|
}
|
|
10
|
-
export declare class UpdateProductValidator {
|
|
11
|
-
name?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
price?: any;
|
|
14
|
-
category?: string;
|
|
15
|
-
brand?: string;
|
|
16
|
-
files: any[];
|
|
18
|
+
export declare class UpdateProductValidator extends CreateProductValidator {
|
|
17
19
|
}
|
|
@@ -12,13 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.UpdateProductValidator = exports.CreateProductValidator = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const code_validator_1 = require("./validators/code.validator");
|
|
16
|
+
const dimension_validator_1 = require("./validators/dimension.validator");
|
|
17
|
+
const price_validator_1 = require("./validators/price.validator");
|
|
18
|
+
const seo_validator_1 = require("./validators/seo.validator");
|
|
15
19
|
class CreateProductValidator {
|
|
16
20
|
name;
|
|
17
21
|
description;
|
|
18
|
-
price = 0;
|
|
19
22
|
category;
|
|
20
23
|
brand;
|
|
21
24
|
files = [];
|
|
25
|
+
hashtags = [];
|
|
26
|
+
price;
|
|
27
|
+
seo;
|
|
28
|
+
dimension;
|
|
29
|
+
code;
|
|
22
30
|
}
|
|
23
31
|
__decorate([
|
|
24
32
|
(0, class_validator_1.IsString)(),
|
|
@@ -29,11 +37,6 @@ __decorate([
|
|
|
29
37
|
(0, class_validator_1.IsOptional)(),
|
|
30
38
|
__metadata("design:type", String)
|
|
31
39
|
], 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
40
|
__decorate([
|
|
38
41
|
(0, class_validator_1.IsOptional)(),
|
|
39
42
|
(0, class_validator_1.IsMongoId)(),
|
|
@@ -49,43 +52,32 @@ __decorate([
|
|
|
49
52
|
(0, class_validator_1.IsOptional)(),
|
|
50
53
|
__metadata("design:type", Array)
|
|
51
54
|
], 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
55
|
__decorate([
|
|
67
|
-
(0, class_validator_1.IsString)(),
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
-
], UpdateProductValidator.prototype, "description", void 0);
|
|
56
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
57
|
+
__metadata("design:type", Array)
|
|
58
|
+
], CreateProductValidator.prototype, "hashtags", void 0);
|
|
71
59
|
__decorate([
|
|
72
|
-
(0, class_validator_1.
|
|
73
|
-
(0, class_validator_1.
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
(0, class_validator_1.ValidateNested)(),
|
|
61
|
+
(0, class_validator_1.IsNotEmptyObject)(),
|
|
62
|
+
(0, class_transformer_1.Type)(() => price_validator_1.ProductPriceValidator),
|
|
63
|
+
__metadata("design:type", price_validator_1.ProductPriceValidator)
|
|
64
|
+
], CreateProductValidator.prototype, "price", void 0);
|
|
76
65
|
__decorate([
|
|
77
|
-
(0, class_validator_1.
|
|
78
|
-
(0,
|
|
79
|
-
__metadata("design:type",
|
|
80
|
-
],
|
|
66
|
+
(0, class_validator_1.ValidateNested)(),
|
|
67
|
+
(0, class_transformer_1.Type)(() => seo_validator_1.ProductSeoValidator),
|
|
68
|
+
__metadata("design:type", seo_validator_1.ProductSeoValidator)
|
|
69
|
+
], CreateProductValidator.prototype, "seo", void 0);
|
|
81
70
|
__decorate([
|
|
82
|
-
(0, class_validator_1.
|
|
83
|
-
(0,
|
|
84
|
-
__metadata("design:type",
|
|
85
|
-
],
|
|
71
|
+
(0, class_validator_1.ValidateNested)(),
|
|
72
|
+
(0, class_transformer_1.Type)(() => dimension_validator_1.ProductDimensionValidator),
|
|
73
|
+
__metadata("design:type", dimension_validator_1.ProductDimensionValidator)
|
|
74
|
+
], CreateProductValidator.prototype, "dimension", void 0);
|
|
86
75
|
__decorate([
|
|
87
|
-
(0,
|
|
88
|
-
(0,
|
|
89
|
-
__metadata("design:type",
|
|
90
|
-
],
|
|
76
|
+
(0, class_validator_1.ValidateNested)(),
|
|
77
|
+
(0, class_transformer_1.Type)(() => code_validator_1.ProductCodeValidator),
|
|
78
|
+
__metadata("design:type", code_validator_1.ProductCodeValidator)
|
|
79
|
+
], CreateProductValidator.prototype, "code", void 0);
|
|
80
|
+
exports.CreateProductValidator = CreateProductValidator;
|
|
81
|
+
class UpdateProductValidator extends CreateProductValidator {
|
|
82
|
+
}
|
|
91
83
|
exports.UpdateProductValidator = UpdateProductValidator;
|
|
@@ -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.ProductCodeValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class ProductCodeValidator {
|
|
15
|
+
sku;
|
|
16
|
+
gtin;
|
|
17
|
+
mpn;
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
(0, class_validator_1.IsOptional)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], ProductCodeValidator.prototype, "sku", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], ProductCodeValidator.prototype, "gtin", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], ProductCodeValidator.prototype, "mpn", void 0);
|
|
34
|
+
exports.ProductCodeValidator = ProductCodeValidator;
|
|
@@ -0,0 +1,40 @@
|
|
|
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.ProductDimensionValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class ProductDimensionValidator {
|
|
15
|
+
weight;
|
|
16
|
+
height;
|
|
17
|
+
width;
|
|
18
|
+
depth;
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsNumber)(),
|
|
22
|
+
(0, class_validator_1.IsOptional)(),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], ProductDimensionValidator.prototype, "weight", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsNumber)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], ProductDimensionValidator.prototype, "height", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsNumber)(),
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], ProductDimensionValidator.prototype, "width", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsNumber)(),
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], ProductDimensionValidator.prototype, "depth", void 0);
|
|
40
|
+
exports.ProductDimensionValidator = ProductDimensionValidator;
|
|
@@ -0,0 +1,27 @@
|
|
|
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.ProductPriceValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class ProductPriceValidator {
|
|
15
|
+
sale;
|
|
16
|
+
purchase;
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsNumber)(),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], ProductPriceValidator.prototype, "sale", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsNumber)(),
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], ProductPriceValidator.prototype, "purchase", void 0);
|
|
27
|
+
exports.ProductPriceValidator = ProductPriceValidator;
|
|
@@ -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.ProductSeoValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class ProductSeoValidator {
|
|
15
|
+
title;
|
|
16
|
+
slug;
|
|
17
|
+
description;
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
|
+
(0, class_validator_1.IsOptional)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], ProductSeoValidator.prototype, "title", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], ProductSeoValidator.prototype, "slug", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], ProductSeoValidator.prototype, "description", void 0);
|
|
34
|
+
exports.ProductSeoValidator = ProductSeoValidator;
|
|
@@ -36,7 +36,7 @@ __decorate([
|
|
|
36
36
|
__metadata("design:type", Boolean)
|
|
37
37
|
], ClientEntity.prototype, "email_verified", void 0);
|
|
38
38
|
__decorate([
|
|
39
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default:
|
|
39
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
|
|
40
40
|
__metadata("design:type", String)
|
|
41
41
|
], ClientEntity.prototype, "phone", void 0);
|
|
42
42
|
__decorate([
|
|
@@ -6,7 +6,7 @@ import { PaymentEntity } from './payment/payment.entity';
|
|
|
6
6
|
import { StatusEntity } from './status/status.entity';
|
|
7
7
|
export declare class OrderEntity extends AbstractEntity {
|
|
8
8
|
static readonly $index = "store_orders";
|
|
9
|
-
number:
|
|
9
|
+
number: number;
|
|
10
10
|
status: StatusEntity[];
|
|
11
11
|
items: ItemEntity[];
|
|
12
12
|
billing?: Types.Map<any>;
|
|
@@ -14,4 +14,5 @@ export declare class OrderEntity extends AbstractEntity {
|
|
|
14
14
|
payment: PaymentEntity;
|
|
15
15
|
client: ClientEntity;
|
|
16
16
|
notes: string;
|
|
17
|
+
get fullNumber(): string;
|
|
17
18
|
}
|
|
@@ -29,10 +29,13 @@ let OrderEntity = class OrderEntity extends abstract_entity_1.AbstractEntity {
|
|
|
29
29
|
payment;
|
|
30
30
|
client;
|
|
31
31
|
notes;
|
|
32
|
+
get fullNumber() {
|
|
33
|
+
return String();
|
|
34
|
+
}
|
|
32
35
|
};
|
|
33
36
|
__decorate([
|
|
34
|
-
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.
|
|
35
|
-
__metadata("design:type",
|
|
37
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, required: true, unique: true }),
|
|
38
|
+
__metadata("design:type", Number)
|
|
36
39
|
], OrderEntity.prototype, "number", void 0);
|
|
37
40
|
__decorate([
|
|
38
41
|
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Array, default: [] }),
|
|
@@ -63,6 +66,6 @@ __decorate([
|
|
|
63
66
|
__metadata("design:type", String)
|
|
64
67
|
], OrderEntity.prototype, "notes", void 0);
|
|
65
68
|
OrderEntity = __decorate([
|
|
66
|
-
(0, mongoose_1.Schema)({ timestamps: true })
|
|
69
|
+
(0, mongoose_1.Schema)({ timestamps: true, toJSON: { virtuals: true } })
|
|
67
70
|
], OrderEntity);
|
|
68
71
|
exports.OrderEntity = OrderEntity;
|
package/.output/types.d.ts
CHANGED
|
@@ -19,7 +19,5 @@ export interface MetaAddress {
|
|
|
19
19
|
export interface UserMeta extends UserMetadata {
|
|
20
20
|
addresses?: MetaAddress[];
|
|
21
21
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
export interface UserDocument extends User<AppMeta, UserMeta> {
|
|
25
|
-
}
|
|
22
|
+
export declare type AppMeta = AppMetadata;
|
|
23
|
+
export declare type UserDocument = User<AppMeta, UserMeta>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkaly/api",
|
|
3
|
-
"version": "0.2.2-
|
|
3
|
+
"version": "0.2.2-26",
|
|
4
4
|
"description": "NestJS Backend ApiRest Service",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "UNLICENSED",
|
|
10
10
|
"author": "Randy Tellez Galan <kronhyx@gmail.com>",
|
|
11
|
-
"main": "
|
|
11
|
+
"main": "./src/main",
|
|
12
12
|
"types": "./.output/types.d.ts",
|
|
13
13
|
"files": [
|
|
14
14
|
".output"
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
"prebuild": "yarn run clean",
|
|
18
18
|
"build": "nest build",
|
|
19
19
|
"clean": "tsc -b --clean",
|
|
20
|
-
"console": "ts-node -r tsconfig-paths/register ./src/console.ts",
|
|
20
|
+
"console": "ts-node -r tsconfig-paths/register ./src/app.console.ts",
|
|
21
21
|
"dev": "yarn start --watch",
|
|
22
22
|
"lint": "eslint \"{src,test}/**/*.ts\" . ",
|
|
23
|
+
"migrate": "tsc --target es5 ./src/migrations/*.ts && migrate --config ./src/app.migration.ts",
|
|
23
24
|
"prepack": ".bin/package.sh",
|
|
24
25
|
"postpack": "yarn run clean",
|
|
25
26
|
"semantic-release": "yarn run build:package && semantic-release",
|
|
@@ -30,6 +31,9 @@
|
|
|
30
31
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
31
32
|
"test:watch": "yarn test -- --watch"
|
|
32
33
|
},
|
|
34
|
+
"lint-staged": {
|
|
35
|
+
"*.**": "yarn lint --cache --fix"
|
|
36
|
+
},
|
|
33
37
|
"dependencies": {
|
|
34
38
|
"@elastic/elasticsearch": "^8.4.0",
|
|
35
39
|
"@types/auth0": "^2.35.2",
|
|
@@ -51,9 +55,11 @@
|
|
|
51
55
|
"@nestjs/mongoose": "^9.2.0",
|
|
52
56
|
"@nestjs/passport": "^9.0.0",
|
|
53
57
|
"@nestjs/platform-express": "^9.0.11",
|
|
58
|
+
"@nestjs/platform-socket.io": "^9.1.6",
|
|
54
59
|
"@nestjs/schematics": "^9.0.1",
|
|
55
60
|
"@nestjs/swagger": "^6.1.0",
|
|
56
61
|
"@nestjs/testing": "^9.0.11",
|
|
62
|
+
"@nestjs/websockets": "^9.1.6",
|
|
57
63
|
"@types/cache-manager": "^4.0.1",
|
|
58
64
|
"@types/express": "^4.17.12",
|
|
59
65
|
"@types/express-session": "^1.17.5",
|
|
@@ -74,6 +80,8 @@
|
|
|
74
80
|
"express-session": "^1.17.3",
|
|
75
81
|
"husky": "^8.0.1",
|
|
76
82
|
"jest": "27.5.1",
|
|
83
|
+
"lint-staged": "^13.0.3",
|
|
84
|
+
"migrate-mongoose": "^4.0.0",
|
|
77
85
|
"nestjs-console": "^8.0.0",
|
|
78
86
|
"passport": "^0.6.0",
|
|
79
87
|
"passport-jwt": "^4.0.0",
|