@merkaly/api 0.3.0 → 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 +3 -3
- package/dist/account/address/address.entity.js +34 -0
- package/dist/account/address/address.validator.d.ts +2 -2
- package/dist/account/address/address.validator.js +67 -0
- package/dist/account/address/index.d.ts +2 -2
- package/dist/account/address/index.js +10 -0
- package/dist/account/cart/cart.entity.d.ts +8 -0
- package/dist/account/cart/cart.entity.js +34 -0
- package/dist/account/cart/cart.validator.d.ts +13 -0
- package/dist/account/cart/cart.validator.js +45 -0
- package/dist/account/cart/index.d.ts +2 -0
- package/dist/account/cart/index.js +12 -0
- package/dist/account/payment/index.d.ts +2 -0
- package/dist/account/payment/index.js +12 -0
- package/dist/account/payment/payment.entity.d.ts +11 -0
- package/dist/account/payment/payment.entity.js +57 -0
- package/dist/account/payment/payment.validator.d.ts +15 -0
- package/dist/account/payment/payment.validator.js +57 -0
- package/dist/account/user/index.d.ts +2 -2
- package/dist/account/user/index.js +10 -0
- package/dist/account/user/user.entity.d.ts +1 -1
- package/dist/account/user/user.entity.js +46 -0
- package/dist/account/user/user.validator.d.ts +2 -2
- package/dist/account/user/user.validator.js +68 -0
- package/dist/account/wishlist/index.d.ts +2 -0
- package/dist/account/wishlist/index.js +12 -0
- package/dist/account/wishlist/wishlist.entity.d.ts +8 -0
- package/dist/account/wishlist/wishlist.entity.js +38 -0
- package/dist/account/wishlist/wishlist.validator.d.ts +12 -0
- package/dist/account/wishlist/wishlist.validator.js +39 -0
- package/dist/address.entity.d.ts +14 -0
- package/dist/address.entity.js +59 -0
- package/dist/assets/asset/asset.entity.d.ts +11 -0
- package/dist/assets/asset/asset.entity.js +58 -0
- package/dist/assets/asset/asset.enum.d.ts +6 -0
- package/dist/assets/asset/asset.enum.js +11 -0
- package/dist/assets/asset/index.d.ts +2 -0
- package/dist/assets/asset/index.js +12 -0
- package/dist/billing/payment/index.d.ts +2 -2
- package/dist/billing/payment/index.js +10 -3
- package/dist/billing/payment/payment.enum.d.ts +2 -2
- package/dist/billing/payment/payment.enum.js +18 -18
- package/dist/billing/payment/transaction.entity.d.ts +9 -9
- package/dist/billing/payment/transaction.entity.js +55 -0
- package/dist/billing/status/index.d.ts +1 -1
- package/dist/billing/status/index.js +5 -0
- package/dist/billing/status/status.entity.d.ts +5 -5
- package/dist/billing/status/status.entity.js +40 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/inventory/catalog/attribute/attribute.entity.d.ts +1 -1
- package/dist/inventory/catalog/attribute/attribute.entity.js +47 -0
- package/dist/inventory/catalog/attribute/attribute.validator.d.ts +2 -2
- package/dist/inventory/catalog/attribute/attribute.validator.js +58 -0
- package/dist/inventory/catalog/attribute/index.d.ts +2 -2
- package/dist/inventory/catalog/attribute/index.js +10 -0
- package/dist/inventory/catalog/brand/brand.entity.d.ts +2 -2
- package/dist/inventory/catalog/brand/brand.entity.js +33 -0
- package/dist/inventory/catalog/brand/brand.validator.d.ts +2 -2
- package/dist/inventory/catalog/brand/brand.validator.js +39 -0
- package/dist/inventory/catalog/brand/index.d.ts +2 -2
- package/dist/inventory/catalog/brand/index.js +10 -0
- package/dist/inventory/catalog/category/category.entity.d.ts +2 -2
- package/dist/inventory/catalog/category/category.entity.js +33 -0
- package/dist/inventory/catalog/category/category.validator.d.ts +2 -2
- package/dist/inventory/catalog/category/category.validator.js +39 -0
- package/dist/inventory/catalog/category/index.d.ts +2 -2
- package/dist/inventory/catalog/category/index.js +10 -0
- package/dist/inventory/catalog/collection/collection.entity.d.ts +2 -2
- package/dist/inventory/catalog/collection/collection.entity.js +42 -0
- package/dist/inventory/catalog/collection/collection.validator.d.ts +2 -2
- package/dist/inventory/catalog/collection/collection.validator.js +45 -0
- package/dist/inventory/catalog/collection/index.d.ts +2 -2
- package/dist/inventory/catalog/collection/index.js +10 -0
- package/dist/inventory/catalog/product/index.d.ts +3 -3
- package/dist/inventory/catalog/product/index.js +15 -2
- package/dist/inventory/catalog/product/product.entity.d.ts +10 -10
- package/dist/inventory/catalog/product/product.entity.js +115 -0
- package/dist/inventory/catalog/product/product.validator.d.ts +4 -4
- package/dist/inventory/catalog/product/product.validator.js +135 -0
- package/dist/inventory/configuration/label/index.d.ts +2 -2
- package/dist/inventory/configuration/label/index.js +10 -0
- package/dist/inventory/configuration/label/label.entity.d.ts +1 -1
- package/dist/inventory/configuration/label/label.entity.js +42 -0
- package/dist/inventory/configuration/label/label.validator.d.ts +2 -2
- package/dist/inventory/configuration/label/label.validator.js +51 -0
- package/dist/inventory/configuration/measurement/index.d.ts +2 -1
- package/dist/inventory/configuration/measurement/index.js +10 -0
- package/dist/inventory/configuration/measurement/measurement.entity.d.ts +4 -4
- package/dist/inventory/configuration/measurement/measurement.entity.js +42 -0
- package/dist/inventory/configuration/measurement/measurement.validator.d.ts +21 -0
- package/dist/inventory/configuration/measurement/measurement.validator.js +87 -0
- package/dist/inventory/configuration/unit/index.d.ts +1 -1
- package/dist/inventory/configuration/unit/index.js +5 -0
- package/dist/inventory/configuration/unit/unit.entity.d.ts +2 -2
- package/dist/inventory/configuration/unit/unit.entity.js +46 -0
- package/dist/inventory/stock/backorder/backorder.entity.d.ts +5 -5
- package/dist/inventory/stock/backorder/backorder.entity.js +106 -0
- package/dist/inventory/stock/backorder/backorder.validator.d.ts +2 -2
- package/dist/inventory/stock/backorder/backorder.validator.js +112 -0
- package/dist/inventory/stock/backorder/index.d.ts +2 -2
- package/dist/inventory/stock/backorder/index.js +10 -0
- package/dist/inventory/stock/transfer/index.d.ts +2 -2
- package/dist/inventory/stock/transfer/index.js +10 -0
- package/dist/inventory/stock/transfer/transfer.entity.d.ts +6 -6
- package/dist/inventory/stock/transfer/transfer.entity.js +108 -0
- package/dist/inventory/stock/transfer/transfer.validator.d.ts +4 -4
- package/dist/inventory/stock/transfer/transfer.validator.js +108 -0
- package/dist/inventory/stock/warehouse/index.d.ts +2 -2
- package/dist/inventory/stock/warehouse/index.js +10 -0
- package/dist/inventory/stock/warehouse/warehouse.entity.d.ts +1 -1
- package/dist/inventory/stock/warehouse/warehouse.entity.js +67 -0
- package/dist/inventory/stock/warehouse/warehouse.validator.d.ts +4 -4
- package/dist/inventory/stock/warehouse/warehouse.validator.js +115 -0
- package/dist/logistic/carrier/carrier.entity.d.ts +1 -1
- package/dist/logistic/carrier/carrier.entity.js +57 -0
- package/dist/logistic/carrier/carrier.validator.d.ts +2 -2
- package/dist/logistic/carrier/carrier.validator.js +69 -0
- package/dist/logistic/carrier/index.d.ts +2 -2
- package/dist/logistic/carrier/index.js +10 -0
- package/dist/logistic/shipment/index.d.ts +3 -3
- package/dist/logistic/shipment/index.js +15 -3
- package/dist/logistic/shipment/shipment.entity.d.ts +11 -11
- package/dist/logistic/shipment/shipment.entity.js +67 -0
- package/dist/logistic/shipment/shipment.enum.d.ts +2 -2
- package/dist/logistic/shipment/shipment.enum.js +19 -19
- package/dist/logistic/shipment/shipment.validator.d.ts +8 -8
- package/dist/logistic/shipment/shipment.validator.js +65 -0
- package/dist/order/purchase/item/index.d.ts +2 -2
- package/dist/order/purchase/item/index.js +10 -0
- package/dist/order/purchase/item/item.entity.d.ts +3 -3
- package/dist/order/purchase/item/item.entity.js +46 -0
- package/dist/order/purchase/item/item.validator.d.ts +1 -1
- package/dist/order/purchase/item/item.validator.js +41 -0
- package/dist/order/purchase/transaction/index.d.ts +3 -3
- package/dist/order/purchase/transaction/index.js +15 -2
- package/dist/order/purchase/transaction/transaction.entity.d.ts +6 -6
- package/dist/order/purchase/transaction/transaction.entity.js +67 -0
- package/dist/order/purchase/transaction/transaction.validator.d.ts +4 -4
- package/dist/order/purchase/transaction/transaction.validator.js +87 -0
- package/dist/order/purchase/vendor/index.d.ts +2 -2
- package/dist/order/purchase/vendor/index.js +10 -0
- package/dist/order/purchase/vendor/vendor.entity.d.ts +1 -1
- package/dist/order/purchase/vendor/vendor.entity.js +62 -0
- package/dist/order/purchase/vendor/vendor.validator.d.ts +2 -2
- package/dist/order/purchase/vendor/vendor.validator.js +75 -0
- package/dist/order/sale/address/address.validator.d.ts +11 -0
- package/dist/order/sale/address/address.validator.js +70 -0
- package/dist/order/sale/address/index.d.ts +1 -0
- package/dist/order/sale/address/index.js +7 -0
- package/dist/order/sale/customer/customer.entity.d.ts +1 -1
- package/dist/order/sale/customer/customer.entity.js +62 -0
- package/dist/order/sale/customer/customer.validator.d.ts +2 -2
- package/dist/order/sale/customer/customer.validator.js +77 -0
- package/dist/order/sale/customer/index.d.ts +2 -2
- package/dist/order/sale/customer/index.js +10 -0
- package/dist/order/sale/item/index.d.ts +2 -2
- package/dist/order/sale/item/index.js +10 -0
- package/dist/order/sale/item/item.entity.d.ts +3 -3
- package/dist/order/sale/item/item.entity.js +45 -0
- package/dist/order/sale/item/item.validator.d.ts +1 -1
- package/dist/order/sale/item/item.validator.js +34 -0
- package/dist/order/sale/payment/index.d.ts +1 -0
- package/dist/order/sale/payment/index.js +7 -0
- package/dist/order/sale/payment/payment.validator.d.ts +16 -0
- package/dist/order/sale/payment/payment.validator.js +51 -0
- package/dist/order/sale/transaction/index.d.ts +3 -3
- package/dist/order/sale/transaction/index.js +15 -2
- package/dist/order/sale/transaction/transaction.entity.d.ts +11 -11
- package/dist/order/sale/transaction/transaction.entity.js +56 -0
- package/dist/order/sale/transaction/transaction.enum.d.ts +1 -1
- package/dist/order/sale/transaction/transaction.enum.js +10 -10
- package/dist/order/sale/transaction/transaction.validator.d.ts +8 -8
- package/dist/order/sale/transaction/transaction.validator.js +76 -0
- package/dist/repository.types.d.ts +13 -0
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { SaleTransactionEntity } from '
|
|
2
|
-
import { AbstractEntity } from '
|
|
3
|
-
import { CreateEntityArgs } from '
|
|
4
|
-
import { AddressEntity } from '
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import type { MongoEntity } from '
|
|
8
|
-
export declare class
|
|
1
|
+
import { SaleTransactionEntity } from '../../order/sale/transaction';
|
|
2
|
+
import { AbstractEntity } from '../..';
|
|
3
|
+
import { CreateEntityArgs } from '../..';
|
|
4
|
+
import { AddressEntity } from '../..';
|
|
5
|
+
import { LogisticShippingTypeEnum } from './';
|
|
6
|
+
import { LogisticShippingStatusEntity } from '../..';
|
|
7
|
+
import type { MongoEntity } from '../..';
|
|
8
|
+
export declare class LogisticShippingEntity extends AbstractEntity {
|
|
9
9
|
order: MongoEntity<SaleTransactionEntity>;
|
|
10
|
-
statuses:
|
|
10
|
+
statuses: LogisticShippingStatusEntity[];
|
|
11
11
|
destinationAddress: CreateEntityArgs<AddressEntity>;
|
|
12
12
|
originAddress: AddressEntity;
|
|
13
13
|
cost: number;
|
|
14
14
|
distance: number;
|
|
15
|
-
type:
|
|
15
|
+
type: LogisticShippingTypeEnum;
|
|
16
16
|
sequence: number;
|
|
17
17
|
readonly number: string;
|
|
18
|
-
readonly currentStatus:
|
|
18
|
+
readonly currentStatus: LogisticShippingStatusEntity;
|
|
19
19
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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.LogisticShippingEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const abstract_entity_1 = require("../../../infrastructure/abstracts/abstract.entity");
|
|
16
|
+
const address_entity_1 = require("../../../infrastructure/entities/address.entity");
|
|
17
|
+
const shipment_enum_1 = require("../enums/shipment.enum");
|
|
18
|
+
const shipment_status_entity_1 = require("./shipment.status.entity");
|
|
19
|
+
let LogisticShippingEntity = class LogisticShippingEntity extends abstract_entity_1.AbstractEntity {
|
|
20
|
+
order;
|
|
21
|
+
statuses = [];
|
|
22
|
+
destinationAddress;
|
|
23
|
+
originAddress;
|
|
24
|
+
cost = 0;
|
|
25
|
+
distance = 0;
|
|
26
|
+
type;
|
|
27
|
+
sequence = 1;
|
|
28
|
+
number;
|
|
29
|
+
currentStatus;
|
|
30
|
+
};
|
|
31
|
+
exports.LogisticShippingEntity = LogisticShippingEntity;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, mongoose_1.Prop)({ ref: 'order.sale.transactions', required: true, type: mongoose_2.Schema.Types.ObjectId }),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], LogisticShippingEntity.prototype, "order", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, mongoose_1.Prop)({ type: [shipment_status_entity_1.LogisticShippingStatusEntity], default: [] }),
|
|
38
|
+
__metadata("design:type", Array)
|
|
39
|
+
], LogisticShippingEntity.prototype, "statuses", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, mongoose_1.Prop)({ required: true, type: address_entity_1.AddressEntity }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], LogisticShippingEntity.prototype, "destinationAddress", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, mongoose_1.Prop)({ required: true, type: address_entity_1.AddressEntity }),
|
|
46
|
+
__metadata("design:type", address_entity_1.AddressEntity)
|
|
47
|
+
], LogisticShippingEntity.prototype, "originAddress", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, mongoose_1.Prop)({ default: 0, min: 0, type: mongoose_2.Schema.Types.Number }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], LogisticShippingEntity.prototype, "cost", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, mongoose_1.Prop)({ default: 0, min: 0, type: mongoose_2.Schema.Types.Number }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], LogisticShippingEntity.prototype, "distance", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, mongoose_1.Prop)({ enum: shipment_enum_1.LogisticShippingTypeEnum, required: true }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], LogisticShippingEntity.prototype, "type", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, mongoose_1.Prop)({ default: 1, immutable: true, type: mongoose_2.Schema.Types.Number, unique: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], LogisticShippingEntity.prototype, "sequence", void 0);
|
|
64
|
+
exports.LogisticShippingEntity = LogisticShippingEntity = __decorate([
|
|
65
|
+
(0, mongoose_1.Schema)(abstract_entity_1.$collection)
|
|
66
|
+
], LogisticShippingEntity);
|
|
67
|
+
//# sourceMappingURL=shipment.entity.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare enum
|
|
1
|
+
export declare enum LogisticShippingStatusEnum {
|
|
2
2
|
OPEN = "OPEN",
|
|
3
3
|
NOT_REQUIRED = "NOT_REQUIRED",
|
|
4
4
|
PROCESSING = "PROCESSING",
|
|
@@ -9,7 +9,7 @@ export declare enum ShippingStatusEnum {
|
|
|
9
9
|
RETURNED = "RETURNED",
|
|
10
10
|
CANCELLED = "CANCELLED"
|
|
11
11
|
}
|
|
12
|
-
export declare enum
|
|
12
|
+
export declare enum LogisticShippingTypeEnum {
|
|
13
13
|
PICKUP = "PICKUP",
|
|
14
14
|
DELIVERY = "DELIVERY",
|
|
15
15
|
DROPOFF = "DROPOFF"
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})(
|
|
16
|
-
var
|
|
17
|
-
(function (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})(
|
|
3
|
+
exports.LogisticShippingTypeEnum = exports.LogisticShippingStatusEnum = void 0;
|
|
4
|
+
var LogisticShippingStatusEnum;
|
|
5
|
+
(function (LogisticShippingStatusEnum) {
|
|
6
|
+
LogisticShippingStatusEnum["OPEN"] = "OPEN";
|
|
7
|
+
LogisticShippingStatusEnum["NOT_REQUIRED"] = "NOT_REQUIRED";
|
|
8
|
+
LogisticShippingStatusEnum["PROCESSING"] = "PROCESSING";
|
|
9
|
+
LogisticShippingStatusEnum["SHIPPED"] = "SHIPPED";
|
|
10
|
+
LogisticShippingStatusEnum["IN_TRANSIT"] = "IN_TRANSIT";
|
|
11
|
+
LogisticShippingStatusEnum["DELIVERED"] = "DELIVERED";
|
|
12
|
+
LogisticShippingStatusEnum["FAILED"] = "FAILED";
|
|
13
|
+
LogisticShippingStatusEnum["RETURNED"] = "RETURNED";
|
|
14
|
+
LogisticShippingStatusEnum["CANCELLED"] = "CANCELLED";
|
|
15
|
+
})(LogisticShippingStatusEnum || (exports.LogisticShippingStatusEnum = LogisticShippingStatusEnum = {}));
|
|
16
|
+
var LogisticShippingTypeEnum;
|
|
17
|
+
(function (LogisticShippingTypeEnum) {
|
|
18
|
+
LogisticShippingTypeEnum["PICKUP"] = "PICKUP";
|
|
19
|
+
LogisticShippingTypeEnum["DELIVERY"] = "DELIVERY";
|
|
20
|
+
LogisticShippingTypeEnum["DROPOFF"] = "DROPOFF";
|
|
21
|
+
})(LogisticShippingTypeEnum || (exports.LogisticShippingTypeEnum = LogisticShippingTypeEnum = {}));
|
|
22
22
|
//# sourceMappingURL=shipment.enum.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { AbstractValidator, ReadValidator } from '
|
|
4
|
-
import type {
|
|
1
|
+
import { LogisticShippingStatusEnum, LogisticShippingTypeEnum } from './';
|
|
2
|
+
import { SaleOrderAddressValidator } from '../../order/sale/address';
|
|
3
|
+
import { AbstractValidator, ReadValidator } from '../..';
|
|
4
|
+
import type { LogisticShippingEntity } from './';
|
|
5
5
|
export declare class CreateShippingValidator extends AbstractValidator {
|
|
6
6
|
order?: string;
|
|
7
7
|
warehouse?: string;
|
|
8
|
-
type:
|
|
9
|
-
address:
|
|
8
|
+
type: LogisticShippingTypeEnum;
|
|
9
|
+
address: SaleOrderAddressValidator;
|
|
10
10
|
cost?: number;
|
|
11
11
|
}
|
|
12
12
|
export declare class UpdateShippingValidator extends CreateShippingValidator {
|
|
13
13
|
}
|
|
14
14
|
export declare class UpdateShippingStatusValidator {
|
|
15
|
-
type:
|
|
15
|
+
type: LogisticShippingStatusEnum;
|
|
16
16
|
}
|
|
17
|
-
export declare class ReadShippingValidator extends ReadValidator<
|
|
17
|
+
export declare class ReadShippingValidator extends ReadValidator<LogisticShippingEntity> {
|
|
18
18
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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.ReadShippingValidator = exports.UpdateShippingStatusValidator = exports.UpdateShippingValidator = exports.CreateShippingValidator = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const shipment_enum_1 = require("../enums/shipment.enum");
|
|
16
|
+
const address_validator_1 = require("../../order/sale/validators/address.validator");
|
|
17
|
+
const abstract_validator_1 = require("../../../infrastructure/abstracts/abstract.validator");
|
|
18
|
+
class CreateShippingValidator extends abstract_validator_1.AbstractValidator {
|
|
19
|
+
order;
|
|
20
|
+
warehouse;
|
|
21
|
+
type;
|
|
22
|
+
address;
|
|
23
|
+
cost;
|
|
24
|
+
}
|
|
25
|
+
exports.CreateShippingValidator = CreateShippingValidator;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsMongoId)(),
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], CreateShippingValidator.prototype, "order", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsMongoId)(),
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], CreateShippingValidator.prototype, "warehouse", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsEnum)(shipment_enum_1.LogisticShippingTypeEnum),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], CreateShippingValidator.prototype, "type", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Type)(() => address_validator_1.SaleOrderAddressValidator),
|
|
42
|
+
(0, class_validator_1.ValidateNested)(),
|
|
43
|
+
(0, class_validator_1.IsObject)(),
|
|
44
|
+
__metadata("design:type", address_validator_1.SaleOrderAddressValidator)
|
|
45
|
+
], CreateShippingValidator.prototype, "address", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsPositive)(),
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], CreateShippingValidator.prototype, "cost", void 0);
|
|
51
|
+
class UpdateShippingValidator extends CreateShippingValidator {
|
|
52
|
+
}
|
|
53
|
+
exports.UpdateShippingValidator = UpdateShippingValidator;
|
|
54
|
+
class UpdateShippingStatusValidator {
|
|
55
|
+
type;
|
|
56
|
+
}
|
|
57
|
+
exports.UpdateShippingStatusValidator = UpdateShippingStatusValidator;
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsEnum)(shipment_enum_1.LogisticShippingStatusEnum),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], UpdateShippingStatusValidator.prototype, "type", void 0);
|
|
62
|
+
class ReadShippingValidator extends abstract_validator_1.ReadValidator {
|
|
63
|
+
}
|
|
64
|
+
exports.ReadShippingValidator = ReadShippingValidator;
|
|
65
|
+
//# sourceMappingURL=shipment.validator.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './item.entity';
|
|
2
|
+
export * from './item.validator';
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var item_entity_1 = require("./item.entity");
|
|
4
|
+
Object.keys(item_entity_1).forEach(function (key) {
|
|
5
|
+
if (key === "default" || key === "__esModule") return;
|
|
6
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return item_entity_1[key]; } });
|
|
7
|
+
});
|
|
8
|
+
var item_validator_1 = require("./item.validator");
|
|
9
|
+
Object.keys(item_validator_1).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return item_validator_1[key]; } });
|
|
12
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CatalogProductEntity } from '
|
|
2
|
-
import { AbstractEntity } from '
|
|
3
|
-
import type { MongoEntity } from '
|
|
1
|
+
import { CatalogProductEntity } from '../../../inventory/catalog/product';
|
|
2
|
+
import { AbstractEntity } from '../../..';
|
|
3
|
+
import type { MongoEntity } from '../../..';
|
|
4
4
|
export declare class PurchaseItemEntity extends AbstractEntity {
|
|
5
5
|
product: MongoEntity<CatalogProductEntity>;
|
|
6
6
|
cost: number;
|
|
@@ -0,0 +1,46 @@
|
|
|
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.PurchaseItemEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const schema_decorator_1 = require("@nestjs/mongoose/dist/decorators/schema.decorator");
|
|
15
|
+
const mongoose_2 = require("mongoose");
|
|
16
|
+
const product_schema_1 = require("../../../inventory/catalog/schemas/product.schema");
|
|
17
|
+
const abstract_entity_1 = require("../../../../infrastructure/abstracts/abstract.entity");
|
|
18
|
+
let PurchaseItemEntity = class PurchaseItemEntity extends abstract_entity_1.AbstractEntity {
|
|
19
|
+
product;
|
|
20
|
+
cost;
|
|
21
|
+
quantity;
|
|
22
|
+
notes;
|
|
23
|
+
total;
|
|
24
|
+
unitCost;
|
|
25
|
+
};
|
|
26
|
+
exports.PurchaseItemEntity = PurchaseItemEntity;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, mongoose_1.Prop)({ ref: product_schema_1.InventoryCatalogProductSchema.name, type: mongoose_2.Schema.Types.ObjectId }),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], PurchaseItemEntity.prototype, "product", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, mongoose_1.Prop)({ default: 0, type: mongoose_2.Schema.Types.Number }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], PurchaseItemEntity.prototype, "cost", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, min: 1, default: 1 }),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], PurchaseItemEntity.prototype, "quantity", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: () => '', trim: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], PurchaseItemEntity.prototype, "notes", void 0);
|
|
43
|
+
exports.PurchaseItemEntity = PurchaseItemEntity = __decorate([
|
|
44
|
+
(0, schema_decorator_1.Schema)({ ...abstract_entity_1.$collection, collection: null })
|
|
45
|
+
], PurchaseItemEntity);
|
|
46
|
+
//# sourceMappingURL=item.entity.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PurchaseItemValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const abstract_validator_1 = require("../../../../infrastructure/abstracts/abstract.validator");
|
|
15
|
+
class PurchaseItemValidator extends abstract_validator_1.AbstractValidator {
|
|
16
|
+
product = String();
|
|
17
|
+
cost = 0;
|
|
18
|
+
quantity = 1;
|
|
19
|
+
notes = String();
|
|
20
|
+
}
|
|
21
|
+
exports.PurchaseItemValidator = PurchaseItemValidator;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsMongoId)(),
|
|
24
|
+
__metadata("design:type", Object)
|
|
25
|
+
], PurchaseItemValidator.prototype, "product", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsNumber)(),
|
|
28
|
+
(0, class_validator_1.Min)(0),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], PurchaseItemValidator.prototype, "cost", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsNumber)(),
|
|
33
|
+
(0, class_validator_1.Min)(1),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], PurchaseItemValidator.prototype, "quantity", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], PurchaseItemValidator.prototype, "notes", void 0);
|
|
41
|
+
//# sourceMappingURL=item.validator.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './transaction.entity';
|
|
2
|
+
export * from './transaction.validator';
|
|
3
|
+
export * from './transaction.enum';
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
3
|
+
var transaction_entity_1 = require("./transaction.entity");
|
|
4
|
+
Object.keys(transaction_entity_1).forEach(function (key) {
|
|
5
|
+
if (key === "default" || key === "__esModule") return;
|
|
6
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return transaction_entity_1[key]; } });
|
|
7
|
+
});
|
|
8
|
+
var transaction_validator_1 = require("./transaction.validator");
|
|
9
|
+
Object.keys(transaction_validator_1).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return transaction_validator_1[key]; } });
|
|
12
|
+
});
|
|
13
|
+
var transaction_enum_1 = require("./transaction.enum");
|
|
14
|
+
Object.keys(transaction_enum_1).forEach(function (key) {
|
|
15
|
+
if (key === "default" || key === "__esModule") return;
|
|
16
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return transaction_enum_1[key]; } });
|
|
17
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AccountUserEntity } from '
|
|
2
|
-
import { AbstractEntity } from '
|
|
3
|
-
import { PurchaseTransactionStatusEnum } from '
|
|
4
|
-
import { PurchaseItemEntity } from '
|
|
5
|
-
import { PurchaseVendorEntity } from '
|
|
6
|
-
import type { MongoEntity } from '
|
|
1
|
+
import { AccountUserEntity } from '../../../account/user';
|
|
2
|
+
import { AbstractEntity } from '../../..';
|
|
3
|
+
import { PurchaseTransactionStatusEnum } from './';
|
|
4
|
+
import { PurchaseItemEntity } from '../item';
|
|
5
|
+
import { PurchaseVendorEntity } from '../vendor';
|
|
6
|
+
import type { MongoEntity } from '../../..';
|
|
7
7
|
export declare class PurchaseTransactionEntity extends AbstractEntity {
|
|
8
8
|
user: MongoEntity<AccountUserEntity>;
|
|
9
9
|
vendor: MongoEntity<PurchaseVendorEntity>;
|
|
@@ -0,0 +1,67 @@
|
|
|
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.PurchaseTransactionEntity = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const user_schema_1 = require("../../../account/schemas/user.schema");
|
|
16
|
+
const item_schema_1 = require("../schemas/item.schema");
|
|
17
|
+
const vendor_schema_1 = require("../schemas/vendor.schema");
|
|
18
|
+
const abstract_entity_1 = require("../../../../infrastructure/abstracts/abstract.entity");
|
|
19
|
+
const transaction_enum_1 = require("../enums/transaction.enum");
|
|
20
|
+
let PurchaseTransactionEntity = class PurchaseTransactionEntity extends abstract_entity_1.AbstractEntity {
|
|
21
|
+
user;
|
|
22
|
+
vendor;
|
|
23
|
+
items = [];
|
|
24
|
+
sequence = 0;
|
|
25
|
+
notes;
|
|
26
|
+
status;
|
|
27
|
+
expectedDeliveryDate;
|
|
28
|
+
number;
|
|
29
|
+
total;
|
|
30
|
+
};
|
|
31
|
+
exports.PurchaseTransactionEntity = PurchaseTransactionEntity;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, mongoose_1.Prop)({ ref: user_schema_1.AccountUserSchema.name, required: true, type: mongoose_2.Schema.Types.String }),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], PurchaseTransactionEntity.prototype, "user", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, mongoose_1.Prop)({ ref: vendor_schema_1.PurchaseVendorSchema.name, type: mongoose_2.Schema.Types.ObjectId }),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], PurchaseTransactionEntity.prototype, "vendor", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, mongoose_1.Prop)({ default: () => [], type: [item_schema_1.PurchaseItemSchema.schema] }),
|
|
42
|
+
__metadata("design:type", Array)
|
|
43
|
+
], PurchaseTransactionEntity.prototype, "items", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, mongoose_1.Prop)({ default: 1, immutable: true, type: mongoose_2.Schema.Types.Number, unique: true }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], PurchaseTransactionEntity.prototype, "sequence", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, trim: true }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], PurchaseTransactionEntity.prototype, "notes", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, mongoose_1.Prop)({
|
|
54
|
+
default: () => transaction_enum_1.PurchaseTransactionStatusEnum.DRAFT,
|
|
55
|
+
enum: transaction_enum_1.PurchaseTransactionStatusEnum,
|
|
56
|
+
type: mongoose_2.Schema.Types.String,
|
|
57
|
+
}),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], PurchaseTransactionEntity.prototype, "status", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
62
|
+
__metadata("design:type", Date)
|
|
63
|
+
], PurchaseTransactionEntity.prototype, "expectedDeliveryDate", void 0);
|
|
64
|
+
exports.PurchaseTransactionEntity = PurchaseTransactionEntity = __decorate([
|
|
65
|
+
(0, mongoose_1.Schema)(abstract_entity_1.$collection)
|
|
66
|
+
], PurchaseTransactionEntity);
|
|
67
|
+
//# sourceMappingURL=transaction.entity.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PurchaseTransactionEntity } from '
|
|
2
|
-
import { PurchaseTransactionStatusEnum } from '
|
|
3
|
-
import { AbstractValidator, ReadValidator, SearchValidator } from '
|
|
4
|
-
import { PurchaseItemValidator } from '
|
|
1
|
+
import { PurchaseTransactionEntity } from './';
|
|
2
|
+
import { PurchaseTransactionStatusEnum } from './';
|
|
3
|
+
import { AbstractValidator, ReadValidator, SearchValidator } from '../../..';
|
|
4
|
+
import { PurchaseItemValidator } from '../item';
|
|
5
5
|
export declare class SearchPurchaseTransactionValidator extends SearchValidator<PurchaseTransactionEntity> {
|
|
6
6
|
}
|
|
7
7
|
export declare class ReadPurchaseTransactionValidator extends ReadValidator<PurchaseTransactionEntity> {
|
|
@@ -0,0 +1,87 @@
|
|
|
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.UpdatePurchaseTransactionValidator = exports.CreatePurchaseTransactionValidator = exports.ReadPurchaseTransactionValidator = exports.SearchPurchaseTransactionValidator = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const transaction_enum_1 = require("../enums/transaction.enum");
|
|
16
|
+
const abstract_validator_1 = require("../../../../infrastructure/abstracts/abstract.validator");
|
|
17
|
+
const item_validator_1 = require("./item.validator");
|
|
18
|
+
class SearchPurchaseTransactionValidator extends abstract_validator_1.SearchValidator {
|
|
19
|
+
}
|
|
20
|
+
exports.SearchPurchaseTransactionValidator = SearchPurchaseTransactionValidator;
|
|
21
|
+
class ReadPurchaseTransactionValidator extends abstract_validator_1.ReadValidator {
|
|
22
|
+
}
|
|
23
|
+
exports.ReadPurchaseTransactionValidator = ReadPurchaseTransactionValidator;
|
|
24
|
+
class CreatePurchaseTransactionValidator extends abstract_validator_1.AbstractValidator {
|
|
25
|
+
items = [];
|
|
26
|
+
notes = String();
|
|
27
|
+
user;
|
|
28
|
+
vendor;
|
|
29
|
+
status = transaction_enum_1.PurchaseTransactionStatusEnum.DRAFT;
|
|
30
|
+
expectedDeliveryDate;
|
|
31
|
+
}
|
|
32
|
+
exports.CreatePurchaseTransactionValidator = CreatePurchaseTransactionValidator;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsArray)(),
|
|
35
|
+
(0, class_validator_1.ArrayNotEmpty)(),
|
|
36
|
+
(0, class_transformer_1.Type)(() => item_validator_1.PurchaseItemValidator),
|
|
37
|
+
(0, class_validator_1.ValidateNested)(),
|
|
38
|
+
__metadata("design:type", Array)
|
|
39
|
+
], CreatePurchaseTransactionValidator.prototype, "items", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], CreatePurchaseTransactionValidator.prototype, "notes", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsString)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], CreatePurchaseTransactionValidator.prototype, "user", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsMongoId)(),
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], CreatePurchaseTransactionValidator.prototype, "vendor", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_validator_1.IsEnum)(transaction_enum_1.PurchaseTransactionStatusEnum),
|
|
56
|
+
(0, class_validator_1.IsOptional)(),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], CreatePurchaseTransactionValidator.prototype, "status", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, class_validator_1.IsDate)(),
|
|
61
|
+
(0, class_validator_1.IsOptional)(),
|
|
62
|
+
(0, class_transformer_1.Type)(() => Date),
|
|
63
|
+
__metadata("design:type", Date)
|
|
64
|
+
], CreatePurchaseTransactionValidator.prototype, "expectedDeliveryDate", void 0);
|
|
65
|
+
class UpdatePurchaseTransactionValidator extends abstract_validator_1.AbstractValidator {
|
|
66
|
+
notes;
|
|
67
|
+
status;
|
|
68
|
+
expectedDeliveryDate;
|
|
69
|
+
}
|
|
70
|
+
exports.UpdatePurchaseTransactionValidator = UpdatePurchaseTransactionValidator;
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsString)(),
|
|
73
|
+
(0, class_validator_1.IsOptional)(),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], UpdatePurchaseTransactionValidator.prototype, "notes", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, class_validator_1.IsEnum)(transaction_enum_1.PurchaseTransactionStatusEnum),
|
|
78
|
+
(0, class_validator_1.IsOptional)(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], UpdatePurchaseTransactionValidator.prototype, "status", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_validator_1.IsDate)(),
|
|
83
|
+
(0, class_validator_1.IsOptional)(),
|
|
84
|
+
(0, class_transformer_1.Type)(() => Date),
|
|
85
|
+
__metadata("design:type", Date)
|
|
86
|
+
], UpdatePurchaseTransactionValidator.prototype, "expectedDeliveryDate", void 0);
|
|
87
|
+
//# sourceMappingURL=transaction.validator.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './vendor.entity';
|
|
2
|
+
export * from './vendor.validator';
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var vendor_entity_1 = require("./vendor.entity");
|
|
4
|
+
Object.keys(vendor_entity_1).forEach(function (key) {
|
|
5
|
+
if (key === "default" || key === "__esModule") return;
|
|
6
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return vendor_entity_1[key]; } });
|
|
7
|
+
});
|
|
8
|
+
var vendor_validator_1 = require("./vendor.validator");
|
|
9
|
+
Object.keys(vendor_validator_1).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
Object.defineProperty(exports, key, { enumerable: true, get: function () { return vendor_validator_1[key]; } });
|
|
12
|
+
});
|