@merkaly/api 0.2.5-8 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract.entity.d.ts +10 -0
- package/dist/abstract.entity.js +45 -0
- package/dist/abstract.repository.d.ts +56 -0
- package/dist/abstract.repository.js +200 -0
- package/dist/abstract.validator.d.ts +22 -0
- package/dist/abstract.validator.js +98 -0
- package/dist/account/address/address.entity.d.ts +7 -0
- package/dist/account/address/address.entity.js +34 -0
- package/dist/account/address/address.validator.d.ts +17 -0
- package/dist/account/address/address.validator.js +67 -0
- package/dist/account/address/index.d.ts +2 -0
- package/dist/account/address/index.js +12 -0
- package/dist/account/cart/cart.entity.d.ts +8 -0
- package/dist/account/cart/cart.entity.js +34 -0
- package/dist/account/cart/cart.validator.d.ts +13 -0
- package/dist/account/cart/cart.validator.js +45 -0
- package/dist/account/cart/index.d.ts +2 -0
- package/dist/account/cart/index.js +12 -0
- package/dist/account/payment/index.d.ts +2 -0
- package/dist/account/payment/index.js +12 -0
- package/dist/account/payment/payment.entity.d.ts +11 -0
- package/dist/account/payment/payment.entity.js +57 -0
- package/dist/account/payment/payment.validator.d.ts +15 -0
- package/dist/account/payment/payment.validator.js +57 -0
- package/dist/account/user/index.d.ts +2 -0
- package/dist/account/user/index.js +12 -0
- package/dist/account/user/user.entity.d.ts +8 -0
- package/dist/account/user/user.entity.js +46 -0
- package/dist/account/user/user.validator.d.ts +17 -0
- package/dist/account/user/user.validator.js +68 -0
- package/dist/account/wishlist/index.d.ts +2 -0
- package/dist/account/wishlist/index.js +12 -0
- package/dist/account/wishlist/wishlist.entity.d.ts +8 -0
- package/dist/account/wishlist/wishlist.entity.js +38 -0
- package/dist/account/wishlist/wishlist.validator.d.ts +12 -0
- package/dist/account/wishlist/wishlist.validator.js +39 -0
- package/dist/address.entity.d.ts +14 -0
- package/dist/address.entity.js +59 -0
- package/dist/assets/asset/asset.entity.d.ts +11 -0
- package/dist/assets/asset/asset.entity.js +58 -0
- package/dist/assets/asset/asset.enum.d.ts +6 -0
- package/dist/assets/asset/asset.enum.js +11 -0
- package/dist/assets/asset/index.d.ts +2 -0
- package/dist/assets/asset/index.js +12 -0
- package/dist/billing/payment/index.d.ts +2 -0
- package/dist/billing/payment/index.js +12 -0
- package/dist/billing/payment/payment.enum.d.ts +15 -0
- package/dist/billing/payment/payment.enum.js +21 -0
- package/dist/billing/payment/transaction.entity.d.ts +15 -0
- package/dist/billing/payment/transaction.entity.js +55 -0
- package/dist/billing/status/index.d.ts +1 -0
- package/dist/billing/status/index.js +7 -0
- package/dist/billing/status/status.entity.d.ts +8 -0
- package/dist/billing/status/status.entity.js +40 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/inventory/catalog/attribute/attribute.entity.d.ts +8 -0
- package/dist/inventory/catalog/attribute/attribute.entity.js +47 -0
- package/dist/inventory/catalog/attribute/attribute.validator.d.ts +15 -0
- package/dist/inventory/catalog/attribute/attribute.validator.js +58 -0
- package/dist/inventory/catalog/attribute/index.d.ts +2 -0
- package/dist/inventory/catalog/attribute/index.js +12 -0
- package/dist/inventory/catalog/brand/brand.entity.d.ts +7 -0
- package/dist/inventory/catalog/brand/brand.entity.js +33 -0
- package/dist/inventory/catalog/brand/brand.validator.d.ts +12 -0
- package/dist/inventory/catalog/brand/brand.validator.js +39 -0
- package/dist/inventory/catalog/brand/index.d.ts +2 -0
- package/dist/inventory/catalog/brand/index.js +12 -0
- package/dist/inventory/catalog/category/category.entity.d.ts +7 -0
- package/dist/inventory/catalog/category/category.entity.js +33 -0
- package/dist/inventory/catalog/category/category.validator.d.ts +12 -0
- package/dist/inventory/catalog/category/category.validator.js +39 -0
- package/dist/inventory/catalog/category/index.d.ts +2 -0
- package/dist/inventory/catalog/category/index.js +12 -0
- package/dist/inventory/catalog/collection/collection.entity.d.ts +7 -0
- package/dist/inventory/catalog/collection/collection.entity.js +42 -0
- package/dist/inventory/catalog/collection/collection.validator.d.ts +13 -0
- package/dist/inventory/catalog/collection/collection.validator.js +45 -0
- package/dist/inventory/catalog/collection/index.d.ts +2 -0
- package/dist/inventory/catalog/collection/index.js +12 -0
- package/dist/inventory/catalog/product/index.d.ts +3 -0
- package/dist/inventory/catalog/product/index.js +17 -0
- package/dist/inventory/catalog/product/product.entity.d.ts +31 -0
- package/dist/inventory/catalog/product/product.entity.js +115 -0
- package/dist/inventory/catalog/product/product.status.enum.d.ts +8 -0
- package/dist/inventory/catalog/product/product.status.enum.js +13 -0
- package/dist/inventory/catalog/product/product.validator.d.ts +39 -0
- package/dist/inventory/catalog/product/product.validator.js +135 -0
- package/dist/inventory/configuration/label/index.d.ts +2 -0
- package/dist/inventory/configuration/label/index.js +12 -0
- package/dist/inventory/configuration/label/label.entity.d.ts +7 -0
- package/dist/inventory/configuration/label/label.entity.js +42 -0
- package/dist/inventory/configuration/label/label.validator.d.ts +14 -0
- package/dist/inventory/configuration/label/label.validator.js +51 -0
- package/dist/inventory/configuration/measurement/index.d.ts +2 -0
- package/dist/inventory/configuration/measurement/index.js +12 -0
- package/dist/inventory/configuration/measurement/measurement.entity.d.ts +8 -0
- package/dist/inventory/configuration/measurement/measurement.entity.js +42 -0
- package/dist/inventory/configuration/measurement/measurement.validator.d.ts +21 -0
- package/dist/inventory/configuration/measurement/measurement.validator.js +87 -0
- package/dist/inventory/configuration/unit/index.d.ts +1 -0
- package/dist/inventory/configuration/unit/index.js +7 -0
- package/dist/inventory/configuration/unit/unit.entity.d.ts +8 -0
- package/dist/inventory/configuration/unit/unit.entity.js +46 -0
- package/dist/inventory/stock/backorder/backorder.entity.d.ts +33 -0
- package/dist/inventory/stock/backorder/backorder.entity.js +106 -0
- package/dist/inventory/stock/backorder/backorder.validator.d.ts +24 -0
- package/dist/inventory/stock/backorder/backorder.validator.js +112 -0
- package/dist/inventory/stock/backorder/index.d.ts +2 -0
- package/dist/inventory/stock/backorder/index.js +12 -0
- package/dist/inventory/stock/transfer/index.d.ts +2 -0
- package/dist/inventory/stock/transfer/index.js +12 -0
- package/dist/inventory/stock/transfer/transfer.entity.d.ts +28 -0
- package/dist/inventory/stock/transfer/transfer.entity.js +108 -0
- package/dist/inventory/stock/transfer/transfer.validator.d.ts +25 -0
- package/dist/inventory/stock/transfer/transfer.validator.js +108 -0
- package/dist/inventory/stock/warehouse/index.d.ts +2 -0
- package/dist/inventory/stock/warehouse/index.js +12 -0
- package/dist/inventory/stock/warehouse/warehouse.entity.d.ts +21 -0
- package/dist/inventory/stock/warehouse/warehouse.entity.js +67 -0
- package/dist/inventory/stock/warehouse/warehouse.validator.d.ts +27 -0
- package/dist/inventory/stock/warehouse/warehouse.validator.js +115 -0
- package/dist/logistic/carrier/carrier.entity.d.ts +10 -0
- package/dist/logistic/carrier/carrier.entity.js +57 -0
- package/dist/logistic/carrier/carrier.validator.d.ts +17 -0
- package/dist/logistic/carrier/carrier.validator.js +69 -0
- package/dist/logistic/carrier/index.d.ts +2 -0
- package/dist/logistic/carrier/index.js +12 -0
- package/dist/logistic/shipment/index.d.ts +3 -0
- package/dist/logistic/shipment/index.js +17 -0
- package/dist/logistic/shipment/shipment.entity.d.ts +19 -0
- package/dist/logistic/shipment/shipment.entity.js +67 -0
- package/dist/logistic/shipment/shipment.enum.d.ts +16 -0
- package/dist/logistic/shipment/shipment.enum.js +22 -0
- package/dist/logistic/shipment/shipment.validator.d.ts +18 -0
- package/dist/logistic/shipment/shipment.validator.js +65 -0
- package/dist/order/purchase/item/index.d.ts +2 -0
- package/dist/order/purchase/item/index.js +12 -0
- package/dist/order/purchase/item/item.entity.d.ts +11 -0
- package/dist/order/purchase/item/item.entity.js +46 -0
- package/dist/order/purchase/item/item.validator.d.ts +7 -0
- package/dist/order/purchase/item/item.validator.js +41 -0
- package/dist/order/purchase/transaction/index.d.ts +3 -0
- package/dist/order/purchase/transaction/index.js +17 -0
- package/dist/order/purchase/transaction/transaction.entity.d.ts +17 -0
- package/dist/order/purchase/transaction/transaction.entity.js +67 -0
- package/dist/order/purchase/transaction/transaction.enum.d.ts +8 -0
- package/dist/order/purchase/transaction/transaction.enum.js +13 -0
- package/dist/order/purchase/transaction/transaction.validator.d.ts +21 -0
- package/dist/order/purchase/transaction/transaction.validator.js +87 -0
- package/dist/order/purchase/vendor/index.d.ts +2 -0
- package/dist/order/purchase/vendor/index.js +12 -0
- package/dist/order/purchase/vendor/vendor.entity.d.ts +11 -0
- package/dist/order/purchase/vendor/vendor.entity.js +62 -0
- package/dist/order/purchase/vendor/vendor.validator.d.ts +18 -0
- package/dist/order/purchase/vendor/vendor.validator.js +75 -0
- package/dist/order/sale/address/address.validator.d.ts +11 -0
- package/dist/order/sale/address/address.validator.js +70 -0
- package/dist/order/sale/address/index.d.ts +1 -0
- package/dist/order/sale/address/index.js +7 -0
- package/dist/order/sale/customer/customer.entity.d.ts +11 -0
- package/dist/order/sale/customer/customer.entity.js +62 -0
- package/dist/order/sale/customer/customer.validator.d.ts +18 -0
- package/dist/order/sale/customer/customer.validator.js +77 -0
- package/dist/order/sale/customer/index.d.ts +2 -0
- package/dist/order/sale/customer/index.js +12 -0
- package/dist/order/sale/item/index.d.ts +2 -0
- package/dist/order/sale/item/index.js +12 -0
- package/dist/order/sale/item/item.entity.d.ts +10 -0
- package/dist/order/sale/item/item.entity.js +45 -0
- package/dist/order/sale/item/item.validator.d.ts +5 -0
- package/{.output/modules/sale/orders/validators → dist/order/sale/item}/item.validator.js +23 -21
- package/dist/order/sale/payment/index.d.ts +1 -0
- package/dist/order/sale/payment/index.js +7 -0
- package/dist/order/sale/payment/payment.validator.d.ts +16 -0
- package/dist/order/sale/payment/payment.validator.js +51 -0
- package/dist/order/sale/transaction/index.d.ts +3 -0
- package/dist/order/sale/transaction/index.js +17 -0
- package/dist/order/sale/transaction/transaction.entity.d.ts +21 -0
- package/dist/order/sale/transaction/transaction.entity.js +56 -0
- package/dist/order/sale/transaction/transaction.enum.d.ts +8 -0
- package/dist/order/sale/transaction/transaction.enum.js +13 -0
- package/dist/order/sale/transaction/transaction.validator.d.ts +21 -0
- package/dist/order/sale/transaction/transaction.validator.js +76 -0
- package/dist/repository.types.d.ts +13 -0
- package/package.json +102 -86
- package/.output/abstracts/abstract.entity.d.ts +0 -14
- package/.output/abstracts/abstract.validator.d.ts +0 -24
- package/.output/abstracts/abstract.validator.js +0 -118
- package/.output/exceptions/missing-identity.exception.d.ts +0 -5
- package/.output/exceptions/missing-identity.exception.js +0 -30
- package/.output/modules/asset/files/file.entity.d.ts +0 -9
- package/.output/modules/asset/files/file.schema.d.ts +0 -34
- package/.output/modules/asset/files/file.schema.js +0 -10
- package/.output/modules/auth/organizations/organization.entity.d.ts +0 -8
- package/.output/modules/auth/users/user.entity.d.ts +0 -9
- package/.output/modules/auth/users/user.schema.d.ts +0 -34
- package/.output/modules/auth/users/user.schema.js +0 -10
- package/.output/modules/auth/users/user.validator.d.ts +0 -12
- package/.output/modules/auth/users/user.validator.js +0 -58
- package/.output/modules/inventory/brands/brand.entity.d.ts +0 -6
- package/.output/modules/inventory/brands/brand.schema.d.ts +0 -34
- package/.output/modules/inventory/brands/brand.schema.js +0 -10
- package/.output/modules/inventory/brands/brand.validator.d.ts +0 -11
- package/.output/modules/inventory/brands/brand.validator.js +0 -74
- package/.output/modules/inventory/categories/category.entity.d.ts +0 -6
- package/.output/modules/inventory/categories/category.schema.d.ts +0 -34
- package/.output/modules/inventory/categories/category.schema.js +0 -10
- package/.output/modules/inventory/categories/category.validator.d.ts +0 -8
- package/.output/modules/inventory/categories/category.validator.js +0 -42
- package/.output/modules/inventory/products/documents/attribute.document.d.ts +0 -5
- package/.output/modules/inventory/products/documents/attribute.document.js +0 -33
- package/.output/modules/inventory/products/documents/dimension.document.d.ts +0 -6
- package/.output/modules/inventory/products/documents/dimension.document.js +0 -35
- package/.output/modules/inventory/products/product.entity.d.ts +0 -19
- package/.output/modules/inventory/products/product.schema.d.ts +0 -34
- package/.output/modules/inventory/products/product.schema.js +0 -18
- package/.output/modules/inventory/products/product.validator.d.ts +0 -29
- package/.output/modules/inventory/products/product.validator.js +0 -181
- package/.output/modules/inventory/products/validators/attributes.validator.d.ts +0 -5
- package/.output/modules/inventory/products/validators/attributes.validator.js +0 -35
- package/.output/modules/inventory/products/validators/dimension.validator.d.ts +0 -6
- package/.output/modules/inventory/products/validators/dimension.validator.js +0 -38
- package/.output/modules/sale/customers/customer.entity.d.ts +0 -8
- package/.output/modules/sale/customers/customer.schema.d.ts +0 -34
- package/.output/modules/sale/customers/customer.schema.js +0 -10
- package/.output/modules/sale/customers/customer.validator.d.ts +0 -14
- package/.output/modules/sale/customers/customer.validator.js +0 -94
- package/.output/modules/sale/orders/documents/address.document.d.ts +0 -8
- package/.output/modules/sale/orders/documents/address.document.js +0 -43
- package/.output/modules/sale/orders/documents/status.document.d.ts +0 -8
- package/.output/modules/sale/orders/documents/status.document.js +0 -34
- package/.output/modules/sale/orders/entities/item.entity.d.ts +0 -38
- package/.output/modules/sale/orders/enums/order.status.d.ts +0 -6
- package/.output/modules/sale/orders/enums/order.status.js +0 -10
- package/.output/modules/sale/orders/order.entity.d.ts +0 -21
- package/.output/modules/sale/orders/order.validator.d.ts +0 -16
- package/.output/modules/sale/orders/order.validator.js +0 -86
- package/.output/modules/sale/orders/validators/address.validator.d.ts +0 -17
- package/.output/modules/sale/orders/validators/address.validator.js +0 -81
- package/.output/modules/sale/orders/validators/billing.validator.d.ts +0 -8
- package/.output/modules/sale/orders/validators/billing.validator.js +0 -13
- package/.output/modules/sale/orders/validators/item.validator.d.ts +0 -5
- package/.output/modules/sale/orders/validators/payment.validator.d.ts +0 -10
- package/.output/modules/sale/orders/validators/payment.validator.js +0 -62
- package/.output/modules/sale/orders/validators/shipping.validator.d.ts +0 -9
- package/.output/modules/sale/orders/validators/shipping.validator.js +0 -14
- package/.output/modules/sale/payments/entities/status.entity.d.ts +0 -8
- package/.output/modules/sale/payments/enums/billing.type.d.ts +0 -6
- package/.output/modules/sale/payments/enums/billing.type.js +0 -10
- package/.output/modules/sale/payments/enums/payment.status.d.ts +0 -7
- package/.output/modules/sale/payments/enums/payment.status.js +0 -11
- package/.output/modules/sale/payments/enums/shipping.type.d.ts +0 -4
- package/.output/modules/sale/payments/enums/shipping.type.js +0 -8
- package/.output/modules/sale/payments/payment.entity.d.ts +0 -12
- package/.output/modules/sale/payments/payment.schema.d.ts +0 -34
- package/.output/modules/sale/payments/payment.schema.js +0 -14
- package/.output/modules/sale/payments/payment.validator.d.ts +0 -16
- package/.output/modules/sale/payments/payment.validator.js +0 -77
- package/.output/tsconfig.package.tsbuildinfo +0 -1
- package/README.md +0 -79
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { MaybeEntity } from '../../../abstracts/abstract.entity';
|
|
2
|
-
import { AbstractEntity } from '../../../abstracts/abstract.entity';
|
|
3
|
-
import { UserEntity } from '../../auth/users/user.entity';
|
|
4
|
-
import { CustomerEntity } from '../customers/customer.entity';
|
|
5
|
-
import { PaymentEntity } from '../payments/payment.entity';
|
|
6
|
-
import { AddressDocument } from './documents/address.document';
|
|
7
|
-
import { StatusDocument } from './documents/status.document';
|
|
8
|
-
import { ItemEntity } from './entities/item.entity';
|
|
9
|
-
export declare class OrderEntity extends AbstractEntity {
|
|
10
|
-
number: number;
|
|
11
|
-
items: ItemEntity[];
|
|
12
|
-
status: StatusDocument[];
|
|
13
|
-
payment: MaybeEntity<PaymentEntity>;
|
|
14
|
-
customer: MaybeEntity<CustomerEntity>;
|
|
15
|
-
user: MaybeEntity<UserEntity>;
|
|
16
|
-
address: AddressDocument;
|
|
17
|
-
description: string;
|
|
18
|
-
readonly total: number;
|
|
19
|
-
readonly fullNumber: string;
|
|
20
|
-
readonly lastStatus: StatusDocument;
|
|
21
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IdMongoValidator } from '../../../abstracts/abstract.validator';
|
|
2
|
-
import { OrderStatus } from './enums/order.status';
|
|
3
|
-
import { BillingValidator } from './validators/billing.validator';
|
|
4
|
-
import { CreateItemValidator } from './validators/item.validator';
|
|
5
|
-
import { ShippingValidator } from './validators/shipping.validator';
|
|
6
|
-
export declare class CreateOrderValidator {
|
|
7
|
-
items: CreateItemValidator[];
|
|
8
|
-
billing: BillingValidator;
|
|
9
|
-
shipping: ShippingValidator;
|
|
10
|
-
description: string;
|
|
11
|
-
}
|
|
12
|
-
export declare class UpdateOrderValidator extends CreateOrderValidator {
|
|
13
|
-
}
|
|
14
|
-
export declare class UpdateOrderStatusValidator extends IdMongoValidator {
|
|
15
|
-
type: OrderStatus;
|
|
16
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
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.UpdateOrderStatusValidator = exports.UpdateOrderValidator = exports.CreateOrderValidator = 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 order_status_1 = require("./enums/order.status");
|
|
32
|
-
var billing_validator_1 = require("./validators/billing.validator");
|
|
33
|
-
var item_validator_1 = require("./validators/item.validator");
|
|
34
|
-
var shipping_validator_1 = require("./validators/shipping.validator");
|
|
35
|
-
var CreateOrderValidator = exports.CreateOrderValidator = (function () {
|
|
36
|
-
function CreateOrderValidator() {
|
|
37
|
-
this.items = [];
|
|
38
|
-
this.billing = new billing_validator_1.BillingValidator();
|
|
39
|
-
this.shipping = new shipping_validator_1.ShippingValidator();
|
|
40
|
-
this.description = String();
|
|
41
|
-
}
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, class_validator_1.IsArray)(),
|
|
44
|
-
(0, class_validator_1.ArrayNotEmpty)(),
|
|
45
|
-
(0, class_transformer_1.Type)(function () { return item_validator_1.CreateItemValidator; }),
|
|
46
|
-
(0, class_validator_1.ValidateNested)(),
|
|
47
|
-
__metadata("design:type", Array)
|
|
48
|
-
], CreateOrderValidator.prototype, "items", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, class_transformer_1.Type)(function () { return billing_validator_1.BillingValidator; }),
|
|
51
|
-
(0, class_validator_1.ValidateNested)(),
|
|
52
|
-
(0, class_validator_1.IsNotEmptyObject)(),
|
|
53
|
-
__metadata("design:type", Object)
|
|
54
|
-
], CreateOrderValidator.prototype, "billing", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, class_transformer_1.Type)(function () { return shipping_validator_1.ShippingValidator; }),
|
|
57
|
-
(0, class_validator_1.ValidateNested)(),
|
|
58
|
-
(0, class_validator_1.IsNotEmptyObject)(),
|
|
59
|
-
__metadata("design:type", Object)
|
|
60
|
-
], CreateOrderValidator.prototype, "shipping", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, class_validator_1.IsString)(),
|
|
63
|
-
(0, class_validator_1.IsOptional)(),
|
|
64
|
-
__metadata("design:type", Object)
|
|
65
|
-
], CreateOrderValidator.prototype, "description", void 0);
|
|
66
|
-
return CreateOrderValidator;
|
|
67
|
-
}());
|
|
68
|
-
var UpdateOrderValidator = (function (_super) {
|
|
69
|
-
__extends(UpdateOrderValidator, _super);
|
|
70
|
-
function UpdateOrderValidator() {
|
|
71
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
72
|
-
}
|
|
73
|
-
return UpdateOrderValidator;
|
|
74
|
-
}(CreateOrderValidator));
|
|
75
|
-
exports.UpdateOrderValidator = UpdateOrderValidator;
|
|
76
|
-
var UpdateOrderStatusValidator = exports.UpdateOrderStatusValidator = (function (_super) {
|
|
77
|
-
__extends(UpdateOrderStatusValidator, _super);
|
|
78
|
-
function UpdateOrderStatusValidator() {
|
|
79
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
80
|
-
}
|
|
81
|
-
__decorate([
|
|
82
|
-
(0, class_validator_1.IsEnum)(order_status_1.OrderStatus),
|
|
83
|
-
__metadata("design:type", String)
|
|
84
|
-
], UpdateOrderStatusValidator.prototype, "type", void 0);
|
|
85
|
-
return UpdateOrderStatusValidator;
|
|
86
|
-
}(abstract_validator_1.IdMongoValidator));
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare class CreateAddressValidator {
|
|
2
|
-
street: string;
|
|
3
|
-
complement: string;
|
|
4
|
-
city: string;
|
|
5
|
-
state: string;
|
|
6
|
-
number: string;
|
|
7
|
-
neighborhood: string;
|
|
8
|
-
zipCode: string;
|
|
9
|
-
}
|
|
10
|
-
export declare class AddressValidator {
|
|
11
|
-
line1: string;
|
|
12
|
-
line2: string;
|
|
13
|
-
city: string;
|
|
14
|
-
state: string;
|
|
15
|
-
country: string;
|
|
16
|
-
code: string;
|
|
17
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
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.AddressValidator = exports.CreateAddressValidator = void 0;
|
|
13
|
-
var class_validator_1 = require("class-validator");
|
|
14
|
-
var CreateAddressValidator = exports.CreateAddressValidator = (function () {
|
|
15
|
-
function CreateAddressValidator() {
|
|
16
|
-
}
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, class_validator_1.IsString)(),
|
|
19
|
-
__metadata("design:type", String)
|
|
20
|
-
], CreateAddressValidator.prototype, "street", void 0);
|
|
21
|
-
__decorate([
|
|
22
|
-
(0, class_validator_1.IsString)(),
|
|
23
|
-
(0, class_validator_1.IsOptional)(),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], CreateAddressValidator.prototype, "complement", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, class_validator_1.IsString)(),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], CreateAddressValidator.prototype, "city", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, class_validator_1.IsString)(),
|
|
32
|
-
__metadata("design:type", String)
|
|
33
|
-
], CreateAddressValidator.prototype, "state", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, class_validator_1.IsString)(),
|
|
36
|
-
__metadata("design:type", String)
|
|
37
|
-
], CreateAddressValidator.prototype, "number", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, class_validator_1.IsString)(),
|
|
40
|
-
(0, class_validator_1.IsOptional)(),
|
|
41
|
-
__metadata("design:type", String)
|
|
42
|
-
], CreateAddressValidator.prototype, "neighborhood", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, class_validator_1.IsString)(),
|
|
45
|
-
(0, class_validator_1.Matches)(/[a-zA-Z0-9_-]{8}/, { message: 'zipCode must be valid' }),
|
|
46
|
-
__metadata("design:type", String)
|
|
47
|
-
], CreateAddressValidator.prototype, "zipCode", void 0);
|
|
48
|
-
return CreateAddressValidator;
|
|
49
|
-
}());
|
|
50
|
-
var AddressValidator = exports.AddressValidator = (function () {
|
|
51
|
-
function AddressValidator() {
|
|
52
|
-
}
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, class_validator_1.IsString)(),
|
|
55
|
-
__metadata("design:type", String)
|
|
56
|
-
], AddressValidator.prototype, "line1", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
(0, class_validator_1.IsString)(),
|
|
59
|
-
(0, class_validator_1.IsOptional)(),
|
|
60
|
-
__metadata("design:type", String)
|
|
61
|
-
], AddressValidator.prototype, "line2", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, class_validator_1.IsString)(),
|
|
64
|
-
__metadata("design:type", String)
|
|
65
|
-
], AddressValidator.prototype, "city", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, class_validator_1.IsString)(),
|
|
68
|
-
__metadata("design:type", String)
|
|
69
|
-
], AddressValidator.prototype, "state", void 0);
|
|
70
|
-
__decorate([
|
|
71
|
-
(0, class_validator_1.IsString)(),
|
|
72
|
-
(0, class_validator_1.IsISO31661Alpha2)(),
|
|
73
|
-
__metadata("design:type", String)
|
|
74
|
-
], AddressValidator.prototype, "country", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
(0, class_validator_1.IsString)(),
|
|
77
|
-
(0, class_validator_1.Matches)(/[a-zA-Z0-9_-]{8}/, { message: 'zipCode must be valid' }),
|
|
78
|
-
__metadata("design:type", String)
|
|
79
|
-
], AddressValidator.prototype, "code", void 0);
|
|
80
|
-
return AddressValidator;
|
|
81
|
-
}());
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BillingType } from '../../payments/enums/billing.type';
|
|
2
|
-
import { AddressValidator } from './address.validator';
|
|
3
|
-
import { PaymentValidator } from './payment.validator';
|
|
4
|
-
export declare class BillingValidator {
|
|
5
|
-
type: BillingType;
|
|
6
|
-
payload: PaymentValidator;
|
|
7
|
-
address: AddressValidator;
|
|
8
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BillingValidator = void 0;
|
|
4
|
-
var address_validator_1 = require("./address.validator");
|
|
5
|
-
var payment_validator_1 = require("./payment.validator");
|
|
6
|
-
var BillingValidator = (function () {
|
|
7
|
-
function BillingValidator() {
|
|
8
|
-
this.payload = new payment_validator_1.PaymentValidator();
|
|
9
|
-
this.address = new address_validator_1.AddressValidator();
|
|
10
|
-
}
|
|
11
|
-
return BillingValidator;
|
|
12
|
-
}());
|
|
13
|
-
exports.BillingValidator = BillingValidator;
|
|
@@ -1,62 +0,0 @@
|
|
|
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.PaymentValidator = exports.PaymentCardValidator = void 0;
|
|
13
|
-
var class_transformer_1 = require("class-transformer");
|
|
14
|
-
var class_validator_1 = require("class-validator");
|
|
15
|
-
var PaymentCardValidator = exports.PaymentCardValidator = (function () {
|
|
16
|
-
function PaymentCardValidator() {
|
|
17
|
-
this.number = String();
|
|
18
|
-
this.name = String();
|
|
19
|
-
this.cvv = String();
|
|
20
|
-
}
|
|
21
|
-
__decorate([
|
|
22
|
-
(0, class_validator_1.IsString)(),
|
|
23
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
24
|
-
__metadata("design:type", Object)
|
|
25
|
-
], PaymentCardValidator.prototype, "number", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, class_validator_1.IsString)(),
|
|
28
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
29
|
-
__metadata("design:type", Object)
|
|
30
|
-
], PaymentCardValidator.prototype, "name", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, class_validator_1.IsPositive)(),
|
|
33
|
-
(0, class_validator_1.Min)(1),
|
|
34
|
-
(0, class_validator_1.Max)(12),
|
|
35
|
-
__metadata("design:type", Number)
|
|
36
|
-
], PaymentCardValidator.prototype, "expMonth", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, class_validator_1.IsPositive)(),
|
|
39
|
-
(0, class_validator_1.Min)(new Date().getFullYear()),
|
|
40
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
41
|
-
__metadata("design:type", Number)
|
|
42
|
-
], PaymentCardValidator.prototype, "expYear", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, class_validator_1.IsNumberString)(),
|
|
45
|
-
(0, class_validator_1.Length)(3, 4),
|
|
46
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
47
|
-
__metadata("design:type", Object)
|
|
48
|
-
], PaymentCardValidator.prototype, "cvv", void 0);
|
|
49
|
-
return PaymentCardValidator;
|
|
50
|
-
}());
|
|
51
|
-
var PaymentValidator = exports.PaymentValidator = (function () {
|
|
52
|
-
function PaymentValidator() {
|
|
53
|
-
this.card = new PaymentCardValidator();
|
|
54
|
-
}
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, class_validator_1.ValidateNested)(),
|
|
57
|
-
(0, class_transformer_1.Type)(function () { return PaymentCardValidator; }),
|
|
58
|
-
(0, class_validator_1.IsOptional)(),
|
|
59
|
-
__metadata("design:type", Object)
|
|
60
|
-
], PaymentValidator.prototype, "card", void 0);
|
|
61
|
-
return PaymentValidator;
|
|
62
|
-
}());
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ShippingType } from '../../payments/enums/shipping.type';
|
|
2
|
-
import { AddressValidator } from './address.validator';
|
|
3
|
-
export declare class ShippingValidator {
|
|
4
|
-
address: AddressValidator;
|
|
5
|
-
type: ShippingType;
|
|
6
|
-
name: string;
|
|
7
|
-
phone: string;
|
|
8
|
-
email: string;
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ShippingValidator = void 0;
|
|
4
|
-
var address_validator_1 = require("./address.validator");
|
|
5
|
-
var ShippingValidator = (function () {
|
|
6
|
-
function ShippingValidator() {
|
|
7
|
-
this.address = new address_validator_1.AddressValidator();
|
|
8
|
-
this.name = String();
|
|
9
|
-
this.phone = String();
|
|
10
|
-
this.email = String();
|
|
11
|
-
}
|
|
12
|
-
return ShippingValidator;
|
|
13
|
-
}());
|
|
14
|
-
exports.ShippingValidator = ShippingValidator;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MaybeEntity } from '../../../../abstracts/abstract.entity';
|
|
2
|
-
import { UserEntity } from '../../../auth/users/user.entity';
|
|
3
|
-
import { PaymentStatus } from '../enums/payment.status';
|
|
4
|
-
export declare class StatusEntity {
|
|
5
|
-
name: PaymentStatus;
|
|
6
|
-
user: MaybeEntity<UserEntity>;
|
|
7
|
-
date: Date;
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BillingType = void 0;
|
|
4
|
-
var BillingType;
|
|
5
|
-
(function (BillingType) {
|
|
6
|
-
BillingType["PIX"] = "PIX";
|
|
7
|
-
BillingType["BOLETO"] = "BOLETO";
|
|
8
|
-
BillingType["CARD"] = "CARD";
|
|
9
|
-
BillingType["TRANSFER"] = "TRANSFER";
|
|
10
|
-
})(BillingType || (exports.BillingType = BillingType = {}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentStatus = void 0;
|
|
4
|
-
var PaymentStatus;
|
|
5
|
-
(function (PaymentStatus) {
|
|
6
|
-
PaymentStatus["UNPAID"] = "UNPAID";
|
|
7
|
-
PaymentStatus["WAITING"] = "WAITING";
|
|
8
|
-
PaymentStatus["PAID"] = "PAID";
|
|
9
|
-
PaymentStatus["REFUNDED"] = "REFUNDED";
|
|
10
|
-
PaymentStatus["CANCELLED"] = "CANCELLED";
|
|
11
|
-
})(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ShippingType = void 0;
|
|
4
|
-
var ShippingType;
|
|
5
|
-
(function (ShippingType) {
|
|
6
|
-
ShippingType["RETIRE"] = "RETIRE";
|
|
7
|
-
ShippingType["DELIVERY"] = "DELIVERY";
|
|
8
|
-
})(ShippingType || (exports.ShippingType = ShippingType = {}));
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AbstractEntity } from '../../../abstracts/abstract.entity';
|
|
2
|
-
import { OrderEntity } from '../orders/order.entity';
|
|
3
|
-
import { StatusEntity } from './entities/status.entity';
|
|
4
|
-
import { BillingType } from './enums/billing.type';
|
|
5
|
-
export declare class PaymentEntity extends AbstractEntity {
|
|
6
|
-
status: StatusEntity[];
|
|
7
|
-
total: number;
|
|
8
|
-
fee: number;
|
|
9
|
-
type: BillingType;
|
|
10
|
-
readonly order: OrderEntity;
|
|
11
|
-
readonly lastStatus: StatusEntity;
|
|
12
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
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 { PaymentEntity } from './payment.entity';
|
|
27
|
-
export declare namespace PaymentSchema {
|
|
28
|
-
const name = "sales_payments";
|
|
29
|
-
const schema: import("mongoose").Schema<PaymentEntity, import("mongoose").Model<PaymentEntity, any, any, any, import("mongoose").Document<unknown, any, PaymentEntity> & PaymentEntity & Required<{
|
|
30
|
-
_id: string;
|
|
31
|
-
}>, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, PaymentEntity, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<PaymentEntity>> & import("mongoose").FlatRecord<PaymentEntity> & Required<{
|
|
32
|
-
_id: string;
|
|
33
|
-
}>>;
|
|
34
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentSchema = void 0;
|
|
4
|
-
var mongoose_1 = require("@nestjs/mongoose");
|
|
5
|
-
var payment_entity_1 = require("./payment.entity");
|
|
6
|
-
var PaymentSchema;
|
|
7
|
-
(function (PaymentSchema) {
|
|
8
|
-
PaymentSchema.name = 'sales_payments';
|
|
9
|
-
PaymentSchema.schema = mongoose_1.SchemaFactory.createForClass(payment_entity_1.PaymentEntity);
|
|
10
|
-
PaymentSchema.schema.virtual('lastStatus').get(function () {
|
|
11
|
-
var first = this.status.reverse()[0];
|
|
12
|
-
return first;
|
|
13
|
-
});
|
|
14
|
-
})(PaymentSchema || (exports.PaymentSchema = PaymentSchema = {}));
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IdMongoValidator } from '../../../abstracts/abstract.validator';
|
|
2
|
-
import { PaymentValidator } from '../orders/validators/payment.validator';
|
|
3
|
-
import { BillingType } from './enums/billing.type';
|
|
4
|
-
import { PaymentStatus } from './enums/payment.status';
|
|
5
|
-
export declare class CreatePaymentValidator {
|
|
6
|
-
type: BillingType;
|
|
7
|
-
total: number;
|
|
8
|
-
order: string;
|
|
9
|
-
user: string;
|
|
10
|
-
payload: PaymentValidator;
|
|
11
|
-
}
|
|
12
|
-
export declare class UpdatePaymentValidator {
|
|
13
|
-
}
|
|
14
|
-
export declare class UpdatePaymentStatusValidator extends IdMongoValidator {
|
|
15
|
-
type: PaymentStatus;
|
|
16
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
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.UpdatePaymentStatusValidator = exports.UpdatePaymentValidator = exports.CreatePaymentValidator = 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 payment_validator_1 = require("../orders/validators/payment.validator");
|
|
32
|
-
var billing_type_1 = require("./enums/billing.type");
|
|
33
|
-
var payment_status_1 = require("./enums/payment.status");
|
|
34
|
-
var CreatePaymentValidator = exports.CreatePaymentValidator = (function () {
|
|
35
|
-
function CreatePaymentValidator() {
|
|
36
|
-
}
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, class_validator_1.IsEnum)(billing_type_1.BillingType),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], CreatePaymentValidator.prototype, "type", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, class_validator_1.IsPositive)(),
|
|
43
|
-
__metadata("design:type", Number)
|
|
44
|
-
], CreatePaymentValidator.prototype, "total", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, class_validator_1.IsMongoId)(),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], CreatePaymentValidator.prototype, "order", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, class_validator_1.IsMongoId)(),
|
|
51
|
-
__metadata("design:type", String)
|
|
52
|
-
], CreatePaymentValidator.prototype, "user", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, class_validator_1.ValidateNested)(),
|
|
55
|
-
(0, class_transformer_1.Type)(function () { return payment_validator_1.PaymentValidator; }),
|
|
56
|
-
(0, class_validator_1.IsNotEmptyObject)(),
|
|
57
|
-
__metadata("design:type", payment_validator_1.PaymentValidator)
|
|
58
|
-
], CreatePaymentValidator.prototype, "payload", void 0);
|
|
59
|
-
return CreatePaymentValidator;
|
|
60
|
-
}());
|
|
61
|
-
var UpdatePaymentValidator = (function () {
|
|
62
|
-
function UpdatePaymentValidator() {
|
|
63
|
-
}
|
|
64
|
-
return UpdatePaymentValidator;
|
|
65
|
-
}());
|
|
66
|
-
exports.UpdatePaymentValidator = UpdatePaymentValidator;
|
|
67
|
-
var UpdatePaymentStatusValidator = exports.UpdatePaymentStatusValidator = (function (_super) {
|
|
68
|
-
__extends(UpdatePaymentStatusValidator, _super);
|
|
69
|
-
function UpdatePaymentStatusValidator() {
|
|
70
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
71
|
-
}
|
|
72
|
-
__decorate([
|
|
73
|
-
(0, class_validator_1.IsEnum)(payment_status_1.PaymentStatus),
|
|
74
|
-
__metadata("design:type", String)
|
|
75
|
-
], UpdatePaymentStatusValidator.prototype, "type", void 0);
|
|
76
|
-
return UpdatePaymentStatusValidator;
|
|
77
|
-
}(abstract_validator_1.IdMongoValidator));
|