@merkaly/api 0.2.5-6 → 0.2.5-7
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/abstracts/abstract.entity.d.ts +14 -0
- package/.output/abstracts/abstract.validator.d.ts +24 -0
- package/.output/abstracts/abstract.validator.js +118 -0
- package/.output/exceptions/missing-identity.exception.d.ts +5 -0
- package/.output/exceptions/missing-identity.exception.js +30 -0
- package/.output/modules/asset/files/file.entity.d.ts +9 -0
- package/.output/modules/asset/files/file.schema.d.ts +34 -0
- package/.output/modules/asset/files/file.schema.js +10 -0
- package/.output/modules/auth/organizations/organization.entity.d.ts +8 -0
- package/.output/modules/auth/users/user.entity.d.ts +9 -0
- package/.output/modules/auth/users/user.schema.d.ts +34 -0
- package/.output/modules/auth/users/user.schema.js +10 -0
- package/.output/modules/auth/users/user.validator.d.ts +12 -0
- package/.output/modules/auth/users/user.validator.js +58 -0
- package/.output/modules/inventory/brands/brand.entity.d.ts +6 -0
- package/.output/modules/inventory/brands/brand.schema.d.ts +34 -0
- package/.output/modules/inventory/brands/brand.schema.js +10 -0
- package/.output/modules/inventory/brands/brand.validator.d.ts +11 -0
- package/.output/modules/inventory/brands/brand.validator.js +74 -0
- package/.output/modules/inventory/categories/category.entity.d.ts +6 -0
- package/.output/modules/inventory/categories/category.schema.d.ts +34 -0
- package/.output/modules/inventory/categories/category.schema.js +10 -0
- package/.output/modules/inventory/categories/category.validator.d.ts +8 -0
- package/.output/modules/inventory/categories/category.validator.js +42 -0
- package/.output/modules/inventory/complements/complement.entity.d.ts +6 -0
- package/.output/modules/inventory/complements/complement.validator.d.ts +10 -0
- package/.output/modules/inventory/complements/complement.validator.js +52 -0
- package/.output/modules/inventory/products/documents/attribute.document.d.ts +5 -0
- package/.output/modules/inventory/products/documents/attribute.document.js +33 -0
- package/.output/modules/inventory/products/documents/dimension.document.d.ts +6 -0
- package/.output/modules/inventory/products/documents/dimension.document.js +35 -0
- package/.output/modules/inventory/products/product.entity.d.ts +19 -0
- package/.output/modules/inventory/products/product.schema.d.ts +34 -0
- package/.output/modules/inventory/products/product.schema.js +18 -0
- package/.output/modules/inventory/products/product.validator.d.ts +29 -0
- package/.output/modules/inventory/products/product.validator.js +179 -0
- package/.output/modules/inventory/products/validators/attributes.validator.d.ts +5 -0
- package/.output/modules/inventory/products/validators/attributes.validator.js +35 -0
- package/.output/modules/inventory/products/validators/dimension.validator.d.ts +6 -0
- package/.output/modules/inventory/products/validators/dimension.validator.js +38 -0
- package/.output/modules/sale/customers/customer.entity.d.ts +8 -0
- package/.output/modules/sale/customers/customer.schema.d.ts +34 -0
- package/.output/modules/sale/customers/customer.schema.js +10 -0
- package/.output/modules/sale/customers/customer.validator.d.ts +14 -0
- package/.output/modules/sale/customers/customer.validator.js +94 -0
- package/.output/modules/sale/orders/documents/address.document.d.ts +8 -0
- package/.output/modules/sale/orders/documents/address.document.js +43 -0
- package/.output/modules/sale/orders/documents/status.document.d.ts +8 -0
- package/.output/modules/sale/orders/documents/status.document.js +34 -0
- package/.output/modules/sale/orders/entities/item.entity.d.ts +38 -0
- package/.output/modules/sale/orders/enums/order.status.d.ts +6 -0
- package/.output/modules/sale/orders/enums/order.status.js +10 -0
- package/.output/modules/sale/orders/order.entity.d.ts +21 -0
- package/.output/modules/sale/orders/order.validator.d.ts +16 -0
- package/.output/modules/sale/orders/order.validator.js +86 -0
- package/.output/modules/sale/orders/validators/address.validator.d.ts +17 -0
- package/.output/modules/sale/orders/validators/address.validator.js +81 -0
- package/{src/modules/sale/orders/validators/billing.validator.ts → .output/modules/sale/orders/validators/billing.validator.d.ts} +4 -7
- package/.output/modules/sale/orders/validators/billing.validator.js +13 -0
- package/.output/modules/sale/orders/validators/item.validator.d.ts +5 -0
- package/.output/modules/sale/orders/validators/item.validator.js +32 -0
- package/.output/modules/sale/orders/validators/payment.validator.d.ts +10 -0
- package/.output/modules/sale/orders/validators/payment.validator.js +62 -0
- package/.output/modules/sale/orders/validators/shipping.validator.d.ts +9 -0
- package/.output/modules/sale/orders/validators/shipping.validator.js +14 -0
- package/.output/modules/sale/payments/entities/status.entity.d.ts +8 -0
- package/.output/modules/sale/payments/enums/billing.type.d.ts +6 -0
- package/.output/modules/sale/payments/enums/billing.type.js +10 -0
- package/.output/modules/sale/payments/enums/payment.status.d.ts +7 -0
- package/.output/modules/sale/payments/enums/payment.status.js +11 -0
- package/.output/modules/sale/payments/enums/shipping.type.d.ts +4 -0
- package/.output/modules/sale/payments/enums/shipping.type.js +8 -0
- package/.output/modules/sale/payments/payment.entity.d.ts +12 -0
- package/.output/modules/sale/payments/payment.schema.d.ts +34 -0
- package/.output/modules/sale/payments/payment.schema.js +14 -0
- package/.output/modules/sale/payments/payment.validator.d.ts +16 -0
- package/.output/modules/sale/payments/payment.validator.js +77 -0
- package/.output/tsconfig.package.tsbuildinfo +1 -0
- package/package.json +4 -1
- package/.bin/deploy.sh +0 -9
- package/.bin/package.sh +0 -12
- package/.docker/Dockerfile +0 -21
- package/.dockerignore +0 -12
- package/.github/dependabot.yml +0 -17
- package/.github/semantic.yml +0 -5
- package/.github/workflows/pull_request.yml +0 -35
- package/.prettierrc +0 -5
- package/app.ts +0 -11
- package/authCertificate.pem +0 -19
- package/nest-cli.json +0 -8
- package/src/abstracts/abstarct.repository.ts +0 -62
- package/src/abstracts/abstract.controller.ts +0 -18
- package/src/abstracts/abstract.entity.ts +0 -22
- package/src/abstracts/abstract.router.ts +0 -7
- package/src/abstracts/abstract.validator.ts +0 -61
- package/src/app.config.ts +0 -59
- package/src/app.console.ts +0 -24
- package/src/app.guard.ts +0 -39
- package/src/app.module.ts +0 -54
- package/src/app.strategy.ts +0 -21
- package/src/commands/seed.command.ts +0 -263
- package/src/decorators/public.decorator.ts +0 -5
- package/src/decorators/user.decorator.ts +0 -30
- package/src/exceptions/missing-identity.exception.ts +0 -11
- package/src/interceptors/mongoose.interceptor.ts +0 -63
- package/src/main.ts +0 -27
- package/src/middlewares/router.middleware.ts +0 -14
- package/src/modules/asset/asset.module.ts +0 -19
- package/src/modules/asset/files/file.controller.ts +0 -22
- package/src/modules/asset/files/file.entity.ts +0 -24
- package/src/modules/asset/files/file.module.ts +0 -21
- package/src/modules/asset/files/file.repository.ts +0 -44
- package/src/modules/asset/files/file.schema.ts +0 -8
- package/src/modules/asset/files/file.service.ts +0 -4
- package/src/modules/auth/auth.controller.ts +0 -57
- package/src/modules/auth/auth.module.ts +0 -20
- package/src/modules/auth/organizations/organization.controller.ts +0 -20
- package/src/modules/auth/organizations/organization.entity.ts +0 -22
- package/src/modules/auth/organizations/organization.module.ts +0 -21
- package/src/modules/auth/organizations/organization.repository.ts +0 -16
- package/src/modules/auth/organizations/organization.schema.ts +0 -8
- package/src/modules/auth/users/user.controller.ts +0 -23
- package/src/modules/auth/users/user.entity.ts +0 -25
- package/src/modules/auth/users/user.module.ts +0 -20
- package/src/modules/auth/users/user.repository.ts +0 -79
- package/src/modules/auth/users/user.schema.ts +0 -8
- package/src/modules/auth/users/user.validator.ts +0 -32
- package/src/modules/command.module.ts +0 -15
- package/src/modules/global.module.ts +0 -46
- package/src/modules/inventory/brands/brand.controller.ts +0 -44
- package/src/modules/inventory/brands/brand.entity.ts +0 -20
- package/src/modules/inventory/brands/brand.module.ts +0 -20
- package/src/modules/inventory/brands/brand.repository.ts +0 -40
- package/src/modules/inventory/brands/brand.schema.ts +0 -8
- package/src/modules/inventory/brands/brand.validator.ts +0 -31
- package/src/modules/inventory/categories/category.controller.ts +0 -42
- package/src/modules/inventory/categories/category.entity.ts +0 -15
- package/src/modules/inventory/categories/category.module.ts +0 -19
- package/src/modules/inventory/categories/category.repository.ts +0 -34
- package/src/modules/inventory/categories/category.schema.ts +0 -8
- package/src/modules/inventory/categories/category.validator.ts +0 -20
- package/src/modules/inventory/complements/complement.controller.ts +0 -41
- package/src/modules/inventory/complements/complement.entity.ts +0 -15
- package/src/modules/inventory/complements/complement.module.ts +0 -19
- package/src/modules/inventory/complements/complement.repository.ts +0 -37
- package/src/modules/inventory/complements/complement.schema.ts +0 -8
- package/src/modules/inventory/complements/complement.validator.ts +0 -28
- package/src/modules/inventory/inventory.module.ts +0 -23
- package/src/modules/inventory/products/documents/attribute.document.ts +0 -14
- package/src/modules/inventory/products/documents/dimension.document.ts +0 -16
- package/src/modules/inventory/products/product.controller.ts +0 -62
- package/src/modules/inventory/products/product.entity.ts +0 -46
- package/src/modules/inventory/products/product.module.ts +0 -19
- package/src/modules/inventory/products/product.repository.ts +0 -64
- package/src/modules/inventory/products/product.schema.ts +0 -19
- package/src/modules/inventory/products/product.validator.ts +0 -132
- package/src/modules/inventory/products/validators/attributes.validator.ts +0 -15
- package/src/modules/inventory/products/validators/dimension.validator.ts +0 -19
- package/src/modules/sale/customers/customer.controller.ts +0 -41
- package/src/modules/sale/customers/customer.entity.ts +0 -19
- package/src/modules/sale/customers/customer.module.ts +0 -18
- package/src/modules/sale/customers/customer.repository.ts +0 -30
- package/src/modules/sale/customers/customer.schema.ts +0 -8
- package/src/modules/sale/customers/customer.validator.ts +0 -43
- package/src/modules/sale/orders/documents/address.document.ts +0 -22
- package/src/modules/sale/orders/documents/status.document.ts +0 -17
- package/src/modules/sale/orders/entities/item.entity.ts +0 -24
- package/src/modules/sale/orders/enums/order.status.ts +0 -6
- package/src/modules/sale/orders/order.controller.ts +0 -65
- package/src/modules/sale/orders/order.entity.ts +0 -46
- package/src/modules/sale/orders/order.module.ts +0 -22
- package/src/modules/sale/orders/order.repository.ts +0 -122
- package/src/modules/sale/orders/order.schema.ts +0 -36
- package/src/modules/sale/orders/order.validator.ts +0 -44
- package/src/modules/sale/orders/validators/address.validator.ts +0 -50
- package/src/modules/sale/orders/validators/item.validator.ts +0 -14
- package/src/modules/sale/orders/validators/payment.validator.ts +0 -44
- package/src/modules/sale/orders/validators/shipping.validator.ts +0 -14
- package/src/modules/sale/payments/entities/status.entity.ts +0 -17
- package/src/modules/sale/payments/enums/billing.type.ts +0 -6
- package/src/modules/sale/payments/enums/payment.status.ts +0 -7
- package/src/modules/sale/payments/enums/shipping.type.ts +0 -4
- package/src/modules/sale/payments/payment.controller.ts +0 -45
- package/src/modules/sale/payments/payment.entity.ts +0 -25
- package/src/modules/sale/payments/payment.module.ts +0 -20
- package/src/modules/sale/payments/payment.repository.ts +0 -57
- package/src/modules/sale/payments/payment.schema.ts +0 -14
- package/src/modules/sale/payments/payment.validator.ts +0 -32
- package/src/modules/sale/sale.module.ts +0 -20
- package/src/services/auth0.service.ts +0 -49
- package/src/services/mongo.service.ts +0 -52
- package/test/auth/auth.spec.ts +0 -20
- package/test/main.ts +0 -12
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -21
- package/tsconfig.package.json +0 -22
|
@@ -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.UpdateComplementValidator = exports.CreateComplementValidator = void 0;
|
|
13
|
+
var class_validator_1 = require("class-validator");
|
|
14
|
+
var CreateComplementValidator = exports.CreateComplementValidator = (function () {
|
|
15
|
+
function CreateComplementValidator() {
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], CreateComplementValidator.prototype, "name", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], CreateComplementValidator.prototype, "description", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsNumber)(),
|
|
27
|
+
(0, class_validator_1.IsPositive)(),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], CreateComplementValidator.prototype, "price", void 0);
|
|
30
|
+
return CreateComplementValidator;
|
|
31
|
+
}());
|
|
32
|
+
var UpdateComplementValidator = exports.UpdateComplementValidator = (function () {
|
|
33
|
+
function UpdateComplementValidator() {
|
|
34
|
+
}
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], UpdateComplementValidator.prototype, "name", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], UpdateComplementValidator.prototype, "description", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.IsNumber)(),
|
|
48
|
+
(0, class_validator_1.IsPositive)(),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], UpdateComplementValidator.prototype, "price", void 0);
|
|
51
|
+
return UpdateComplementValidator;
|
|
52
|
+
}());
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProductAttributesDocument = void 0;
|
|
13
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
var mongoose_2 = require("mongoose");
|
|
15
|
+
var ProductAttributesDocument = exports.ProductAttributesDocument = (function () {
|
|
16
|
+
function ProductAttributesDocument() {
|
|
17
|
+
this.units = 1;
|
|
18
|
+
this.stock = null;
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, mongoose_1.Prop)({ default: function () { return 1; }, type: mongoose_2.Schema.Types.Number }),
|
|
22
|
+
__metadata("design:type", Object)
|
|
23
|
+
], ProductAttributesDocument.prototype, "units", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, mongoose_1.Prop)({ default: function () { return null; }, type: mongoose_2.Schema.Types.Number }),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], ProductAttributesDocument.prototype, "stock", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, mongoose_1.Prop)({ default: function () { return undefined; }, required: true, type: mongoose_2.Schema.Types.String, unique: true }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ProductAttributesDocument.prototype, "sku", void 0);
|
|
32
|
+
return ProductAttributesDocument;
|
|
33
|
+
}());
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProductDimensionDocument = void 0;
|
|
13
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
var mongoose_2 = require("mongoose");
|
|
15
|
+
var ProductDimensionDocument = exports.ProductDimensionDocument = (function () {
|
|
16
|
+
function ProductDimensionDocument() {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], ProductDimensionDocument.prototype, "weight", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], ProductDimensionDocument.prototype, "height", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], ProductDimensionDocument.prototype, "width", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number }),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], ProductDimensionDocument.prototype, "depth", void 0);
|
|
34
|
+
return ProductDimensionDocument;
|
|
35
|
+
}());
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AbstractEntity, MaybeEntity } from '../../../abstracts/abstract.entity';
|
|
2
|
+
import { FileEntity } from '../../asset/files/file.entity';
|
|
3
|
+
import { BrandEntity } from '../brands/brand.entity';
|
|
4
|
+
import { CategoryEntity } from '../categories/category.entity';
|
|
5
|
+
import { ProductAttributesDocument } from './documents/attribute.document';
|
|
6
|
+
import { ProductDimensionDocument } from './documents/dimension.document';
|
|
7
|
+
export declare class ProductEntity extends AbstractEntity {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
active: boolean;
|
|
11
|
+
price: number;
|
|
12
|
+
hashtags: string[];
|
|
13
|
+
brand?: MaybeEntity<BrandEntity>;
|
|
14
|
+
category?: MaybeEntity<CategoryEntity>;
|
|
15
|
+
pictures: FileEntity[];
|
|
16
|
+
attributes: ProductAttributesDocument;
|
|
17
|
+
dimension: ProductDimensionDocument;
|
|
18
|
+
readonly image: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { ProductEntity } from './product.entity';
|
|
27
|
+
export declare namespace ProductSchema {
|
|
28
|
+
const name = "inventory_products";
|
|
29
|
+
const schema: import("mongoose").Schema<ProductEntity, import("mongoose").Model<ProductEntity, any, any, any, import("mongoose").Document<unknown, any, ProductEntity> & ProductEntity & Required<{
|
|
30
|
+
_id: string;
|
|
31
|
+
}>, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ProductEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ProductEntity>> & import("mongoose").FlatRecord<ProductEntity> & Required<{
|
|
32
|
+
_id: string;
|
|
33
|
+
}>>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductSchema = void 0;
|
|
4
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
5
|
+
var product_entity_1 = require("./product.entity");
|
|
6
|
+
var ProductSchema;
|
|
7
|
+
(function (ProductSchema) {
|
|
8
|
+
ProductSchema.name = 'inventory_products';
|
|
9
|
+
ProductSchema.schema = mongoose_1.SchemaFactory.createForClass(product_entity_1.ProductEntity);
|
|
10
|
+
ProductSchema.schema.index({
|
|
11
|
+
description: 'text',
|
|
12
|
+
name: 'text',
|
|
13
|
+
});
|
|
14
|
+
ProductSchema.schema.virtual('image').get(function () {
|
|
15
|
+
var first = this.pictures[0];
|
|
16
|
+
return first === null || first === void 0 ? void 0 : first.url;
|
|
17
|
+
});
|
|
18
|
+
})(ProductSchema || (exports.ProductSchema = ProductSchema = {}));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AbstractValidator } from '../../../abstracts/abstract.validator';
|
|
2
|
+
import { ProductEntity } from './product.entity';
|
|
3
|
+
import { AttributesValidator } from './validators/attributes.validator';
|
|
4
|
+
import { DimensionValidator } from './validators/dimension.validator';
|
|
5
|
+
export declare class CreateProductValidator extends AbstractValidator {
|
|
6
|
+
active?: boolean;
|
|
7
|
+
hashtags?: string[];
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
price: number;
|
|
11
|
+
pictures?: string[];
|
|
12
|
+
category?: string;
|
|
13
|
+
brand?: string;
|
|
14
|
+
dimension?: DimensionValidator;
|
|
15
|
+
attributes?: AttributesValidator;
|
|
16
|
+
}
|
|
17
|
+
export declare class UpdateProductValidator {
|
|
18
|
+
active?: boolean;
|
|
19
|
+
hashtags?: string[];
|
|
20
|
+
name?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
price?: number;
|
|
23
|
+
category?: string;
|
|
24
|
+
brand?: string;
|
|
25
|
+
pictures?: string[];
|
|
26
|
+
dimension?: DimensionValidator;
|
|
27
|
+
attributes?: AttributesValidator;
|
|
28
|
+
constructor(entity: ProductEntity);
|
|
29
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.UpdateProductValidator = exports.CreateProductValidator = void 0;
|
|
28
|
+
var class_transformer_1 = require("class-transformer");
|
|
29
|
+
var class_validator_1 = require("class-validator");
|
|
30
|
+
var abstract_validator_1 = require("../../../abstracts/abstract.validator");
|
|
31
|
+
var attributes_validator_1 = require("./validators/attributes.validator");
|
|
32
|
+
var dimension_validator_1 = require("./validators/dimension.validator");
|
|
33
|
+
var CreateProductValidator = exports.CreateProductValidator = (function (_super) {
|
|
34
|
+
__extends(CreateProductValidator, _super);
|
|
35
|
+
function CreateProductValidator() {
|
|
36
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
37
|
+
_this.active = true;
|
|
38
|
+
_this.hashtags = [];
|
|
39
|
+
_this.pictures = [];
|
|
40
|
+
_this.dimension = new dimension_validator_1.DimensionValidator();
|
|
41
|
+
_this.attributes = new attributes_validator_1.AttributesValidator();
|
|
42
|
+
return _this;
|
|
43
|
+
}
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsBoolean)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], CreateProductValidator.prototype, "active", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
51
|
+
(0, class_validator_1.IsNotEmpty)({ each: true }),
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
__metadata("design:type", Array)
|
|
54
|
+
], CreateProductValidator.prototype, "hashtags", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.IsString)(),
|
|
57
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], CreateProductValidator.prototype, "name", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, class_validator_1.IsString)(),
|
|
62
|
+
(0, class_validator_1.IsOptional)(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], CreateProductValidator.prototype, "description", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_validator_1.IsNumber)(),
|
|
67
|
+
(0, class_validator_1.IsPositive)(),
|
|
68
|
+
__metadata("design:type", Number)
|
|
69
|
+
], CreateProductValidator.prototype, "price", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_validator_1.IsMongoId)({ each: true }),
|
|
72
|
+
(0, class_validator_1.IsArray)(),
|
|
73
|
+
(0, class_validator_1.IsOptional)(),
|
|
74
|
+
__metadata("design:type", Array)
|
|
75
|
+
], CreateProductValidator.prototype, "pictures", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, class_validator_1.IsOptional)(),
|
|
78
|
+
(0, class_validator_1.IsMongoId)(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], CreateProductValidator.prototype, "category", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_validator_1.IsOptional)(),
|
|
83
|
+
(0, class_validator_1.IsMongoId)(),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], CreateProductValidator.prototype, "brand", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_transformer_1.Type)(function () { return dimension_validator_1.DimensionValidator; }),
|
|
88
|
+
(0, class_validator_1.ValidateNested)(),
|
|
89
|
+
(0, class_validator_1.IsOptional)(),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], CreateProductValidator.prototype, "dimension", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, class_transformer_1.Type)(function () { return attributes_validator_1.AttributesValidator; }),
|
|
94
|
+
(0, class_validator_1.ValidateNested)(),
|
|
95
|
+
(0, class_validator_1.IsOptional)(),
|
|
96
|
+
__metadata("design:type", Object)
|
|
97
|
+
], CreateProductValidator.prototype, "attributes", void 0);
|
|
98
|
+
return CreateProductValidator;
|
|
99
|
+
}(abstract_validator_1.AbstractValidator));
|
|
100
|
+
var UpdateProductValidator = exports.UpdateProductValidator = (function () {
|
|
101
|
+
function UpdateProductValidator(entity) {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
this.hashtags = [];
|
|
104
|
+
this.pictures = [];
|
|
105
|
+
this.attributes = new attributes_validator_1.AttributesValidator();
|
|
106
|
+
this.active = entity.active;
|
|
107
|
+
this.name = entity.name;
|
|
108
|
+
this.description = entity.description;
|
|
109
|
+
this.price = entity.price;
|
|
110
|
+
this.hashtags = entity.hashtags;
|
|
111
|
+
this.category = (_a = entity.category) === null || _a === void 0 ? void 0 : _a._id;
|
|
112
|
+
this.brand = (_b = entity.brand) === null || _b === void 0 ? void 0 : _b._id;
|
|
113
|
+
this.pictures = entity.pictures.map(function (file) { return file._id; });
|
|
114
|
+
this.attributes.sku = entity.attributes.sku;
|
|
115
|
+
this.attributes.stock = entity.attributes.stock;
|
|
116
|
+
this.attributes.units = entity.attributes.units;
|
|
117
|
+
this.dimension.depth = entity.dimension.depth;
|
|
118
|
+
this.dimension.height = entity.dimension.height;
|
|
119
|
+
this.dimension.weight = entity.dimension.weight;
|
|
120
|
+
this.dimension.width = entity.dimension.width;
|
|
121
|
+
}
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, class_validator_1.IsBoolean)(),
|
|
124
|
+
(0, class_validator_1.IsOptional)(),
|
|
125
|
+
__metadata("design:type", Boolean)
|
|
126
|
+
], UpdateProductValidator.prototype, "active", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
129
|
+
(0, class_validator_1.IsNotEmpty)({ each: true }),
|
|
130
|
+
(0, class_validator_1.IsOptional)(),
|
|
131
|
+
__metadata("design:type", Array)
|
|
132
|
+
], UpdateProductValidator.prototype, "hashtags", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, class_validator_1.IsOptional)(),
|
|
135
|
+
(0, class_validator_1.IsString)(),
|
|
136
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
137
|
+
__metadata("design:type", String)
|
|
138
|
+
], UpdateProductValidator.prototype, "name", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, class_validator_1.IsOptional)(),
|
|
141
|
+
(0, class_validator_1.IsString)(),
|
|
142
|
+
(0, class_validator_1.IsOptional)(),
|
|
143
|
+
__metadata("design:type", String)
|
|
144
|
+
], UpdateProductValidator.prototype, "description", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, class_validator_1.IsOptional)(),
|
|
147
|
+
(0, class_validator_1.IsNumber)(),
|
|
148
|
+
__metadata("design:type", Number)
|
|
149
|
+
], UpdateProductValidator.prototype, "price", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, class_validator_1.IsOptional)(),
|
|
152
|
+
(0, class_validator_1.IsMongoId)(),
|
|
153
|
+
__metadata("design:type", String)
|
|
154
|
+
], UpdateProductValidator.prototype, "category", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, class_validator_1.IsOptional)(),
|
|
157
|
+
(0, class_validator_1.IsMongoId)(),
|
|
158
|
+
__metadata("design:type", String)
|
|
159
|
+
], UpdateProductValidator.prototype, "brand", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
(0, class_validator_1.IsMongoId)({ each: true }),
|
|
162
|
+
(0, class_validator_1.IsArray)(),
|
|
163
|
+
(0, class_validator_1.IsOptional)(),
|
|
164
|
+
__metadata("design:type", Array)
|
|
165
|
+
], UpdateProductValidator.prototype, "pictures", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, class_transformer_1.Type)(function () { return dimension_validator_1.DimensionValidator; }),
|
|
168
|
+
(0, class_validator_1.ValidateNested)(),
|
|
169
|
+
(0, class_validator_1.IsOptional)(),
|
|
170
|
+
__metadata("design:type", dimension_validator_1.DimensionValidator)
|
|
171
|
+
], UpdateProductValidator.prototype, "dimension", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, class_transformer_1.Type)(function () { return attributes_validator_1.AttributesValidator; }),
|
|
174
|
+
(0, class_validator_1.ValidateNested)(),
|
|
175
|
+
(0, class_validator_1.IsOptional)(),
|
|
176
|
+
__metadata("design:type", attributes_validator_1.AttributesValidator)
|
|
177
|
+
], UpdateProductValidator.prototype, "attributes", void 0);
|
|
178
|
+
return UpdateProductValidator;
|
|
179
|
+
}());
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AttributesValidator = void 0;
|
|
13
|
+
var class_validator_1 = require("class-validator");
|
|
14
|
+
var AttributesValidator = exports.AttributesValidator = (function () {
|
|
15
|
+
function AttributesValidator() {
|
|
16
|
+
this.units = 1;
|
|
17
|
+
this.stock = null;
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsPositive)(),
|
|
21
|
+
__metadata("design:type", Object)
|
|
22
|
+
], AttributesValidator.prototype, "units", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsNumber)(),
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], AttributesValidator.prototype, "stock", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsOptional)(),
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], AttributesValidator.prototype, "sku", void 0);
|
|
34
|
+
return AttributesValidator;
|
|
35
|
+
}());
|
|
@@ -0,0 +1,38 @@
|
|
|
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.DimensionValidator = void 0;
|
|
13
|
+
var class_validator_1 = require("class-validator");
|
|
14
|
+
var DimensionValidator = exports.DimensionValidator = (function () {
|
|
15
|
+
function DimensionValidator() {
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsPositive)(),
|
|
19
|
+
(0, class_validator_1.IsOptional)(),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], DimensionValidator.prototype, "weight", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsPositive)(),
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], DimensionValidator.prototype, "height", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsPositive)(),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], DimensionValidator.prototype, "width", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsPositive)(),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], DimensionValidator.prototype, "depth", void 0);
|
|
37
|
+
return DimensionValidator;
|
|
38
|
+
}());
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractEntity } from '../../../abstracts/abstract.entity';
|
|
2
|
+
import { AddressValidator } from '../orders/validators/address.validator';
|
|
3
|
+
export declare class CustomerEntity extends AbstractEntity {
|
|
4
|
+
name: string;
|
|
5
|
+
email: string;
|
|
6
|
+
phone: string;
|
|
7
|
+
addresses: AddressValidator[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { CustomerEntity } from './customer.entity';
|
|
27
|
+
export declare namespace CustomerSchema {
|
|
28
|
+
const name = "sale_customers";
|
|
29
|
+
const schema: import("mongoose").Schema<CustomerEntity, import("mongoose").Model<CustomerEntity, any, any, any, import("mongoose").Document<unknown, any, CustomerEntity> & CustomerEntity & Required<{
|
|
30
|
+
_id: string;
|
|
31
|
+
}>, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CustomerEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CustomerEntity>> & import("mongoose").FlatRecord<CustomerEntity> & Required<{
|
|
32
|
+
_id: string;
|
|
33
|
+
}>>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomerSchema = void 0;
|
|
4
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
5
|
+
var customer_entity_1 = require("./customer.entity");
|
|
6
|
+
var CustomerSchema;
|
|
7
|
+
(function (CustomerSchema) {
|
|
8
|
+
CustomerSchema.name = 'sale_customers';
|
|
9
|
+
CustomerSchema.schema = mongoose_1.SchemaFactory.createForClass(customer_entity_1.CustomerEntity);
|
|
10
|
+
})(CustomerSchema || (exports.CustomerSchema = CustomerSchema = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractValidator } from '../../../abstracts/abstract.validator';
|
|
2
|
+
import { AddressValidator } from '../orders/validators/address.validator';
|
|
3
|
+
export declare class CreateCustomerValidator extends AbstractValidator {
|
|
4
|
+
name: string;
|
|
5
|
+
email: string;
|
|
6
|
+
phone?: string;
|
|
7
|
+
addresses?: AddressValidator[];
|
|
8
|
+
}
|
|
9
|
+
export declare class UpdateCustomerValidator {
|
|
10
|
+
name?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
phone?: string;
|
|
13
|
+
addresses?: AddressValidator[];
|
|
14
|
+
}
|