@merkaly/api 0.2.4-0 → 0.2.4-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/abstract/abstract.entity.d.ts +1 -1
- package/.output/abstract/abstract.exception.d.ts +11 -0
- package/.output/abstract/abstract.exception.js +53 -0
- package/.output/abstract/abstract.validator.d.ts +2 -2
- package/.output/abstract/abstract.validator.js +1 -0
- package/.output/exceptions/missing-identity.exception.d.ts +5 -0
- package/.output/{modules/setting/organization/organization.entity.js → exceptions/missing-identity.exception.js} +12 -10
- package/.output/exceptions/store-not-implemented.exception.d.ts +5 -0
- package/.output/exceptions/store-not-implemented.exception.js +31 -0
- package/.output/exceptions/store-not-recognized.exception.d.ts +5 -0
- package/.output/exceptions/store-not-recognized.exception.js +30 -0
- package/.output/modules/inventory/brands/brand.exception.d.ts +5 -0
- package/.output/modules/{setting/theme/theme.entity.js → inventory/brands/brand.exception.js} +15 -21
- package/.output/modules/inventory/categories/category.exception.d.ts +5 -0
- package/.output/modules/{setting/layout/layout.entity.js → inventory/categories/category.exception.js} +15 -21
- package/.output/modules/inventory/products/product.entity.d.ts +1 -0
- package/.output/modules/inventory/products/product.exception.d.ts +5 -0
- package/.output/modules/inventory/products/{entities/price.entity.js → product.exception.js} +15 -24
- package/.output/modules/inventory/products/product.validator.d.ts +2 -1
- package/.output/modules/inventory/products/product.validator.js +7 -0
- package/.output/modules/inventory/properties/property.exception.d.ts +5 -0
- package/.output/modules/inventory/{brands/brand.entity.js → properties/property.exception.js} +15 -25
- package/.output/modules/sales/clients/client.exception.d.ts +5 -0
- package/.output/modules/sales/clients/client.exception.js +40 -0
- package/.output/modules/sales/orders/billing/billing.entity.d.ts +8 -6
- package/.output/modules/sales/orders/billing/billing.types.d.ts +9 -0
- package/.output/modules/sales/orders/billing/billing.types.js +14 -0
- package/.output/modules/sales/orders/billing/billing.validator.d.ts +6 -10
- package/.output/modules/sales/orders/billing/billing.validator.js +10 -15
- package/.output/modules/sales/orders/{address → billing/entities}/address.entity.d.ts +2 -1
- package/.output/modules/sales/orders/billing/entities/customer.entity.d.ts +5 -0
- package/.output/modules/sales/orders/billing/entities/status.entity.d.ts +6 -0
- package/.output/modules/sales/orders/{address → billing/validators}/address.validator.d.ts +2 -1
- package/.output/modules/sales/orders/{address → billing/validators}/address.validator.js +12 -14
- package/.output/modules/sales/orders/billing/validators/customer.validator.d.ts +5 -0
- package/.output/modules/sales/orders/{status/status.entity.js → billing/validators/customer.validator.js} +20 -21
- package/.output/modules/sales/orders/customer/customer.validator.d.ts +1 -1
- package/.output/modules/sales/orders/customer/customer.validator.js +8 -8
- package/.output/modules/sales/orders/order.entity.d.ts +1 -1
- package/.output/modules/sales/orders/order.exception.d.ts +13 -0
- package/.output/modules/sales/orders/order.exception.js +46 -0
- package/.output/modules/sales/orders/order.validator.d.ts +3 -3
- package/.output/modules/sales/orders/order.validator.js +7 -6
- package/.output/modules/sales/orders/shipping/entities/address.entity.d.ts +10 -0
- package/.output/modules/sales/orders/shipping/entities/customer.entity.d.ts +5 -0
- package/.output/modules/sales/orders/shipping/entities/status.entity.d.ts +6 -0
- package/.output/modules/sales/orders/shipping/shipping.entity.d.ts +8 -6
- package/.output/modules/sales/orders/shipping/shipping.types.d.ts +11 -0
- package/.output/modules/sales/orders/shipping/shipping.types.js +16 -0
- package/.output/modules/sales/orders/shipping/shipping.validator.d.ts +6 -9
- package/.output/modules/sales/orders/shipping/shipping.validator.js +10 -14
- package/.output/modules/sales/orders/shipping/validators/address.validator.d.ts +10 -0
- package/.output/modules/sales/orders/shipping/validators/address.validator.js +56 -0
- package/.output/modules/sales/orders/shipping/validators/customer.validator.d.ts +5 -0
- package/.output/modules/sales/orders/shipping/validators/customer.validator.js +36 -0
- package/.output/services/logger.service.d.ts +11 -0
- package/.output/services/logger.service.js +54 -0
- package/.output/types.d.ts +4 -1
- package/README.md +14 -14
- package/package.json +7 -7
- package/.output/abstract/abstract.entity.js +0 -53
- package/.output/modules/assets/asset.entity.js +0 -69
- package/.output/modules/content/banners/banner.entity.js +0 -54
- package/.output/modules/content/pages/page.entity.js +0 -69
- package/.output/modules/inventory/categories/category.entity.js +0 -61
- package/.output/modules/inventory/products/entities/code.entity.js +0 -53
- package/.output/modules/inventory/products/entities/dimension.entity.js +0 -57
- package/.output/modules/inventory/products/entities/seo.entity.js +0 -53
- package/.output/modules/inventory/products/product.entity.js +0 -101
- package/.output/modules/inventory/properties/property.entity.js +0 -55
- package/.output/modules/sales/clients/client.entity.js +0 -64
- package/.output/modules/sales/orders/address/address.entity.js +0 -68
- package/.output/modules/sales/orders/billing/billing.entity.js +0 -59
- package/.output/modules/sales/orders/customer/customer.entity.js +0 -52
- package/.output/modules/sales/orders/item/item.entity.js +0 -58
- package/.output/modules/sales/orders/order.entity.js +0 -89
- package/.output/modules/sales/orders/shipping/shipping.entity.js +0 -63
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ArgumentsHost, ExceptionFilter, HttpException } from '@nestjs/common';
|
|
2
|
+
import { Request, Response } from 'express';
|
|
3
|
+
import { LoggerService } from '../services/logger.service';
|
|
4
|
+
export declare abstract class AbstractException implements ExceptionFilter {
|
|
5
|
+
protected readonly $logger: LoggerService;
|
|
6
|
+
protected request: Request;
|
|
7
|
+
protected response: Response;
|
|
8
|
+
protected host: ArgumentsHost;
|
|
9
|
+
catch(exception: HttpException, host: ArgumentsHost): Response<any, Record<string, any>>;
|
|
10
|
+
protected abstract handleError(exception: HttpException): HttpException;
|
|
11
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.AbstractException = void 0;
|
|
13
|
+
var common_1 = require("@nestjs/common");
|
|
14
|
+
var logger_service_1 = require("../services/logger.service");
|
|
15
|
+
var AbstractException = (function () {
|
|
16
|
+
function AbstractException() {
|
|
17
|
+
}
|
|
18
|
+
AbstractException.prototype.catch = function (exception, host) {
|
|
19
|
+
this.host = host;
|
|
20
|
+
var ctx = this.host.switchToHttp();
|
|
21
|
+
this.response = ctx.getResponse();
|
|
22
|
+
this.request = ctx.getRequest();
|
|
23
|
+
this.$logger.error(exception);
|
|
24
|
+
var handledError = this.handleError(exception);
|
|
25
|
+
if (handledError instanceof common_1.HttpException) {
|
|
26
|
+
var trace = exception.getResponse().message;
|
|
27
|
+
this.response.statusMessage = handledError.name
|
|
28
|
+
.slice(0, -9)
|
|
29
|
+
.replace(/([A-Z])/g, ' $1')
|
|
30
|
+
.trim();
|
|
31
|
+
return this.response
|
|
32
|
+
.status(handledError.getStatus())
|
|
33
|
+
.json({
|
|
34
|
+
statusCode: handledError.getStatus(),
|
|
35
|
+
message: handledError.message,
|
|
36
|
+
error: this.response.statusMessage,
|
|
37
|
+
trace: trace,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return this.response
|
|
41
|
+
.status(500)
|
|
42
|
+
.json(new common_1.InternalServerErrorException(handledError));
|
|
43
|
+
};
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, common_1.Inject)(),
|
|
46
|
+
__metadata("design:type", logger_service_1.LoggerService)
|
|
47
|
+
], AbstractException.prototype, "$logger", void 0);
|
|
48
|
+
AbstractException = __decorate([
|
|
49
|
+
(0, common_1.Injectable)()
|
|
50
|
+
], AbstractException);
|
|
51
|
+
return AbstractException;
|
|
52
|
+
}());
|
|
53
|
+
exports.AbstractException = AbstractException;
|
|
@@ -9,12 +9,12 @@ export interface SearchResults<I> {
|
|
|
9
9
|
export declare abstract class AbstractValidator {
|
|
10
10
|
}
|
|
11
11
|
export declare type KeyOfType<T, V> = keyof {
|
|
12
|
-
[P in keyof T as T[P] extends V ? P :
|
|
12
|
+
[P in keyof T as T[P] extends V ? P : string]: any;
|
|
13
13
|
};
|
|
14
14
|
export declare class FindValidator<E extends AbstractEntity> extends AbstractValidator {
|
|
15
15
|
limit?: number;
|
|
16
16
|
page?: number;
|
|
17
17
|
sort?: Partial<Record<keyof E, SortOrder>>;
|
|
18
18
|
filters?: FilterQuery<E>;
|
|
19
|
-
join?: KeyOfType<E, AbstractEntity | AbstractEntity[]>[]
|
|
19
|
+
join?: (PopulateOptions | KeyOfType<E, AbstractEntity | AbstractEntity[]>)[];
|
|
20
20
|
}
|
|
@@ -15,14 +15,16 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
__extends(
|
|
22
|
-
function
|
|
23
|
-
return _super
|
|
18
|
+
exports.MissingIdentityException = void 0;
|
|
19
|
+
var common_1 = require("@nestjs/common");
|
|
20
|
+
var MissingIdentityException = (function (_super) {
|
|
21
|
+
__extends(MissingIdentityException, _super);
|
|
22
|
+
function MissingIdentityException() {
|
|
23
|
+
return _super.call(this, 'Missing identity parameter on your request') || this;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
25
|
+
MissingIdentityException.throw = function () {
|
|
26
|
+
throw new MissingIdentityException;
|
|
27
|
+
};
|
|
28
|
+
return MissingIdentityException;
|
|
29
|
+
}(common_1.PreconditionFailedException));
|
|
30
|
+
exports.MissingIdentityException = MissingIdentityException;
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.StoreNotImplementedException = void 0;
|
|
19
|
+
var common_1 = require("@nestjs/common");
|
|
20
|
+
var StoreNotImplementedException = (function (_super) {
|
|
21
|
+
__extends(StoreNotImplementedException, _super);
|
|
22
|
+
function StoreNotImplementedException(identity) {
|
|
23
|
+
return _super.call(this, "No store found by that id or name: [" + identity + "]") || this;
|
|
24
|
+
}
|
|
25
|
+
StoreNotImplementedException.throw = function (identity) {
|
|
26
|
+
common_1.Logger.warn('Store not found or implemented', identity);
|
|
27
|
+
throw new StoreNotImplementedException(identity);
|
|
28
|
+
};
|
|
29
|
+
return StoreNotImplementedException;
|
|
30
|
+
}(common_1.NotFoundException));
|
|
31
|
+
exports.StoreNotImplementedException = StoreNotImplementedException;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.StoreNotRecognizedException = void 0;
|
|
19
|
+
var not_acceptable_exception_1 = require("@nestjs/common/exceptions/not-acceptable.exception");
|
|
20
|
+
var StoreNotRecognizedException = (function (_super) {
|
|
21
|
+
__extends(StoreNotRecognizedException, _super);
|
|
22
|
+
function StoreNotRecognizedException() {
|
|
23
|
+
return _super.call(this, "The store could not be accepted") || this;
|
|
24
|
+
}
|
|
25
|
+
StoreNotRecognizedException.throw = function () {
|
|
26
|
+
throw new StoreNotRecognizedException();
|
|
27
|
+
};
|
|
28
|
+
return StoreNotRecognizedException;
|
|
29
|
+
}(not_acceptable_exception_1.NotAcceptableException));
|
|
30
|
+
exports.StoreNotRecognizedException = StoreNotRecognizedException;
|
package/.output/modules/{setting/theme/theme.entity.js → inventory/brands/brand.exception.js}
RENAMED
|
@@ -20,27 +20,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
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
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
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
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function ThemeEntity() {
|
|
24
|
+
exports.BrandException = void 0;
|
|
25
|
+
var common_1 = require("@nestjs/common");
|
|
26
|
+
var abstract_exception_1 = require("../../../abstract/abstract.exception");
|
|
27
|
+
var BrandException = (function (_super) {
|
|
28
|
+
__extends(BrandException, _super);
|
|
29
|
+
function BrandException() {
|
|
34
30
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
31
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}(abstract_entity_1.AbstractEntity));
|
|
46
|
-
exports.ThemeEntity = ThemeEntity;
|
|
32
|
+
BrandException.prototype.handleError = function (exception) {
|
|
33
|
+
return exception;
|
|
34
|
+
};
|
|
35
|
+
BrandException = __decorate([
|
|
36
|
+
(0, common_1.Catch)()
|
|
37
|
+
], BrandException);
|
|
38
|
+
return BrandException;
|
|
39
|
+
}(abstract_exception_1.AbstractException));
|
|
40
|
+
exports.BrandException = BrandException;
|
|
@@ -20,27 +20,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
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
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
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
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function LayoutEntity() {
|
|
24
|
+
exports.CategoryException = void 0;
|
|
25
|
+
var common_1 = require("@nestjs/common");
|
|
26
|
+
var abstract_exception_1 = require("../../../abstract/abstract.exception");
|
|
27
|
+
var CategoryException = (function (_super) {
|
|
28
|
+
__extends(CategoryException, _super);
|
|
29
|
+
function CategoryException() {
|
|
34
30
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
31
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}(abstract_entity_1.AbstractEntity));
|
|
46
|
-
exports.LayoutEntity = LayoutEntity;
|
|
32
|
+
CategoryException.prototype.handleError = function (exception) {
|
|
33
|
+
return exception;
|
|
34
|
+
};
|
|
35
|
+
CategoryException = __decorate([
|
|
36
|
+
(0, common_1.Catch)()
|
|
37
|
+
], CategoryException);
|
|
38
|
+
return CategoryException;
|
|
39
|
+
}(abstract_exception_1.AbstractException));
|
|
40
|
+
exports.CategoryException = CategoryException;
|
package/.output/modules/inventory/products/{entities/price.entity.js → product.exception.js}
RENAMED
|
@@ -20,30 +20,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
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
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
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
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function PriceEntity() {
|
|
24
|
+
exports.ProductException = void 0;
|
|
25
|
+
var common_1 = require("@nestjs/common");
|
|
26
|
+
var abstract_exception_1 = require("../../../abstract/abstract.exception");
|
|
27
|
+
var ProductException = (function (_super) {
|
|
28
|
+
__extends(ProductException, _super);
|
|
29
|
+
function ProductException() {
|
|
34
30
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
31
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(0, schema_decorator_1.Schema)()
|
|
46
|
-
], PriceEntity);
|
|
47
|
-
return PriceEntity;
|
|
48
|
-
}(Map));
|
|
49
|
-
exports.PriceEntity = PriceEntity;
|
|
32
|
+
ProductException.prototype.handleError = function (exception) {
|
|
33
|
+
return exception;
|
|
34
|
+
};
|
|
35
|
+
ProductException = __decorate([
|
|
36
|
+
(0, common_1.Catch)()
|
|
37
|
+
], ProductException);
|
|
38
|
+
return ProductException;
|
|
39
|
+
}(abstract_exception_1.AbstractException));
|
|
40
|
+
exports.ProductException = ProductException;
|
|
@@ -3,7 +3,7 @@ import { ProductCodeValidator } from './validators/code.validator';
|
|
|
3
3
|
import { ProductDimensionValidator } from './validators/dimension.validator';
|
|
4
4
|
import { ProductPriceValidator } from './validators/price.validator';
|
|
5
5
|
import { ProductSeoValidator } from './validators/seo.validator';
|
|
6
|
-
import { AbstractValidator } from
|
|
6
|
+
import { AbstractValidator } from '../../../abstract/abstract.validator';
|
|
7
7
|
export declare class CreateProductValidator extends AbstractValidator {
|
|
8
8
|
name: string;
|
|
9
9
|
description: string;
|
|
@@ -17,6 +17,7 @@ export declare class CreateProductValidator extends AbstractValidator {
|
|
|
17
17
|
seo: ProductSeoValidator;
|
|
18
18
|
dimension: ProductDimensionValidator;
|
|
19
19
|
code: ProductCodeValidator;
|
|
20
|
+
stock: number | null;
|
|
20
21
|
}
|
|
21
22
|
export declare class UpdateProductValidator extends CreateProductValidator {
|
|
22
23
|
name: string;
|
|
@@ -49,6 +49,7 @@ var CreateProductValidator = (function (_super) {
|
|
|
49
49
|
_this.seo = new seo_validator_1.ProductSeoValidator();
|
|
50
50
|
_this.dimension = new dimension_validator_1.ProductDimensionValidator();
|
|
51
51
|
_this.code = new code_validator_1.ProductCodeValidator();
|
|
52
|
+
_this.stock = null;
|
|
52
53
|
return _this;
|
|
53
54
|
}
|
|
54
55
|
__decorate([
|
|
@@ -110,6 +111,12 @@ var CreateProductValidator = (function (_super) {
|
|
|
110
111
|
(0, class_transformer_1.Type)(function () { return code_validator_1.ProductCodeValidator; }),
|
|
111
112
|
__metadata("design:type", Object)
|
|
112
113
|
], CreateProductValidator.prototype, "code", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, class_validator_1.IsNumber)(),
|
|
116
|
+
(0, class_validator_1.IsOptional)(),
|
|
117
|
+
(0, class_validator_1.Min)(0),
|
|
118
|
+
__metadata("design:type", Number)
|
|
119
|
+
], CreateProductValidator.prototype, "stock", void 0);
|
|
113
120
|
return CreateProductValidator;
|
|
114
121
|
}(abstract_validator_1.AbstractValidator));
|
|
115
122
|
exports.CreateProductValidator = CreateProductValidator;
|
package/.output/modules/inventory/{brands/brand.entity.js → properties/property.exception.js}
RENAMED
|
@@ -20,31 +20,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
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
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
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
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function BrandEntity() {
|
|
24
|
+
exports.PropertyException = void 0;
|
|
25
|
+
var common_1 = require("@nestjs/common");
|
|
26
|
+
var abstract_exception_1 = require("../../../abstract/abstract.exception");
|
|
27
|
+
var PropertyException = (function (_super) {
|
|
28
|
+
__extends(PropertyException, _super);
|
|
29
|
+
function PropertyException() {
|
|
34
30
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
31
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
BrandEntity = __decorate([
|
|
46
|
-
(0, mongoose_1.Schema)({ timestamps: true })
|
|
47
|
-
], BrandEntity);
|
|
48
|
-
return BrandEntity;
|
|
49
|
-
}(abstract_entity_1.AbstractEntity));
|
|
50
|
-
exports.BrandEntity = BrandEntity;
|
|
32
|
+
PropertyException.prototype.handleError = function (exception) {
|
|
33
|
+
return exception;
|
|
34
|
+
};
|
|
35
|
+
PropertyException = __decorate([
|
|
36
|
+
(0, common_1.Catch)()
|
|
37
|
+
], PropertyException);
|
|
38
|
+
return PropertyException;
|
|
39
|
+
}(abstract_exception_1.AbstractException));
|
|
40
|
+
exports.PropertyException = PropertyException;
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.ClientException = void 0;
|
|
25
|
+
var common_1 = require("@nestjs/common");
|
|
26
|
+
var abstract_exception_1 = require("../../../abstract/abstract.exception");
|
|
27
|
+
var ClientException = (function (_super) {
|
|
28
|
+
__extends(ClientException, _super);
|
|
29
|
+
function ClientException() {
|
|
30
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
+
}
|
|
32
|
+
ClientException.prototype.handleError = function (exception) {
|
|
33
|
+
return exception;
|
|
34
|
+
};
|
|
35
|
+
ClientException = __decorate([
|
|
36
|
+
(0, common_1.Catch)()
|
|
37
|
+
], ClientException);
|
|
38
|
+
return ClientException;
|
|
39
|
+
}(abstract_exception_1.AbstractException));
|
|
40
|
+
exports.ClientException = ClientException;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { BillingMethod } from "./billing.types";
|
|
2
|
+
import { BillingStatusEntity } from "./entities/status.entity";
|
|
3
|
+
import { BillingAddressEntity } from "./entities/address.entity";
|
|
4
|
+
import { BillingCustomerEntity } from "./entities/customer.entity";
|
|
4
5
|
export declare class BillingEntity extends Map {
|
|
5
|
-
address:
|
|
6
|
-
customer:
|
|
7
|
-
|
|
6
|
+
address: BillingAddressEntity;
|
|
7
|
+
customer: BillingCustomerEntity;
|
|
8
|
+
method: BillingMethod;
|
|
9
|
+
status: BillingStatusEntity[];
|
|
8
10
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingStatus = exports.BillingMethod = void 0;
|
|
4
|
+
var BillingMethod;
|
|
5
|
+
(function (BillingMethod) {
|
|
6
|
+
BillingMethod["CASH"] = "CASH";
|
|
7
|
+
BillingMethod["CARD"] = "CARD";
|
|
8
|
+
BillingMethod["TRANSFER"] = "TRANSFER";
|
|
9
|
+
})(BillingMethod = exports.BillingMethod || (exports.BillingMethod = {}));
|
|
10
|
+
var BillingStatus;
|
|
11
|
+
(function (BillingStatus) {
|
|
12
|
+
BillingStatus["UNPAID"] = "UNPAID";
|
|
13
|
+
BillingStatus["PAID"] = "PAID";
|
|
14
|
+
})(BillingStatus = exports.BillingStatus || (exports.BillingStatus = {}));
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { AddressValidator } from "../address/address.validator";
|
|
2
|
-
import { CreateCustomerValidator } from "../customer/customer.validator";
|
|
3
1
|
import 'reflect-metadata';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
TRANSFER = "TRANSFER"
|
|
8
|
-
}
|
|
2
|
+
import { BillingMethod } from "./billing.types";
|
|
3
|
+
import { BillingCustomerValidator } from "./validators/customer.validator";
|
|
4
|
+
import { BillingAddressValidator } from "./validators/address.validator";
|
|
9
5
|
export declare class CreateBillingValidator {
|
|
10
|
-
customer:
|
|
11
|
-
address:
|
|
12
|
-
|
|
6
|
+
customer: BillingCustomerValidator;
|
|
7
|
+
address: BillingAddressValidator;
|
|
8
|
+
method: BillingMethod;
|
|
13
9
|
}
|