@merkaly/api 0.4.0 → 0.4.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 +1 -0
- package/dist/abstract.repository.d.ts +15 -9
- package/dist/abstract.validator.d.ts +2 -1
- package/dist/abstract.validator.js +5 -0
- package/dist/account/address/address.validator.d.ts +1 -3
- package/dist/account/address/address.validator.js +13 -10
- package/dist/account/payment/payment.validator.d.ts +1 -9
- package/dist/account/payment/payment.validator.js +13 -42
- package/dist/account/user/user.validator.d.ts +1 -3
- package/dist/account/user/user.validator.js +22 -22
- package/dist/address.entity.d.ts +1 -1
- package/dist/assets/asset/asset.enum.js +2 -2
- package/dist/finance/invoice/invoice.entity.d.ts +1 -1
- package/dist/finance/invoice/invoice.enum.js +4 -4
- package/dist/finance/invoice/invoice.validator.d.ts +1 -3
- package/dist/finance/invoice/invoice.validator.js +16 -15
- package/dist/finance/payment/payment.entity.d.ts +1 -1
- package/dist/finance/payment/payment.enum.js +6 -6
- package/dist/finance/payment/payment.validator.d.ts +3 -8
- package/dist/finance/payment/payment.validator.js +13 -14
- package/dist/finance/refund/refund.entity.d.ts +1 -1
- package/dist/finance/refund/refund.enum.js +4 -4
- package/dist/finance/refund/refund.validator.d.ts +1 -6
- package/dist/finance/refund/refund.validator.js +11 -29
- package/dist/finance/subscription/subscription.entity.d.ts +1 -1
- package/dist/finance/subscription/subscription.enum.js +4 -4
- package/dist/finance/subscription/subscription.validator.d.ts +1 -3
- package/dist/finance/subscription/subscription.validator.js +15 -13
- package/dist/finance/tax/tax.entity.d.ts +1 -1
- package/dist/finance/tax/tax.enum.js +2 -2
- package/dist/finance/tax/tax.validator.d.ts +1 -3
- package/dist/finance/tax/tax.validator.js +13 -11
- package/dist/inventory/catalog/attribute/attribute.validator.d.ts +2 -3
- package/dist/inventory/catalog/attribute/attribute.validator.js +13 -6
- package/dist/inventory/catalog/brand/brand.validator.d.ts +2 -3
- package/dist/inventory/catalog/brand/brand.validator.js +15 -9
- package/dist/inventory/catalog/category/category.validator.d.ts +2 -3
- package/dist/inventory/catalog/category/category.validator.js +11 -5
- package/dist/inventory/catalog/collection/collection.validator.d.ts +2 -3
- package/dist/inventory/catalog/collection/collection.validator.js +13 -6
- package/dist/inventory/catalog/product/product.status.enum.js +2 -2
- package/dist/inventory/catalog/product/product.validator.d.ts +7 -15
- package/dist/inventory/catalog/product/product.validator.js +40 -40
- package/dist/inventory/catalog/variant/variant.validator.d.ts +1 -9
- package/dist/inventory/catalog/variant/variant.validator.js +9 -50
- package/dist/inventory/configuration/measurement/measurement.validator.d.ts +2 -3
- package/dist/inventory/configuration/measurement/measurement.validator.js +21 -7
- package/dist/inventory/stock/transfer/transfer.validator.d.ts +2 -7
- package/dist/inventory/stock/transfer/transfer.validator.js +27 -39
- package/dist/inventory/stock/warehouse/warehouse.validator.d.ts +2 -3
- package/dist/inventory/stock/warehouse/warehouse.validator.js +34 -9
- package/dist/order/purchase/transaction/transaction.entity.d.ts +1 -1
- package/dist/order/purchase/transaction/transaction.enum.js +2 -2
- package/dist/order/purchase/transaction/transaction.validator.d.ts +1 -5
- package/dist/order/purchase/transaction/transaction.validator.js +11 -23
- package/dist/order/purchase/vendor/vendor.validator.d.ts +1 -3
- package/dist/order/purchase/vendor/vendor.validator.js +26 -27
- package/dist/order/sale/customer/customer.entity.d.ts +1 -1
- package/dist/order/sale/customer/customer.enum.js +2 -2
- package/dist/order/sale/customer/customer.validator.d.ts +1 -3
- package/dist/order/sale/customer/customer.validator.js +28 -29
- package/dist/order/sale/shipping/shipping.entity.d.ts +1 -1
- package/dist/order/sale/shipping/shipping.enum.js +4 -4
- package/dist/order/sale/shipping/shipping.validator.d.ts +2 -6
- package/dist/order/sale/shipping/shipping.validator.js +12 -13
- package/dist/order/sale/transaction/transaction.entity.d.ts +1 -1
- package/dist/order/sale/transaction/transaction.enum.js +2 -2
- package/dist/order/sale/transaction/transaction.validator.d.ts +4 -6
- package/dist/order/sale/transaction/transaction.validator.js +33 -22
- package/dist/settings/organization/organization.enum.js +2 -2
- package/dist/settings/organization/organization.validator.d.ts +1 -4
- package/dist/settings/organization/organization.validator.js +6 -11
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var FinanceRefundStatusEnum;
|
|
1
|
+
export var FinanceRefundStatusEnum;
|
|
2
2
|
(function (FinanceRefundStatusEnum) {
|
|
3
3
|
FinanceRefundStatusEnum["PENDING"] = "PENDING";
|
|
4
4
|
FinanceRefundStatusEnum["APPROVED"] = "APPROVED";
|
|
@@ -6,8 +6,8 @@ var FinanceRefundStatusEnum;
|
|
|
6
6
|
FinanceRefundStatusEnum["COMPLETED"] = "COMPLETED";
|
|
7
7
|
FinanceRefundStatusEnum["REJECTED"] = "REJECTED";
|
|
8
8
|
FinanceRefundStatusEnum["CANCELLED"] = "CANCELLED";
|
|
9
|
-
})(FinanceRefundStatusEnum || (
|
|
10
|
-
var FinanceRefundReasonEnum;
|
|
9
|
+
})(FinanceRefundStatusEnum || (FinanceRefundStatusEnum = {}));
|
|
10
|
+
export var FinanceRefundReasonEnum;
|
|
11
11
|
(function (FinanceRefundReasonEnum) {
|
|
12
12
|
FinanceRefundReasonEnum["CUSTOMER_REQUEST"] = "CUSTOMER_REQUEST";
|
|
13
13
|
FinanceRefundReasonEnum["DEFECTIVE_PRODUCT"] = "DEFECTIVE_PRODUCT";
|
|
@@ -15,4 +15,4 @@ var FinanceRefundReasonEnum;
|
|
|
15
15
|
FinanceRefundReasonEnum["ORDER_CANCELLED"] = "ORDER_CANCELLED";
|
|
16
16
|
FinanceRefundReasonEnum["DUPLICATE_CHARGE"] = "DUPLICATE_CHARGE";
|
|
17
17
|
FinanceRefundReasonEnum["OTHER"] = "OTHER";
|
|
18
|
-
})(FinanceRefundReasonEnum || (
|
|
18
|
+
})(FinanceRefundReasonEnum || (FinanceRefundReasonEnum = {}));
|
|
@@ -5,15 +5,10 @@ export declare class SearchFinanceRefundValidator extends SearchValidator<Financ
|
|
|
5
5
|
}
|
|
6
6
|
export declare class ReadFinanceRefundValidator extends ReadValidator<FinanceRefundEntity> {
|
|
7
7
|
}
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class SaveFinanceRefundValidator extends AbstractValidator {
|
|
9
9
|
payment: string;
|
|
10
10
|
reason: FinanceRefundReasonEnum;
|
|
11
11
|
amount: number;
|
|
12
12
|
notes?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class UpdateFinanceRefundValidator extends AbstractValidator {
|
|
15
|
-
reason?: FinanceRefundReasonEnum;
|
|
16
|
-
amount?: number;
|
|
17
|
-
notes?: string;
|
|
18
13
|
status?: FinanceRefundStatusEnum;
|
|
19
14
|
}
|
|
@@ -8,60 +8,42 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import * as class_validator_1 from "class-validator";
|
|
11
|
-
import * as refund_enum_1 from './';
|
|
11
|
+
import * as refund_enum_1 from './refund.enum.js';
|
|
12
12
|
import * as abstract_validator_1 from '../..';
|
|
13
13
|
export class SearchFinanceRefundValidator extends abstract_validator_1.SearchValidator {
|
|
14
14
|
}
|
|
15
15
|
export class ReadFinanceRefundValidator extends abstract_validator_1.ReadValidator {
|
|
16
16
|
}
|
|
17
|
-
export class
|
|
17
|
+
export class SaveFinanceRefundValidator extends abstract_validator_1.AbstractValidator {
|
|
18
18
|
payment;
|
|
19
19
|
reason;
|
|
20
20
|
amount;
|
|
21
21
|
notes;
|
|
22
|
+
status;
|
|
22
23
|
}
|
|
23
24
|
__decorate([
|
|
24
25
|
(0, class_validator_1.IsMongoId)(),
|
|
26
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
25
27
|
__metadata("design:type", String)
|
|
26
|
-
],
|
|
28
|
+
], SaveFinanceRefundValidator.prototype, "payment", void 0);
|
|
27
29
|
__decorate([
|
|
28
30
|
(0, class_validator_1.IsEnum)(refund_enum_1.FinanceRefundReasonEnum),
|
|
31
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
29
32
|
__metadata("design:type", String)
|
|
30
|
-
],
|
|
33
|
+
], SaveFinanceRefundValidator.prototype, "reason", void 0);
|
|
31
34
|
__decorate([
|
|
32
35
|
(0, class_validator_1.IsNumber)(),
|
|
33
36
|
(0, class_validator_1.Min)(0.01),
|
|
37
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
34
38
|
__metadata("design:type", Number)
|
|
35
|
-
],
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, class_validator_1.IsString)(),
|
|
38
|
-
(0, class_validator_1.IsOptional)(),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], CreateFinanceRefundValidator.prototype, "notes", void 0);
|
|
41
|
-
export class UpdateFinanceRefundValidator extends abstract_validator_1.AbstractValidator {
|
|
42
|
-
reason;
|
|
43
|
-
amount;
|
|
44
|
-
notes;
|
|
45
|
-
status;
|
|
46
|
-
}
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, class_validator_1.IsEnum)(refund_enum_1.FinanceRefundReasonEnum),
|
|
49
|
-
(0, class_validator_1.IsOptional)(),
|
|
50
|
-
__metadata("design:type", String)
|
|
51
|
-
], UpdateFinanceRefundValidator.prototype, "reason", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, class_validator_1.IsNumber)(),
|
|
54
|
-
(0, class_validator_1.Min)(0.01),
|
|
55
|
-
(0, class_validator_1.IsOptional)(),
|
|
56
|
-
__metadata("design:type", Number)
|
|
57
|
-
], UpdateFinanceRefundValidator.prototype, "amount", void 0);
|
|
39
|
+
], SaveFinanceRefundValidator.prototype, "amount", void 0);
|
|
58
40
|
__decorate([
|
|
59
41
|
(0, class_validator_1.IsString)(),
|
|
60
42
|
(0, class_validator_1.IsOptional)(),
|
|
61
43
|
__metadata("design:type", String)
|
|
62
|
-
],
|
|
44
|
+
], SaveFinanceRefundValidator.prototype, "notes", void 0);
|
|
63
45
|
__decorate([
|
|
64
46
|
(0, class_validator_1.IsEnum)(refund_enum_1.FinanceRefundStatusEnum),
|
|
65
47
|
(0, class_validator_1.IsOptional)(),
|
|
66
48
|
__metadata("design:type", String)
|
|
67
|
-
],
|
|
49
|
+
], SaveFinanceRefundValidator.prototype, "status", void 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractEntity } from '../..';
|
|
2
|
-
import { FinanceSubscriptionIntervalEnum, FinanceSubscriptionStatusEnum } from './';
|
|
2
|
+
import { FinanceSubscriptionIntervalEnum, FinanceSubscriptionStatusEnum } from './subscription.enum.js';
|
|
3
3
|
export declare class FinanceSubscriptionEntity extends AbstractEntity {
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var FinanceSubscriptionStatusEnum;
|
|
1
|
+
export var FinanceSubscriptionStatusEnum;
|
|
2
2
|
(function (FinanceSubscriptionStatusEnum) {
|
|
3
3
|
FinanceSubscriptionStatusEnum["ACTIVE"] = "ACTIVE";
|
|
4
4
|
FinanceSubscriptionStatusEnum["TRIALING"] = "TRIALING";
|
|
@@ -6,12 +6,12 @@ var FinanceSubscriptionStatusEnum;
|
|
|
6
6
|
FinanceSubscriptionStatusEnum["PAUSED"] = "PAUSED";
|
|
7
7
|
FinanceSubscriptionStatusEnum["CANCELLED"] = "CANCELLED";
|
|
8
8
|
FinanceSubscriptionStatusEnum["EXPIRED"] = "EXPIRED";
|
|
9
|
-
})(FinanceSubscriptionStatusEnum || (
|
|
10
|
-
var FinanceSubscriptionIntervalEnum;
|
|
9
|
+
})(FinanceSubscriptionStatusEnum || (FinanceSubscriptionStatusEnum = {}));
|
|
10
|
+
export var FinanceSubscriptionIntervalEnum;
|
|
11
11
|
(function (FinanceSubscriptionIntervalEnum) {
|
|
12
12
|
FinanceSubscriptionIntervalEnum["DAILY"] = "DAILY";
|
|
13
13
|
FinanceSubscriptionIntervalEnum["WEEKLY"] = "WEEKLY";
|
|
14
14
|
FinanceSubscriptionIntervalEnum["MONTHLY"] = "MONTHLY";
|
|
15
15
|
FinanceSubscriptionIntervalEnum["QUARTERLY"] = "QUARTERLY";
|
|
16
16
|
FinanceSubscriptionIntervalEnum["YEARLY"] = "YEARLY";
|
|
17
|
-
})(FinanceSubscriptionIntervalEnum || (
|
|
17
|
+
})(FinanceSubscriptionIntervalEnum || (FinanceSubscriptionIntervalEnum = {}));
|
|
@@ -5,7 +5,7 @@ export declare class SearchFinanceSubscriptionValidator extends SearchValidator<
|
|
|
5
5
|
}
|
|
6
6
|
export declare class ReadFinanceSubscriptionValidator extends ReadValidator<FinanceSubscriptionEntity> {
|
|
7
7
|
}
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class SaveFinanceSubscriptionValidator extends AbstractValidator {
|
|
9
9
|
name: string;
|
|
10
10
|
description?: string;
|
|
11
11
|
price: number;
|
|
@@ -13,7 +13,5 @@ export declare class CreateFinanceSubscriptionValidator extends AbstractValidato
|
|
|
13
13
|
intervalCount?: number;
|
|
14
14
|
currentPeriodStart?: Date;
|
|
15
15
|
currentPeriodEnd?: Date;
|
|
16
|
-
}
|
|
17
|
-
export declare class UpdateFinanceSubscriptionValidator extends CreateFinanceSubscriptionValidator {
|
|
18
16
|
status?: FinanceSubscriptionStatusEnum;
|
|
19
17
|
}
|
|
@@ -8,13 +8,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import * as class_validator_1 from "class-validator";
|
|
11
|
-
import * as subscription_enum_1 from './';
|
|
11
|
+
import * as subscription_enum_1 from './subscription.enum.js';
|
|
12
12
|
import * as abstract_validator_1 from '../..';
|
|
13
13
|
export class SearchFinanceSubscriptionValidator extends abstract_validator_1.SearchValidator {
|
|
14
14
|
}
|
|
15
15
|
export class ReadFinanceSubscriptionValidator extends abstract_validator_1.ReadValidator {
|
|
16
16
|
}
|
|
17
|
-
export class
|
|
17
|
+
export class SaveFinanceSubscriptionValidator extends abstract_validator_1.AbstractValidator {
|
|
18
18
|
name;
|
|
19
19
|
description;
|
|
20
20
|
price;
|
|
@@ -22,44 +22,46 @@ export class CreateFinanceSubscriptionValidator extends abstract_validator_1.Abs
|
|
|
22
22
|
intervalCount;
|
|
23
23
|
currentPeriodStart;
|
|
24
24
|
currentPeriodEnd;
|
|
25
|
+
status;
|
|
25
26
|
}
|
|
26
27
|
__decorate([
|
|
27
28
|
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
28
31
|
__metadata("design:type", String)
|
|
29
|
-
],
|
|
32
|
+
], SaveFinanceSubscriptionValidator.prototype, "name", void 0);
|
|
30
33
|
__decorate([
|
|
31
34
|
(0, class_validator_1.IsString)(),
|
|
32
35
|
(0, class_validator_1.IsOptional)(),
|
|
33
36
|
__metadata("design:type", String)
|
|
34
|
-
],
|
|
37
|
+
], SaveFinanceSubscriptionValidator.prototype, "description", void 0);
|
|
35
38
|
__decorate([
|
|
36
39
|
(0, class_validator_1.IsNumber)(),
|
|
40
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
37
41
|
__metadata("design:type", Number)
|
|
38
|
-
],
|
|
42
|
+
], SaveFinanceSubscriptionValidator.prototype, "price", void 0);
|
|
39
43
|
__decorate([
|
|
40
44
|
(0, class_validator_1.IsEnum)(subscription_enum_1.FinanceSubscriptionIntervalEnum),
|
|
45
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
41
46
|
__metadata("design:type", String)
|
|
42
|
-
],
|
|
47
|
+
], SaveFinanceSubscriptionValidator.prototype, "interval", void 0);
|
|
43
48
|
__decorate([
|
|
44
49
|
(0, class_validator_1.IsNumber)(),
|
|
45
50
|
(0, class_validator_1.IsOptional)(),
|
|
46
51
|
__metadata("design:type", Number)
|
|
47
|
-
],
|
|
52
|
+
], SaveFinanceSubscriptionValidator.prototype, "intervalCount", void 0);
|
|
48
53
|
__decorate([
|
|
49
54
|
(0, class_validator_1.IsDate)(),
|
|
50
55
|
(0, class_validator_1.IsOptional)(),
|
|
51
56
|
__metadata("design:type", Date)
|
|
52
|
-
],
|
|
57
|
+
], SaveFinanceSubscriptionValidator.prototype, "currentPeriodStart", void 0);
|
|
53
58
|
__decorate([
|
|
54
59
|
(0, class_validator_1.IsDate)(),
|
|
55
60
|
(0, class_validator_1.IsOptional)(),
|
|
56
61
|
__metadata("design:type", Date)
|
|
57
|
-
],
|
|
58
|
-
export class UpdateFinanceSubscriptionValidator extends CreateFinanceSubscriptionValidator {
|
|
59
|
-
status;
|
|
60
|
-
}
|
|
62
|
+
], SaveFinanceSubscriptionValidator.prototype, "currentPeriodEnd", void 0);
|
|
61
63
|
__decorate([
|
|
62
64
|
(0, class_validator_1.IsEnum)(subscription_enum_1.FinanceSubscriptionStatusEnum),
|
|
63
65
|
(0, class_validator_1.IsOptional)(),
|
|
64
66
|
__metadata("design:type", String)
|
|
65
|
-
],
|
|
67
|
+
], SaveFinanceSubscriptionValidator.prototype, "status", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var FinanceTaxTypeEnum;
|
|
1
|
+
export var FinanceTaxTypeEnum;
|
|
2
2
|
(function (FinanceTaxTypeEnum) {
|
|
3
3
|
FinanceTaxTypeEnum["VAT"] = "VAT";
|
|
4
4
|
FinanceTaxTypeEnum["SALES_TAX"] = "SALES_TAX";
|
|
@@ -6,4 +6,4 @@ var FinanceTaxTypeEnum;
|
|
|
6
6
|
FinanceTaxTypeEnum["INCOME_TAX"] = "INCOME_TAX";
|
|
7
7
|
FinanceTaxTypeEnum["WITHHOLDING"] = "WITHHOLDING";
|
|
8
8
|
FinanceTaxTypeEnum["CUSTOM"] = "CUSTOM";
|
|
9
|
-
})(FinanceTaxTypeEnum || (
|
|
9
|
+
})(FinanceTaxTypeEnum || (FinanceTaxTypeEnum = {}));
|
|
@@ -5,13 +5,11 @@ export declare class SearchFinanceTaxValidator extends SearchValidator<FinanceTa
|
|
|
5
5
|
}
|
|
6
6
|
export declare class ReadFinanceTaxValidator extends ReadValidator<FinanceTaxEntity> {
|
|
7
7
|
}
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class SaveFinanceTaxValidator extends AbstractValidator {
|
|
9
9
|
name: string;
|
|
10
10
|
description?: string;
|
|
11
11
|
rate: number;
|
|
12
12
|
type: FinanceTaxTypeEnum;
|
|
13
13
|
code?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class UpdateFinanceTaxValidator extends CreateFinanceTaxValidator {
|
|
16
14
|
isActive?: boolean;
|
|
17
15
|
}
|
|
@@ -8,48 +8,50 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import * as class_validator_1 from "class-validator";
|
|
11
|
-
import * as tax_enum_1 from './';
|
|
11
|
+
import * as tax_enum_1 from './tax.enum.js';
|
|
12
12
|
import * as abstract_validator_1 from '../..';
|
|
13
13
|
export class SearchFinanceTaxValidator extends abstract_validator_1.SearchValidator {
|
|
14
14
|
}
|
|
15
15
|
export class ReadFinanceTaxValidator extends abstract_validator_1.ReadValidator {
|
|
16
16
|
}
|
|
17
|
-
export class
|
|
17
|
+
export class SaveFinanceTaxValidator extends abstract_validator_1.AbstractValidator {
|
|
18
18
|
name;
|
|
19
19
|
description;
|
|
20
20
|
rate;
|
|
21
21
|
type;
|
|
22
22
|
code;
|
|
23
|
+
isActive;
|
|
23
24
|
}
|
|
24
25
|
__decorate([
|
|
25
26
|
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
28
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
26
29
|
__metadata("design:type", String)
|
|
27
|
-
],
|
|
30
|
+
], SaveFinanceTaxValidator.prototype, "name", void 0);
|
|
28
31
|
__decorate([
|
|
29
32
|
(0, class_validator_1.IsString)(),
|
|
30
33
|
(0, class_validator_1.IsOptional)(),
|
|
31
34
|
__metadata("design:type", String)
|
|
32
|
-
],
|
|
35
|
+
], SaveFinanceTaxValidator.prototype, "description", void 0);
|
|
33
36
|
__decorate([
|
|
34
37
|
(0, class_validator_1.IsNumber)(),
|
|
35
38
|
(0, class_validator_1.Min)(0),
|
|
36
39
|
(0, class_validator_1.Max)(100),
|
|
40
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
37
41
|
__metadata("design:type", Number)
|
|
38
|
-
],
|
|
42
|
+
], SaveFinanceTaxValidator.prototype, "rate", void 0);
|
|
39
43
|
__decorate([
|
|
40
44
|
(0, class_validator_1.IsEnum)(tax_enum_1.FinanceTaxTypeEnum),
|
|
45
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
41
46
|
__metadata("design:type", String)
|
|
42
|
-
],
|
|
47
|
+
], SaveFinanceTaxValidator.prototype, "type", void 0);
|
|
43
48
|
__decorate([
|
|
44
49
|
(0, class_validator_1.IsString)(),
|
|
45
50
|
(0, class_validator_1.IsOptional)(),
|
|
46
51
|
__metadata("design:type", String)
|
|
47
|
-
],
|
|
48
|
-
export class UpdateFinanceTaxValidator extends CreateFinanceTaxValidator {
|
|
49
|
-
isActive;
|
|
50
|
-
}
|
|
52
|
+
], SaveFinanceTaxValidator.prototype, "code", void 0);
|
|
51
53
|
__decorate([
|
|
52
54
|
(0, class_validator_1.IsBoolean)(),
|
|
53
55
|
(0, class_validator_1.IsOptional)(),
|
|
54
56
|
__metadata("design:type", Boolean)
|
|
55
|
-
],
|
|
57
|
+
], SaveFinanceTaxValidator.prototype, "isActive", void 0);
|
|
@@ -4,10 +4,9 @@ export declare class SearchCatalogAttributeValidator extends SearchValidator<Cat
|
|
|
4
4
|
}
|
|
5
5
|
export declare class ReadCatalogAttributeValidator extends ReadValidator<CatalogAttributeEntity> {
|
|
6
6
|
}
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class SaveCatalogAttributeValidator extends AbstractValidator {
|
|
8
|
+
constructor(entity?: CatalogAttributeEntity);
|
|
8
9
|
name: string;
|
|
9
10
|
values?: string[];
|
|
10
11
|
active?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare class UpdateCatalogAttributeValidator extends CreateCatalogAttributeValidator {
|
|
13
|
-
}
|
|
@@ -13,7 +13,15 @@ export class SearchCatalogAttributeValidator extends abstract_validator_1.Search
|
|
|
13
13
|
}
|
|
14
14
|
export class ReadCatalogAttributeValidator extends abstract_validator_1.ReadValidator {
|
|
15
15
|
}
|
|
16
|
-
export class
|
|
16
|
+
export class SaveCatalogAttributeValidator extends abstract_validator_1.AbstractValidator {
|
|
17
|
+
constructor(entity) {
|
|
18
|
+
super();
|
|
19
|
+
if (!entity)
|
|
20
|
+
return;
|
|
21
|
+
this.name = entity.name;
|
|
22
|
+
this.values = entity.values || [];
|
|
23
|
+
this.active = entity.active ?? true;
|
|
24
|
+
}
|
|
17
25
|
name;
|
|
18
26
|
values = [];
|
|
19
27
|
active;
|
|
@@ -21,18 +29,17 @@ export class CreateCatalogAttributeValidator extends abstract_validator_1.Abstra
|
|
|
21
29
|
__decorate([
|
|
22
30
|
(0, class_validator_1.IsString)(),
|
|
23
31
|
(0, class_validator_1.IsNotEmpty)(),
|
|
32
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
24
33
|
__metadata("design:type", String)
|
|
25
|
-
],
|
|
34
|
+
], SaveCatalogAttributeValidator.prototype, "name", void 0);
|
|
26
35
|
__decorate([
|
|
27
36
|
(0, class_validator_1.IsArray)(),
|
|
28
37
|
(0, class_validator_1.IsString)({ each: true }),
|
|
29
38
|
(0, class_validator_1.IsOptional)(),
|
|
30
39
|
__metadata("design:type", Array)
|
|
31
|
-
],
|
|
40
|
+
], SaveCatalogAttributeValidator.prototype, "values", void 0);
|
|
32
41
|
__decorate([
|
|
33
42
|
(0, class_validator_1.IsBoolean)(),
|
|
34
43
|
(0, class_validator_1.IsOptional)(),
|
|
35
44
|
__metadata("design:type", Boolean)
|
|
36
|
-
],
|
|
37
|
-
export class UpdateCatalogAttributeValidator extends CreateCatalogAttributeValidator {
|
|
38
|
-
}
|
|
45
|
+
], SaveCatalogAttributeValidator.prototype, "active", void 0);
|
|
@@ -4,9 +4,8 @@ export declare class SearchCatalogBrandValidator extends SearchValidator<Catalog
|
|
|
4
4
|
}
|
|
5
5
|
export declare class ReadCatalogBrandValidator extends ReadValidator<CatalogBrandEntity> {
|
|
6
6
|
}
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class SaveCatalogBrandValidator extends AbstractValidator {
|
|
8
|
+
constructor(entity?: CatalogBrandEntity);
|
|
8
9
|
name: string;
|
|
9
10
|
description: string;
|
|
10
11
|
}
|
|
11
|
-
export declare class UpdateCatalogBrandValidator extends CreateCatalogBrandValidator {
|
|
12
|
-
}
|
|
@@ -13,19 +13,25 @@ export class SearchCatalogBrandValidator extends abstract_validator_1.SearchVali
|
|
|
13
13
|
}
|
|
14
14
|
export class ReadCatalogBrandValidator extends abstract_validator_1.ReadValidator {
|
|
15
15
|
}
|
|
16
|
-
export class
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export class SaveCatalogBrandValidator extends abstract_validator_1.AbstractValidator {
|
|
17
|
+
constructor(entity) {
|
|
18
|
+
super();
|
|
19
|
+
if (!entity)
|
|
20
|
+
return;
|
|
21
|
+
this.name = entity.name;
|
|
22
|
+
this.description = entity.description;
|
|
23
|
+
}
|
|
24
|
+
name;
|
|
25
|
+
description;
|
|
19
26
|
}
|
|
20
27
|
__decorate([
|
|
21
28
|
(0, class_validator_1.IsString)(),
|
|
22
29
|
(0, class_validator_1.IsNotEmpty)(),
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], SaveCatalogBrandValidator.prototype, "name", void 0);
|
|
25
33
|
__decorate([
|
|
26
34
|
(0, class_validator_1.IsString)(),
|
|
27
35
|
(0, class_validator_1.IsOptional)(),
|
|
28
|
-
__metadata("design:type",
|
|
29
|
-
],
|
|
30
|
-
export class UpdateCatalogBrandValidator extends CreateCatalogBrandValidator {
|
|
31
|
-
}
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], SaveCatalogBrandValidator.prototype, "description", void 0);
|
|
@@ -4,9 +4,8 @@ export declare class SearchCatalogCategoryValidator extends SearchValidator<Cata
|
|
|
4
4
|
}
|
|
5
5
|
export declare class ReadCatalogCategoryValidator extends ReadValidator<CatalogCategoryEntity> {
|
|
6
6
|
}
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class SaveCatalogCategoryValidator extends AbstractValidator {
|
|
8
|
+
constructor(entity?: CatalogCategoryEntity);
|
|
8
9
|
name: string;
|
|
9
10
|
description: string;
|
|
10
11
|
}
|
|
11
|
-
export declare class UpdateCatalogCategoryValidator extends CreateCatalogCategoryValidator {
|
|
12
|
-
}
|
|
@@ -13,19 +13,25 @@ export class SearchCatalogCategoryValidator extends abstract_validator_1.SearchV
|
|
|
13
13
|
}
|
|
14
14
|
export class ReadCatalogCategoryValidator extends abstract_validator_1.ReadValidator {
|
|
15
15
|
}
|
|
16
|
-
export class
|
|
16
|
+
export class SaveCatalogCategoryValidator extends abstract_validator_1.AbstractValidator {
|
|
17
|
+
constructor(entity) {
|
|
18
|
+
super();
|
|
19
|
+
if (!entity)
|
|
20
|
+
return;
|
|
21
|
+
this.name = entity.name;
|
|
22
|
+
this.description = entity.description;
|
|
23
|
+
}
|
|
17
24
|
name;
|
|
18
25
|
description;
|
|
19
26
|
}
|
|
20
27
|
__decorate([
|
|
21
28
|
(0, class_validator_1.IsString)(),
|
|
22
29
|
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
23
31
|
__metadata("design:type", String)
|
|
24
|
-
],
|
|
32
|
+
], SaveCatalogCategoryValidator.prototype, "name", void 0);
|
|
25
33
|
__decorate([
|
|
26
34
|
(0, class_validator_1.IsString)(),
|
|
27
35
|
(0, class_validator_1.IsOptional)(),
|
|
28
36
|
__metadata("design:type", String)
|
|
29
|
-
],
|
|
30
|
-
export class UpdateCatalogCategoryValidator extends CreateCatalogCategoryValidator {
|
|
31
|
-
}
|
|
37
|
+
], SaveCatalogCategoryValidator.prototype, "description", void 0);
|
|
@@ -4,10 +4,9 @@ export declare class SearchCatalogCollectionValidator extends SearchValidator<Ca
|
|
|
4
4
|
}
|
|
5
5
|
export declare class ReadCatalogCollectionValidator extends ReadValidator<CatalogCollectionEntity> {
|
|
6
6
|
}
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class SaveCatalogCollectionValidator extends AbstractValidator {
|
|
8
|
+
constructor(entity?: CatalogCollectionEntity);
|
|
8
9
|
name: string;
|
|
9
10
|
description: string;
|
|
10
11
|
products: string[];
|
|
11
12
|
}
|
|
12
|
-
export declare class UpdateCatalogCollectionValidator extends CreateCatalogCollectionValidator {
|
|
13
|
-
}
|
|
@@ -13,7 +13,15 @@ export class SearchCatalogCollectionValidator extends abstract_validator_1.Searc
|
|
|
13
13
|
}
|
|
14
14
|
export class ReadCatalogCollectionValidator extends abstract_validator_1.ReadValidator {
|
|
15
15
|
}
|
|
16
|
-
export class
|
|
16
|
+
export class SaveCatalogCollectionValidator extends abstract_validator_1.AbstractValidator {
|
|
17
|
+
constructor(entity) {
|
|
18
|
+
super();
|
|
19
|
+
if (!entity)
|
|
20
|
+
return;
|
|
21
|
+
this.name = entity.name;
|
|
22
|
+
this.description = entity.description;
|
|
23
|
+
this.products = entity.products?.map(abstract_validator_1.toId).filter(Boolean) || [];
|
|
24
|
+
}
|
|
17
25
|
name;
|
|
18
26
|
description;
|
|
19
27
|
products = [];
|
|
@@ -21,17 +29,16 @@ export class CreateCatalogCollectionValidator extends abstract_validator_1.Abstr
|
|
|
21
29
|
__decorate([
|
|
22
30
|
(0, class_validator_1.IsString)(),
|
|
23
31
|
(0, class_validator_1.IsNotEmpty)(),
|
|
32
|
+
(0, class_validator_1.IsOptional)({ groups: ['update'] }),
|
|
24
33
|
__metadata("design:type", String)
|
|
25
|
-
],
|
|
34
|
+
], SaveCatalogCollectionValidator.prototype, "name", void 0);
|
|
26
35
|
__decorate([
|
|
27
36
|
(0, class_validator_1.IsString)(),
|
|
28
37
|
(0, class_validator_1.IsOptional)(),
|
|
29
38
|
__metadata("design:type", String)
|
|
30
|
-
],
|
|
39
|
+
], SaveCatalogCollectionValidator.prototype, "description", void 0);
|
|
31
40
|
__decorate([
|
|
32
41
|
(0, class_validator_1.IsMongoId)({ each: true }),
|
|
33
42
|
(0, class_validator_1.IsOptional)(),
|
|
34
43
|
__metadata("design:type", Array)
|
|
35
|
-
],
|
|
36
|
-
export class UpdateCatalogCollectionValidator extends CreateCatalogCollectionValidator {
|
|
37
|
-
}
|
|
44
|
+
], SaveCatalogCollectionValidator.prototype, "products", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var CatalogProductStatus;
|
|
1
|
+
export var CatalogProductStatus;
|
|
2
2
|
(function (CatalogProductStatus) {
|
|
3
3
|
CatalogProductStatus["Draft"] = "draft";
|
|
4
4
|
CatalogProductStatus["Published"] = "published";
|
|
@@ -6,4 +6,4 @@ var CatalogProductStatus;
|
|
|
6
6
|
CatalogProductStatus["OutOfStock"] = "out_of_stock";
|
|
7
7
|
CatalogProductStatus["Discontinued"] = "discontinued";
|
|
8
8
|
CatalogProductStatus["ComingSoon"] = "coming_soon";
|
|
9
|
-
})(CatalogProductStatus || (
|
|
9
|
+
})(CatalogProductStatus || (CatalogProductStatus = {}));
|
|
@@ -9,29 +9,21 @@ export declare class ProductAttributeValidator extends AbstractValidator {
|
|
|
9
9
|
type: string;
|
|
10
10
|
values: string[];
|
|
11
11
|
}
|
|
12
|
-
export declare class
|
|
13
|
-
|
|
12
|
+
export declare class SaveCatalogProductValidator extends AbstractValidator {
|
|
13
|
+
constructor(entity?: CatalogProductEntity);
|
|
14
14
|
name: string;
|
|
15
|
-
|
|
15
|
+
sku: string;
|
|
16
|
+
description: string;
|
|
16
17
|
price: number;
|
|
17
|
-
measure
|
|
18
|
+
measure: {
|
|
18
19
|
amount: number;
|
|
19
20
|
kind: string;
|
|
20
21
|
unit: string;
|
|
21
22
|
};
|
|
22
23
|
pictures: string[];
|
|
23
|
-
category
|
|
24
|
-
brand
|
|
24
|
+
category: string;
|
|
25
|
+
brand: string;
|
|
25
26
|
hashtags: string[];
|
|
26
27
|
attributes: ProductAttributeValidator[];
|
|
27
28
|
status: CatalogProductStatus;
|
|
28
29
|
}
|
|
29
|
-
export declare class UpdateCatalogProductValidator extends CreateCatalogProductValidator {
|
|
30
|
-
name: string;
|
|
31
|
-
price: number;
|
|
32
|
-
measure: {
|
|
33
|
-
amount: number;
|
|
34
|
-
kind: string;
|
|
35
|
-
unit: string;
|
|
36
|
-
};
|
|
37
|
-
}
|