@hosterai/types 0.0.25 → 0.0.27
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/README.md +49 -8
- package/dist/dtos/addon-field.dto.d.ts +7 -0
- package/dist/dtos/addon-field.dto.js +11 -0
- package/dist/dtos/attachment.dto.js +17 -0
- package/dist/dtos/attribute-field.dto.d.ts +19 -0
- package/dist/dtos/attribute-field.dto.js +64 -0
- package/dist/dtos/base-response.dto.js +11 -0
- package/dist/dtos/client-data.dto.js +82 -0
- package/dist/dtos/company-data.dto.js +97 -0
- package/dist/dtos/country.dto.d.ts +7 -0
- package/dist/dtos/country.dto.js +21 -0
- package/dist/dtos/error-response.dto.js +15 -0
- package/dist/dtos/field.dto.d.ts +8 -13
- package/dist/dtos/field.dto.js +22 -47
- package/dist/dtos/info.dto.d.ts +0 -5
- package/dist/dtos/info.dto.js +0 -19
- package/dist/dtos/invoice/invoice-info.dto.d.ts +15 -0
- package/dist/dtos/invoice/invoice-info.dto.js +42 -0
- package/dist/dtos/invoice/invoice-item-data.dto.d.ts +10 -0
- package/dist/dtos/invoice/invoice-item-data.dto.js +34 -0
- package/dist/dtos/invoice/requests/credit-note-request.dto.d.ts +9 -0
- package/dist/dtos/invoice/requests/credit-note-request.dto.js +32 -0
- package/dist/dtos/invoice/requests/invoice-request.dto.d.ts +9 -0
- package/dist/dtos/invoice/requests/invoice-request.dto.js +32 -0
- package/dist/dtos/invoice/requests/proforma-invoice-request.dto.d.ts +24 -0
- package/dist/dtos/invoice/requests/proforma-invoice-request.dto.js +104 -0
- package/dist/dtos/invoice/requests/tax-details-request.dto.d.ts +31 -0
- package/dist/dtos/invoice/requests/tax-details-request.dto.js +84 -0
- package/dist/dtos/invoice/responses/credit-note-response.dto.d.ts +7 -0
- package/dist/dtos/invoice/responses/credit-note-response.dto.js +11 -0
- package/dist/dtos/invoice/responses/invoice-response.dto.d.ts +7 -0
- package/dist/dtos/invoice/responses/invoice-response.dto.js +11 -0
- package/dist/dtos/invoice/responses/proforma-invoice-response.dto.d.ts +12 -0
- package/dist/dtos/invoice/responses/proforma-invoice-response.dto.js +52 -0
- package/dist/dtos/invoice/responses/tax-details-response.dto.d.ts +20 -0
- package/dist/dtos/invoice/responses/tax-details-response.dto.js +56 -0
- package/dist/dtos/invoice/tin-validation-details.dto.d.ts +51 -0
- package/dist/dtos/invoice/tin-validation-details.dto.js +165 -0
- package/dist/dtos/invoice/transaction-data.dto.d.ts +14 -0
- package/dist/dtos/invoice/transaction-data.dto.js +64 -0
- package/dist/dtos/invoice-contact-data.dto.d.ts +43 -0
- package/dist/dtos/invoice-contact-data.dto.js +222 -0
- package/dist/dtos/item-data.dto.d.ts +44 -0
- package/dist/dtos/item-data.dto.js +131 -0
- package/dist/dtos/jwt.dto.js +27 -0
- package/dist/dtos/multilang-text.dto.js +12 -0
- package/dist/dtos/notification/receiver/receiver-email.dto.js +19 -0
- package/dist/dtos/notification/receiver/receiver-sms.dto.js +7 -0
- package/dist/dtos/notification/requests/notification-send-request.dto.d.ts +18 -0
- package/dist/dtos/notification/requests/notification-send-request.dto.js +90 -0
- package/dist/dtos/notification/responses/notification-send-response.dto.d.ts +9 -0
- package/dist/dtos/notification/responses/notification-send-response.dto.js +32 -0
- package/dist/dtos/notification/sender/sender-email.dto.js +26 -0
- package/dist/dtos/notification/sender/sender-push.dto.js +36 -0
- package/dist/dtos/notification/sender/sender-sms.dto.js +11 -0
- package/dist/dtos/product/product-info.dto.d.ts +8 -3
- package/dist/dtos/product/product-info.dto.js +25 -5
- package/dist/dtos/product/product-item-data.dto.d.ts +7 -28
- package/dist/dtos/product/product-item-data.dto.js +14 -23
- package/dist/dtos/product/requests/product-create-request.dto.js +11 -0
- package/dist/dtos/product/requests/product-delete-request.dto.js +11 -0
- package/dist/dtos/product/requests/product-downgradable-request.dto.js +11 -0
- package/dist/dtos/product/requests/product-downgrade-request.dto.js +16 -0
- package/dist/dtos/product/requests/product-renew-request.dto.js +11 -0
- package/dist/dtos/product/requests/product-suspend-request.dto.js +11 -0
- package/dist/dtos/product/requests/product-unsuspend-request.dto.js +11 -0
- package/dist/dtos/product/requests/product-upgradable-request.dto.js +11 -0
- package/dist/dtos/product/requests/product-upgrade-request.dto.js +16 -0
- package/dist/dtos/product/responses/product-create-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-delete-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-downgradable-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-downgrade-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-info-response.dto.js +23 -0
- package/dist/dtos/product/responses/product-renew-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-suspend-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-unsuspend-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-upgradable-response.dto.js +37 -0
- package/dist/dtos/product/responses/product-upgrade-response.dto.js +37 -0
- package/dist/dtos/requests/validate-attributes-request.dto.js +12 -0
- package/dist/dtos/response-data.dto.js +19 -0
- package/dist/dtos/responses/validate-attributes-response.dto.js +25 -0
- package/dist/dtos/settings.dto.d.ts +18 -0
- package/dist/dtos/settings.dto.js +19 -2
- package/dist/dtos/setup-status-response.dto.js +20 -0
- package/dist/dtos/success-response.dto.d.ts +0 -4
- package/dist/dtos/success-response.dto.js +0 -14
- package/dist/enums/invoice/invoice-item-actions.enum.d.ts +8 -0
- package/dist/enums/invoice/invoice-item-actions.enum.js +12 -0
- package/dist/enums/invoice/invoice-types.enum.d.ts +5 -0
- package/dist/enums/invoice/invoice-types.enum.js +9 -0
- package/dist/enums/item-actions.enum.d.ts +11 -0
- package/dist/enums/item-actions.enum.js +16 -0
- package/dist/index.d.ts +36 -5
- package/dist/index.js +37 -7
- package/dist/openapi/schemas/components.schemas.d.ts +152 -49
- package/dist/openapi/schemas/components.schemas.js +191 -89
- package/dist/validators/addon-field-validator.d.ts +9 -0
- package/dist/validators/addon-field-validator.js +14 -0
- package/dist/validators/addon-field-validator.spec.d.ts +1 -0
- package/dist/validators/addon-field-validator.spec.js +38 -0
- package/dist/validators/attachment-validator.d.ts +8 -0
- package/dist/validators/attachment-validator.js +17 -0
- package/dist/validators/attachment-validator.spec.d.ts +1 -0
- package/dist/validators/attachment-validator.spec.js +58 -0
- package/dist/validators/attribute-field-validator.d.ts +8 -0
- package/dist/validators/attribute-field-validator.js +17 -0
- package/dist/validators/attribute-field-validator.spec.d.ts +1 -0
- package/dist/validators/attribute-field-validator.spec.js +84 -0
- package/dist/validators/country-validator.d.ts +8 -0
- package/dist/validators/country-validator.js +17 -0
- package/dist/validators/country-validator.spec.d.ts +1 -0
- package/dist/validators/country-validator.spec.js +58 -0
- package/dist/validators/field-validator.spec.js +1 -29
- package/dist/validators/info-validator.d.ts +8 -0
- package/dist/validators/info-validator.js +17 -0
- package/dist/validators/info-validator.spec.d.ts +1 -0
- package/dist/validators/info-validator.spec.js +85 -0
- package/dist/validators/invoice-contact-data-validator.d.ts +8 -0
- package/dist/validators/invoice-contact-data-validator.js +17 -0
- package/dist/validators/invoice-contact-data-validator.spec.d.ts +1 -0
- package/dist/validators/invoice-contact-data-validator.spec.js +88 -0
- package/dist/validators/invoice-info-validator.d.ts +8 -0
- package/dist/validators/invoice-info-validator.js +17 -0
- package/dist/validators/invoice-info-validator.spec.d.ts +1 -0
- package/dist/validators/invoice-info-validator.spec.js +81 -0
- package/dist/validators/invoice-item-data-validator.d.ts +8 -0
- package/dist/validators/invoice-item-data-validator.js +17 -0
- package/dist/validators/invoice-item-data-validator.spec.d.ts +1 -0
- package/dist/validators/invoice-item-data-validator.spec.js +45 -0
- package/dist/validators/item-data-validator.d.ts +8 -0
- package/dist/validators/item-data-validator.js +17 -0
- package/dist/validators/item-data-validator.spec.d.ts +1 -0
- package/dist/validators/item-data-validator.spec.js +79 -0
- package/dist/validators/notification-info-validator.spec.js +6 -6
- package/dist/validators/notification-request-validator.js +2 -2
- package/dist/validators/product-create-request-validator.js +1 -1
- package/dist/validators/product-delete-request-validator.js +1 -1
- package/dist/validators/product-downgradable-request-validator.js +1 -1
- package/dist/validators/product-downgrade-request-validator.js +1 -1
- package/dist/validators/product-info-validator.spec.js +20 -28
- package/dist/validators/product-item-data-validator.d.ts +8 -0
- package/dist/validators/product-item-data-validator.js +17 -0
- package/dist/validators/product-item-data-validator.spec.d.ts +1 -0
- package/dist/validators/product-item-data-validator.spec.js +60 -0
- package/dist/validators/product-renew-request-validator.js +1 -1
- package/dist/validators/product-suspend-request-validator.js +1 -1
- package/dist/validators/product-unsuspend-request-validator.js +1 -1
- package/dist/validators/product-upgradable-request-validator.js +1 -1
- package/dist/validators/product-upgrade-request-validator.js +1 -1
- package/dist/validators/tab-validator.d.ts +8 -0
- package/dist/validators/tab-validator.js +17 -0
- package/dist/validators/tab-validator.spec.d.ts +1 -0
- package/dist/validators/tab-validator.spec.js +49 -0
- package/dist/validators/tin-validation-details-validator.d.ts +8 -0
- package/dist/validators/tin-validation-details-validator.js +17 -0
- package/dist/validators/tin-validation-details-validator.spec.d.ts +1 -0
- package/dist/validators/tin-validation-details-validator.spec.js +77 -0
- package/dist/validators/transaction-data-validator.d.ts +8 -0
- package/dist/validators/transaction-data-validator.js +17 -0
- package/dist/validators/transaction-data-validator.spec.d.ts +1 -0
- package/dist/validators/transaction-data-validator.spec.js +62 -0
- package/package.json +1 -1
package/dist/dtos/country.dto.js
CHANGED
|
@@ -12,20 +12,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CountryDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const country_enum_1 = require("../enums/country.enum");
|
|
15
|
+
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
16
|
+
/**
|
|
17
|
+
* Country information returned by the hoster.ai helper function.
|
|
18
|
+
* Used to provide a list of all available countries.
|
|
19
|
+
*/
|
|
15
20
|
class CountryDto {
|
|
16
21
|
}
|
|
17
22
|
exports.CountryDto = CountryDto;
|
|
18
23
|
__decorate([
|
|
19
24
|
(0, class_validator_1.IsString)(),
|
|
20
25
|
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
27
|
+
title: 'Name',
|
|
28
|
+
description: 'Country name.',
|
|
29
|
+
type: 'string',
|
|
30
|
+
}),
|
|
21
31
|
__metadata("design:type", String)
|
|
22
32
|
], CountryDto.prototype, "name", void 0);
|
|
23
33
|
__decorate([
|
|
24
34
|
(0, class_validator_1.IsEnum)(country_enum_1.CountryEnum),
|
|
35
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
36
|
+
title: 'Code',
|
|
37
|
+
description: 'Country code.',
|
|
38
|
+
type: 'string',
|
|
39
|
+
enum: Object.values(country_enum_1.CountryEnum),
|
|
40
|
+
}),
|
|
25
41
|
__metadata("design:type", String)
|
|
26
42
|
], CountryDto.prototype, "code", void 0);
|
|
27
43
|
__decorate([
|
|
28
44
|
(0, class_validator_1.IsBoolean)(),
|
|
29
45
|
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
47
|
+
title: 'Is Europe',
|
|
48
|
+
description: 'Whether the country is in Europe.',
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
}),
|
|
30
51
|
__metadata("design:type", Boolean)
|
|
31
52
|
], CountryDto.prototype, "isEurope", void 0);
|
|
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ErrorResponseDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
14
15
|
/**
|
|
15
16
|
* DTO for error response.
|
|
16
17
|
* Used to return detailed error information to the client.
|
|
@@ -21,11 +22,25 @@ exports.ErrorResponseDto = ErrorResponseDto;
|
|
|
21
22
|
__decorate([
|
|
22
23
|
(0, class_validator_1.IsString)(),
|
|
23
24
|
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
26
|
+
title: 'Code',
|
|
27
|
+
description: 'A unique and specific error code for programmatic error handling.',
|
|
28
|
+
type: 'number',
|
|
29
|
+
example: 400,
|
|
30
|
+
}),
|
|
24
31
|
__metadata("design:type", Number)
|
|
25
32
|
], ErrorResponseDto.prototype, "code", void 0);
|
|
26
33
|
__decorate([
|
|
27
34
|
(0, class_validator_1.IsOptional)(),
|
|
28
35
|
(0, class_validator_1.IsArray)(),
|
|
29
36
|
(0, class_validator_1.IsString)({ each: true }),
|
|
37
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
38
|
+
title: 'Errors',
|
|
39
|
+
description: 'A developer-friendly error message or an array of messages.',
|
|
40
|
+
oneOf: [
|
|
41
|
+
{ type: 'string' },
|
|
42
|
+
{ type: 'array', items: { type: 'string' } },
|
|
43
|
+
],
|
|
44
|
+
}),
|
|
30
45
|
__metadata("design:type", Object)
|
|
31
46
|
], ErrorResponseDto.prototype, "errors", void 0);
|
package/dist/dtos/field.dto.d.ts
CHANGED
|
@@ -28,24 +28,18 @@ export declare class FieldDto {
|
|
|
28
28
|
* Type of the field
|
|
29
29
|
*/
|
|
30
30
|
type: FieldTypeEnum;
|
|
31
|
-
repeatableMin?: number;
|
|
32
|
-
repeatableMax?: number;
|
|
33
31
|
/**
|
|
34
32
|
* Indicates if the field is required
|
|
35
33
|
*/
|
|
36
|
-
required
|
|
34
|
+
required?: boolean;
|
|
37
35
|
/**
|
|
38
36
|
* Indicates if the field is disabled
|
|
39
37
|
*/
|
|
40
|
-
disabled
|
|
38
|
+
disabled?: boolean;
|
|
41
39
|
/**
|
|
42
|
-
* Indicates if the field is hidden
|
|
40
|
+
* Indicates if the field is hidden
|
|
43
41
|
*/
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Indicates if the field is visible in client panel
|
|
47
|
-
*/
|
|
48
|
-
visibleInClientPanel: boolean;
|
|
42
|
+
hidden?: boolean;
|
|
49
43
|
/**
|
|
50
44
|
* Regex validation pattern for the field
|
|
51
45
|
*/
|
|
@@ -55,11 +49,11 @@ export declare class FieldDto {
|
|
|
55
49
|
*/
|
|
56
50
|
regexValidationErrorMessage?: MultilangTextDto[];
|
|
57
51
|
/**
|
|
58
|
-
*
|
|
52
|
+
* Whether remote validation should be triggered
|
|
59
53
|
*/
|
|
60
54
|
triggersRemoteValidation?: boolean;
|
|
61
55
|
/**
|
|
62
|
-
*
|
|
56
|
+
* Remote validation error message for supported languages
|
|
63
57
|
*/
|
|
64
58
|
remoteValidationErrorMessage?: MultilangTextDto[];
|
|
65
59
|
/**
|
|
@@ -67,5 +61,6 @@ export declare class FieldDto {
|
|
|
67
61
|
* If the user has the permission to upgrade the item from his panel
|
|
68
62
|
* TODO: Let's see if this approach is the best way for the user to upgrade their item
|
|
69
63
|
*/
|
|
70
|
-
upgradable
|
|
64
|
+
upgradable?: boolean;
|
|
65
|
+
downgradable?: boolean;
|
|
71
66
|
}
|
package/dist/dtos/field.dto.js
CHANGED
|
@@ -17,28 +17,23 @@ const field_type_enum_1 = require("../enums/field-type.enum");
|
|
|
17
17
|
const multilang_text_dto_1 = require("./multilang-text.dto");
|
|
18
18
|
const field_option_dto_1 = require("./field-option.dto");
|
|
19
19
|
const is_regex_validator_1 = require("../decorators/is-regex.validator");
|
|
20
|
-
const all_or_none_validator_1 = require("../decorators/all-or-none.validator");
|
|
21
|
-
const min_less_or_equal_validator_1 = require("../decorators/min-less-or-equal.validator");
|
|
22
20
|
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
23
21
|
/**
|
|
24
22
|
* Data Transfer Object for a form field.
|
|
25
23
|
* This class defines the structure and properties of a single field
|
|
26
24
|
* that can be used in a user interface form.
|
|
27
25
|
*/
|
|
28
|
-
|
|
26
|
+
class FieldDto {
|
|
29
27
|
constructor() {
|
|
30
|
-
/**
|
|
31
|
-
* Indicates if the field triggers remote validation
|
|
32
|
-
*/
|
|
33
|
-
this.triggersRemoteValidation = false;
|
|
34
28
|
/**
|
|
35
29
|
* The item attribute is upgradable
|
|
36
30
|
* If the user has the permission to upgrade the item from his panel
|
|
37
31
|
* TODO: Let's see if this approach is the best way for the user to upgrade their item
|
|
38
32
|
*/
|
|
39
33
|
this.upgradable = false;
|
|
34
|
+
this.downgradable = false;
|
|
40
35
|
}
|
|
41
|
-
}
|
|
36
|
+
}
|
|
42
37
|
exports.FieldDto = FieldDto;
|
|
43
38
|
__decorate([
|
|
44
39
|
(0, class_validator_1.IsString)(),
|
|
@@ -99,16 +94,6 @@ __decorate([
|
|
|
99
94
|
}),
|
|
100
95
|
__metadata("design:type", String)
|
|
101
96
|
], FieldDto.prototype, "type", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
(0, class_validator_1.IsOptional)(),
|
|
104
|
-
(0, class_validator_1.IsNumber)(),
|
|
105
|
-
__metadata("design:type", Number)
|
|
106
|
-
], FieldDto.prototype, "repeatableMin", void 0);
|
|
107
|
-
__decorate([
|
|
108
|
-
(0, class_validator_1.IsOptional)(),
|
|
109
|
-
(0, class_validator_1.IsNumber)(),
|
|
110
|
-
__metadata("design:type", Number)
|
|
111
|
-
], FieldDto.prototype, "repeatableMax", void 0);
|
|
112
97
|
__decorate([
|
|
113
98
|
(0, class_validator_1.IsBoolean)(),
|
|
114
99
|
(0, class_validator_1.IsDefined)(),
|
|
@@ -131,24 +116,9 @@ __decorate([
|
|
|
131
116
|
], FieldDto.prototype, "disabled", void 0);
|
|
132
117
|
__decorate([
|
|
133
118
|
(0, class_validator_1.IsBoolean)(),
|
|
134
|
-
(0, class_validator_1.
|
|
135
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
136
|
-
title: 'Visible In Order',
|
|
137
|
-
description: 'Whether the field is visible in order.',
|
|
138
|
-
type: 'boolean',
|
|
139
|
-
}),
|
|
140
|
-
__metadata("design:type", Boolean)
|
|
141
|
-
], FieldDto.prototype, "visibleInOrder", void 0);
|
|
142
|
-
__decorate([
|
|
143
|
-
(0, class_validator_1.IsBoolean)(),
|
|
144
|
-
(0, class_validator_1.IsDefined)(),
|
|
145
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
146
|
-
title: 'Visible In Client Panel',
|
|
147
|
-
description: 'Whether the field is visible in client panel.',
|
|
148
|
-
type: 'boolean',
|
|
149
|
-
}),
|
|
119
|
+
(0, class_validator_1.IsOptional)(),
|
|
150
120
|
__metadata("design:type", Boolean)
|
|
151
|
-
], FieldDto.prototype, "
|
|
121
|
+
], FieldDto.prototype, "hidden", void 0);
|
|
152
122
|
__decorate([
|
|
153
123
|
(0, class_validator_1.IsString)(),
|
|
154
124
|
(0, is_regex_validator_1.IsRegex)(),
|
|
@@ -165,6 +135,8 @@ __decorate([
|
|
|
165
135
|
(0, class_validator_1.ValidateIf)((o) => !!o.regexValidation),
|
|
166
136
|
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
167
137
|
(0, class_transformer_1.Type)(() => multilang_text_dto_1.MultilangTextDto),
|
|
138
|
+
(0, class_validator_1.IsArray)(),
|
|
139
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
168
140
|
(0, class_validator_1.IsOptional)(),
|
|
169
141
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
170
142
|
title: 'Regex Validation Error Message',
|
|
@@ -177,21 +149,18 @@ __decorate([
|
|
|
177
149
|
__decorate([
|
|
178
150
|
(0, class_validator_1.IsBoolean)(),
|
|
179
151
|
(0, class_validator_1.IsOptional)(),
|
|
180
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
181
|
-
title: 'Triggers Remote Validation',
|
|
182
|
-
description: 'If true, field triggers remote validation.',
|
|
183
|
-
type: 'boolean',
|
|
184
|
-
}),
|
|
185
152
|
__metadata("design:type", Boolean)
|
|
186
153
|
], FieldDto.prototype, "triggersRemoteValidation", void 0);
|
|
187
154
|
__decorate([
|
|
188
|
-
(0, class_validator_1.ValidateIf)((o) => o.triggersRemoteValidation
|
|
155
|
+
(0, class_validator_1.ValidateIf)((o) => !!o.triggersRemoteValidation),
|
|
189
156
|
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
190
157
|
(0, class_transformer_1.Type)(() => multilang_text_dto_1.MultilangTextDto),
|
|
158
|
+
(0, class_validator_1.IsArray)(),
|
|
159
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
191
160
|
(0, class_validator_1.IsOptional)(),
|
|
192
161
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
193
162
|
title: 'Remote Validation Error Message',
|
|
194
|
-
description: 'Localized error
|
|
163
|
+
description: 'Localized error message shown when remote validation fails.',
|
|
195
164
|
type: 'array',
|
|
196
165
|
items: { $ref: '#/components/schemas/MultilangTextDto' },
|
|
197
166
|
}),
|
|
@@ -199,7 +168,7 @@ __decorate([
|
|
|
199
168
|
], FieldDto.prototype, "remoteValidationErrorMessage", void 0);
|
|
200
169
|
__decorate([
|
|
201
170
|
(0, class_validator_1.IsBoolean)(),
|
|
202
|
-
(0, class_validator_1.
|
|
171
|
+
(0, class_validator_1.IsOptional)(),
|
|
203
172
|
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
204
173
|
title: 'Upgradable',
|
|
205
174
|
description: 'Whether the item attribute is upgradable by the user.',
|
|
@@ -207,7 +176,13 @@ __decorate([
|
|
|
207
176
|
}),
|
|
208
177
|
__metadata("design:type", Boolean)
|
|
209
178
|
], FieldDto.prototype, "upgradable", void 0);
|
|
210
|
-
|
|
211
|
-
(0,
|
|
212
|
-
(0,
|
|
213
|
-
|
|
179
|
+
__decorate([
|
|
180
|
+
(0, class_validator_1.IsBoolean)(),
|
|
181
|
+
(0, class_validator_1.IsOptional)(),
|
|
182
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
183
|
+
title: 'Downgradable',
|
|
184
|
+
description: 'Whether the item attribute is downgradable by the user.',
|
|
185
|
+
type: 'boolean',
|
|
186
|
+
}),
|
|
187
|
+
__metadata("design:type", Boolean)
|
|
188
|
+
], FieldDto.prototype, "downgradable", void 0);
|
package/dist/dtos/info.dto.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ActionsEnum } from '../enums/actions.enum';
|
|
2
1
|
import { EventsEnum } from '../enums/events.enum';
|
|
3
2
|
import { LanguageEnum } from '../enums/language.enum';
|
|
4
3
|
import { RolesEnum } from '../enums/roles.enum';
|
|
@@ -31,10 +30,6 @@ export declare class InfoDto {
|
|
|
31
30
|
* A list of languages supported by the integration.
|
|
32
31
|
*/
|
|
33
32
|
supportedLanguages: LanguageEnum[];
|
|
34
|
-
/**
|
|
35
|
-
* A list of actions that are supported by this integration.
|
|
36
|
-
*/
|
|
37
|
-
supportedActions?: ActionsEnum[];
|
|
38
33
|
/**
|
|
39
34
|
* A list of events that the integration listens to.
|
|
40
35
|
* This allows the integration to react to specific events in the system.
|
package/dist/dtos/info.dto.js
CHANGED
|
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.InfoDto = void 0;
|
|
13
|
-
const actions_enum_1 = require("../enums/actions.enum");
|
|
14
13
|
const events_enum_1 = require("../enums/events.enum");
|
|
15
14
|
const language_enum_1 = require("../enums/language.enum");
|
|
16
15
|
const roles_enum_1 = require("../enums/roles.enum");
|
|
@@ -31,12 +30,6 @@ const unique_field_in_array_validator_1 = require("../decorators/unique-field-in
|
|
|
31
30
|
* and billing details.
|
|
32
31
|
*/
|
|
33
32
|
class InfoDto {
|
|
34
|
-
constructor() {
|
|
35
|
-
/**
|
|
36
|
-
* A list of actions that are supported by this integration.
|
|
37
|
-
*/
|
|
38
|
-
this.supportedActions = [];
|
|
39
|
-
}
|
|
40
33
|
}
|
|
41
34
|
exports.InfoDto = InfoDto;
|
|
42
35
|
__decorate([
|
|
@@ -87,18 +80,6 @@ __decorate([
|
|
|
87
80
|
}),
|
|
88
81
|
__metadata("design:type", Array)
|
|
89
82
|
], InfoDto.prototype, "supportedLanguages", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
(0, class_validator_1.IsOptional)(),
|
|
92
|
-
(0, class_validator_1.IsArray)(),
|
|
93
|
-
(0, class_validator_1.IsEnum)(actions_enum_1.ActionsEnum, { each: true }),
|
|
94
|
-
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
95
|
-
title: 'Supported Actions',
|
|
96
|
-
description: 'Actions supported by this integration.',
|
|
97
|
-
type: 'array',
|
|
98
|
-
items: { type: 'string', enum: Object.values(actions_enum_1.ActionsEnum) }
|
|
99
|
-
}),
|
|
100
|
-
__metadata("design:type", Array)
|
|
101
|
-
], InfoDto.prototype, "supportedActions", void 0);
|
|
102
83
|
__decorate([
|
|
103
84
|
(0, class_validator_1.IsOptional)(),
|
|
104
85
|
(0, class_validator_1.IsArray)(),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CountryEnum } from "../../enums/country.enum";
|
|
2
|
+
import { InfoDto } from "../info.dto";
|
|
3
|
+
import { InvoiceTypesEnum } from "../../enums/invoice/invoice-types.enum";
|
|
4
|
+
/**
|
|
5
|
+
* Invoice integration information.
|
|
6
|
+
* Extends base integration info with invoice-specific configuration.
|
|
7
|
+
*/
|
|
8
|
+
export declare class InvoiceInfoDto extends InfoDto {
|
|
9
|
+
/** Countries supported by this invoice integration */
|
|
10
|
+
supportedCountries: CountryEnum[];
|
|
11
|
+
/**
|
|
12
|
+
* A list of actions that are supported by this integration.
|
|
13
|
+
*/
|
|
14
|
+
supportedTypes: InvoiceTypesEnum[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.InvoiceInfoDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const info_dto_1 = require("../info.dto");
|
|
15
|
+
const invoice_types_enum_1 = require("../../enums/invoice/invoice-types.enum");
|
|
16
|
+
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
17
|
+
/**
|
|
18
|
+
* Invoice integration information.
|
|
19
|
+
* Extends base integration info with invoice-specific configuration.
|
|
20
|
+
*/
|
|
21
|
+
class InvoiceInfoDto extends info_dto_1.InfoDto {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
/**
|
|
25
|
+
* A list of actions that are supported by this integration.
|
|
26
|
+
*/
|
|
27
|
+
this.supportedTypes = [];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.InvoiceInfoDto = InvoiceInfoDto;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
33
|
+
(0, class_validator_1.IsArray)(),
|
|
34
|
+
(0, class_validator_1.IsEnum)(invoice_types_enum_1.InvoiceTypesEnum, { each: true }),
|
|
35
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
36
|
+
title: 'Supported Types',
|
|
37
|
+
description: 'Types of invoice supported by this integration.',
|
|
38
|
+
type: 'array',
|
|
39
|
+
items: { type: 'string', enum: Object.values(invoice_types_enum_1.InvoiceTypesEnum) }
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", Array)
|
|
42
|
+
], InvoiceInfoDto.prototype, "supportedTypes", void 0);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InvoiceItemActionsEnum } from "../../enums/invoice/invoice-item-actions.enum";
|
|
2
|
+
import { ItemDataDto } from "../item-data.dto";
|
|
3
|
+
/**
|
|
4
|
+
* Order product item data sent to invoice integrations.
|
|
5
|
+
* Uses invoice-specific actions to avoid confusion with product integration actions.
|
|
6
|
+
*/
|
|
7
|
+
export declare class InvoiceItemDataDto extends ItemDataDto {
|
|
8
|
+
/** Invoice-specific action type for this item */
|
|
9
|
+
action: InvoiceItemActionsEnum;
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.InvoiceItemDataDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
15
|
+
const invoice_item_actions_enum_1 = require("../../enums/invoice/invoice-item-actions.enum");
|
|
16
|
+
const item_data_dto_1 = require("../item-data.dto");
|
|
17
|
+
/**
|
|
18
|
+
* Order product item data sent to invoice integrations.
|
|
19
|
+
* Uses invoice-specific actions to avoid confusion with product integration actions.
|
|
20
|
+
*/
|
|
21
|
+
class InvoiceItemDataDto extends item_data_dto_1.ItemDataDto {
|
|
22
|
+
}
|
|
23
|
+
exports.InvoiceItemDataDto = InvoiceItemDataDto;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsDefined)(),
|
|
26
|
+
(0, class_validator_1.IsEnum)(invoice_item_actions_enum_1.InvoiceItemActionsEnum),
|
|
27
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
28
|
+
title: 'Action',
|
|
29
|
+
description: 'Invoice-specific action type for this item.',
|
|
30
|
+
type: 'string',
|
|
31
|
+
enum: Object.values(invoice_item_actions_enum_1.InvoiceItemActionsEnum),
|
|
32
|
+
}),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], InvoiceItemDataDto.prototype, "action", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProformaInvoiceRequestDto } from "./proforma-invoice-request.dto";
|
|
2
|
+
/**
|
|
3
|
+
* Request payload for creating a credit note.
|
|
4
|
+
* Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CreditNoteRequestDto extends ProformaInvoiceRequestDto {
|
|
7
|
+
/** Reference to the parent invoice being credited */
|
|
8
|
+
parentInvoiceId: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.CreditNoteRequestDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
15
|
+
const proforma_invoice_request_dto_1 = require("./proforma-invoice-request.dto");
|
|
16
|
+
/**
|
|
17
|
+
* Request payload for creating a credit note.
|
|
18
|
+
* Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
|
|
19
|
+
*/
|
|
20
|
+
class CreditNoteRequestDto extends proforma_invoice_request_dto_1.ProformaInvoiceRequestDto {
|
|
21
|
+
}
|
|
22
|
+
exports.CreditNoteRequestDto = CreditNoteRequestDto;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
27
|
+
title: 'Parent Invoice ID',
|
|
28
|
+
description: 'Reference to the parent invoice being credited.',
|
|
29
|
+
type: 'string',
|
|
30
|
+
}),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreditNoteRequestDto.prototype, "parentInvoiceId", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProformaInvoiceRequestDto } from "./proforma-invoice-request.dto";
|
|
2
|
+
/**
|
|
3
|
+
* Request payload for creating a standard invoice.
|
|
4
|
+
* Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InvoiceRequestDto extends ProformaInvoiceRequestDto {
|
|
7
|
+
/** Reference to parent invoice if applicable */
|
|
8
|
+
parentInvoiceId?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.InvoiceRequestDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
15
|
+
const proforma_invoice_request_dto_1 = require("./proforma-invoice-request.dto");
|
|
16
|
+
/**
|
|
17
|
+
* Request payload for creating a standard invoice.
|
|
18
|
+
* Extends proforma invoice with minimal variations to keep the API clean for invoice integration developers.
|
|
19
|
+
*/
|
|
20
|
+
class InvoiceRequestDto extends proforma_invoice_request_dto_1.ProformaInvoiceRequestDto {
|
|
21
|
+
}
|
|
22
|
+
exports.InvoiceRequestDto = InvoiceRequestDto;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
27
|
+
title: 'Parent Invoice ID',
|
|
28
|
+
description: 'Reference to parent invoice if applicable.',
|
|
29
|
+
type: 'string',
|
|
30
|
+
}),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], InvoiceRequestDto.prototype, "parentInvoiceId", void 0);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { InvoiceContactData } from "../../invoice-contact-data.dto";
|
|
2
|
+
import { InvoiceItemDataDto } from "../invoice-item-data.dto";
|
|
3
|
+
import { TransactionData } from "../transaction-data.dto";
|
|
4
|
+
import { CountryEnum } from '../../../enums/country.enum';
|
|
5
|
+
/**
|
|
6
|
+
* Request payload for creating a proforma invoice.
|
|
7
|
+
* Sent from hoster.ai to invoice integrations to issue a proforma document.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ProformaInvoiceRequestDto {
|
|
10
|
+
/** Unique identifier for the invoice */
|
|
11
|
+
invoiceId: string;
|
|
12
|
+
/** Company identifier issuing the invoice */
|
|
13
|
+
companyId: string;
|
|
14
|
+
/** Country where the company is registered */
|
|
15
|
+
companyCountry: CountryEnum;
|
|
16
|
+
/** List of transactions associated with this invoice */
|
|
17
|
+
transactions: TransactionData[];
|
|
18
|
+
/** Billing contact information for the invoice recipient */
|
|
19
|
+
invoiceContact: InvoiceContactData;
|
|
20
|
+
/** Line items included in the invoice */
|
|
21
|
+
items: InvoiceItemDataDto[];
|
|
22
|
+
/** Total invoice amount */
|
|
23
|
+
totalAmount: number;
|
|
24
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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.ProformaInvoiceRequestDto = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const class_validator_jsonschema_1 = require("class-validator-jsonschema");
|
|
16
|
+
const invoice_contact_data_dto_1 = require("../../invoice-contact-data.dto");
|
|
17
|
+
const invoice_item_data_dto_1 = require("../invoice-item-data.dto");
|
|
18
|
+
const transaction_data_dto_1 = require("../transaction-data.dto");
|
|
19
|
+
const country_enum_1 = require("../../../enums/country.enum");
|
|
20
|
+
/**
|
|
21
|
+
* Request payload for creating a proforma invoice.
|
|
22
|
+
* Sent from hoster.ai to invoice integrations to issue a proforma document.
|
|
23
|
+
*/
|
|
24
|
+
class ProformaInvoiceRequestDto {
|
|
25
|
+
}
|
|
26
|
+
exports.ProformaInvoiceRequestDto = ProformaInvoiceRequestDto;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsDefined)(),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
31
|
+
title: 'Invoice ID',
|
|
32
|
+
description: 'Unique identifier for the invoice.',
|
|
33
|
+
type: 'string',
|
|
34
|
+
}),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ProformaInvoiceRequestDto.prototype, "invoiceId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsDefined)(),
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
41
|
+
title: 'Company ID',
|
|
42
|
+
description: 'Company identifier issuing the invoice.',
|
|
43
|
+
type: 'string',
|
|
44
|
+
}),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], ProformaInvoiceRequestDto.prototype, "companyId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_validator_1.IsDefined)(),
|
|
49
|
+
(0, class_validator_1.IsEnum)(country_enum_1.CountryEnum),
|
|
50
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
51
|
+
title: 'Company Country',
|
|
52
|
+
description: 'Country where the company is registered.',
|
|
53
|
+
type: 'string',
|
|
54
|
+
enum: Object.values(country_enum_1.CountryEnum),
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], ProformaInvoiceRequestDto.prototype, "companyCountry", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsDefined)(),
|
|
60
|
+
(0, class_validator_1.IsArray)(),
|
|
61
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
62
|
+
(0, class_transformer_1.Type)(() => transaction_data_dto_1.TransactionData),
|
|
63
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
64
|
+
title: 'Transactions',
|
|
65
|
+
description: 'List of transactions associated with this invoice.',
|
|
66
|
+
type: 'array',
|
|
67
|
+
items: { $ref: '#/components/schemas/TransactionData' },
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", Array)
|
|
70
|
+
], ProformaInvoiceRequestDto.prototype, "transactions", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsDefined)(),
|
|
73
|
+
(0, class_validator_1.ValidateNested)(),
|
|
74
|
+
(0, class_transformer_1.Type)(() => invoice_contact_data_dto_1.InvoiceContactData),
|
|
75
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
76
|
+
title: 'Invoice Contact',
|
|
77
|
+
description: 'Billing contact information for the invoice recipient.',
|
|
78
|
+
$ref: '#/components/schemas/InvoiceContactData',
|
|
79
|
+
}),
|
|
80
|
+
__metadata("design:type", invoice_contact_data_dto_1.InvoiceContactData)
|
|
81
|
+
], ProformaInvoiceRequestDto.prototype, "invoiceContact", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, class_validator_1.IsDefined)(),
|
|
84
|
+
(0, class_validator_1.IsArray)(),
|
|
85
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
86
|
+
(0, class_transformer_1.Type)(() => invoice_item_data_dto_1.InvoiceItemDataDto),
|
|
87
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
88
|
+
title: 'Items',
|
|
89
|
+
description: 'Line items included in the invoice.',
|
|
90
|
+
type: 'array',
|
|
91
|
+
items: { $ref: '#/components/schemas/InvoiceItemDataDto' },
|
|
92
|
+
}),
|
|
93
|
+
__metadata("design:type", Array)
|
|
94
|
+
], ProformaInvoiceRequestDto.prototype, "items", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, class_validator_1.IsDefined)(),
|
|
97
|
+
(0, class_validator_1.IsNumber)(),
|
|
98
|
+
(0, class_validator_jsonschema_1.JSONSchema)({
|
|
99
|
+
title: 'Total Amount',
|
|
100
|
+
description: 'Total invoice amount.',
|
|
101
|
+
type: 'number',
|
|
102
|
+
}),
|
|
103
|
+
__metadata("design:type", Number)
|
|
104
|
+
], ProformaInvoiceRequestDto.prototype, "totalAmount", void 0);
|