@alba-cars/common-modules 2.0.0 → 2.1.0
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/index.js +1 -21
- package/package.json +10 -6
- package/dist/core/enums/HttpMethods.js +0 -14
- package/dist/core/enums/HttpStatusCodes.js +0 -19
- package/dist/core/enums/index.js +0 -18
- package/dist/core/error-handling/AppError.js +0 -48
- package/dist/core/error-handling/index.js +0 -17
- package/dist/core/index.js +0 -21
- package/dist/core/models/index.js +0 -19
- package/dist/core/models/media/index.js +0 -17
- package/dist/core/models/media/media_data.js +0 -2
- package/dist/core/models/pagination/index.js +0 -17
- package/dist/core/models/pagination/paginated_data.js +0 -21
- package/dist/core/models/range.js +0 -26
- package/dist/core/network/api-client.d.ts +0 -1
- package/dist/core/network/api-client.js +0 -22
- package/dist/core/network/endpoint-config.js +0 -260
- package/dist/core/network/fetch-api.js +0 -206
- package/dist/core/network/index.js +0 -18
- package/dist/core/utils/formatCurrency.js +0 -39
- package/dist/core/utils/global-constants.js +0 -9
- package/dist/core/utils/global-utils.js +0 -190
- package/dist/core/utils/global_validators.js +0 -20
- package/dist/core/utils/index.js +0 -20
- package/dist/core/utils/query_flatten.js +0 -15
- package/dist/features/auth/data/dto/AuthDTO.js +0 -106
- package/dist/features/auth/data/dto/RoleDTO.js +0 -132
- package/dist/features/auth/data/dto/UserDTO.js +0 -222
- package/dist/features/auth/data/index.js +0 -19
- package/dist/features/auth/index.js +0 -17
- package/dist/features/bank-valuation-request/data/dto/BankValuationRequestDTO.js +0 -132
- package/dist/features/bank-valuation-request/index.js +0 -17
- package/dist/features/blog/data/dto/BlogDTO.js +0 -176
- package/dist/features/blog/index.js +0 -17
- package/dist/features/callback-request/data/dto/CallBackRequestDTO.js +0 -110
- package/dist/features/callback-request/index.js +0 -17
- package/dist/features/deposits/data/dto/DepositDTOs.js +0 -303
- package/dist/features/deposits/data/index.js +0 -17
- package/dist/features/deposits/index.js +0 -17
- package/dist/features/faq/data/dtos/CreateFaqDTO.js +0 -87
- package/dist/features/faq/data/dtos/FaqFetchDTO.js +0 -349
- package/dist/features/faq/data/dtos/UpdateFaqDTO.js +0 -91
- package/dist/features/faq/data/dtos/index.js +0 -19
- package/dist/features/faq/data/enums/index.js +0 -10
- package/dist/features/faq/data/index.js +0 -18
- package/dist/features/faq/index.js +0 -17
- package/dist/features/finance-eligibilty-request/data/dto/FinanceEligibilityRequestDTO.js +0 -429
- package/dist/features/finance-eligibilty-request/data/index.js +0 -17
- package/dist/features/finance-eligibilty-request/index.js +0 -17
- package/dist/features/google-review/data/dto/google_review_dto.js +0 -466
- package/dist/features/google-review/data/dto/index.js +0 -17
- package/dist/features/google-review/data/enums/index.js +0 -8
- package/dist/features/google-review/data/index.js +0 -18
- package/dist/features/google-review/index.js +0 -17
- package/dist/features/index.js +0 -34
- package/dist/features/lead/data/dto/index.js +0 -20
- package/dist/features/lead/data/dto/lead_documents_dto.js +0 -73
- package/dist/features/lead/data/dto/lead_dto.js +0 -435
- package/dist/features/lead/data/dto/lead_preference_history_dto.js +0 -321
- package/dist/features/lead/data/dto/lead_prefernce_dto.js +0 -308
- package/dist/features/lead/data/enum/index.js +0 -18
- package/dist/features/lead/data/enum/lead_source_status_types.js +0 -19
- package/dist/features/lead/data/enum/lead_status_type.js +0 -12
- package/dist/features/lead/index.js +0 -18
- package/dist/features/models/BankValuationRequest.js +0 -6
- package/dist/features/models/Base.js +0 -6
- package/dist/features/models/Deposit.js +0 -6
- package/dist/features/models/Lead.js +0 -6
- package/dist/features/models/Payment.js +0 -7
- package/dist/features/models/Roles.js +0 -2
- package/dist/features/models/Ticket.js +0 -12
- package/dist/features/models/User.js +0 -2
- package/dist/features/models/UserFavoriteVehicle.js +0 -6
- package/dist/features/models/Vehicle.js +0 -17
- package/dist/features/models/VehicleBodyType.js +0 -7
- package/dist/features/models/VehicleCategory.js +0 -7
- package/dist/features/models/VehicleFeature.js +0 -7
- package/dist/features/models/VehicleFeatureCategory.js +0 -7
- package/dist/features/models/VehicleFinance.js +0 -7
- package/dist/features/models/VehicleMake.js +0 -7
- package/dist/features/models/VehicleMedia.js +0 -7
- package/dist/features/models/VehicleMetaData.js +0 -7
- package/dist/features/models/VehicleModel.js +0 -7
- package/dist/features/models/VehicleOrder.js +0 -7
- package/dist/features/models/_index.js +0 -30
- package/dist/features/models/index.js +0 -37
- package/dist/features/newsletter/data/dto/NewsletterDTO.js +0 -79
- package/dist/features/newsletter/index.js +0 -17
- package/dist/features/sales-team/data/dto/LanguageDTO.js +0 -89
- package/dist/features/sales-team/data/dto/SalesAgentDTO.js +0 -613
- package/dist/features/sales-team/data/index.js +0 -18
- package/dist/features/sales-team/index.js +0 -17
- package/dist/features/sell-car-request/data/dto/SellCarRequestDTO.js +0 -672
- package/dist/features/sell-car-request/data/index.js +0 -17
- package/dist/features/sell-car-request/index.js +0 -17
- package/dist/features/showroom-visit/data/dto/ShowroomVisit.js +0 -237
- package/dist/features/showroom-visit/data/enums/index.js +0 -17
- package/dist/features/showroom-visit/data/index.js +0 -18
- package/dist/features/showroom-visit/index.js +0 -17
- package/dist/features/test-drive-request/api/GetTestDriveVehicles.js +0 -8
- package/dist/features/test-drive-request/api/index.js +0 -17
- package/dist/features/test-drive-request/data/dto/TestDriveRequestDTO.js +0 -179
- package/dist/features/test-drive-request/data/enums/index.js +0 -29
- package/dist/features/test-drive-request/data/index.js +0 -20
- package/dist/features/test-drive-request/data/models/TestDriveRequest.js +0 -7
- package/dist/features/test-drive-request/data/models/index.js +0 -5
- package/dist/features/test-drive-request/data/utilities.js +0 -100
- package/dist/features/test-drive-request/index.js +0 -18
- package/dist/features/tickets/data/dto/TicketDto.js +0 -293
- package/dist/features/tickets/data/enums/index.js +0 -18
- package/dist/features/tickets/index.js +0 -18
- package/dist/features/vehicle/data/dto/BaseDTO.js +0 -34
- package/dist/features/vehicle/data/dto/MediaDTO.js +0 -2
- package/dist/features/vehicle/data/dto/PaymentDTO.js +0 -161
- package/dist/features/vehicle/data/dto/SimilarVehicleDTO.js +0 -38
- package/dist/features/vehicle/data/dto/VehicleCategoryDTO.js +0 -114
- package/dist/features/vehicle/data/dto/VehicleDTO.js +0 -587
- package/dist/features/vehicle/data/dto/VehicleFavoritesDTO.js +0 -60
- package/dist/features/vehicle/data/dto/VehicleFeatureCategoriesDTO.js +0 -114
- package/dist/features/vehicle/data/dto/VehicleFeatureDTO.js +0 -125
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.js +0 -771
- package/dist/features/vehicle/data/dto/VehicleFinanceDTO.js +0 -183
- package/dist/features/vehicle/data/dto/VehicleInspectionDTO.js +0 -765
- package/dist/features/vehicle/data/dto/VehicleMakeDTO.js +0 -189
- package/dist/features/vehicle/data/dto/VehicleMedia.js +0 -152
- package/dist/features/vehicle/data/dto/VehicleModelDTO.js +0 -182
- package/dist/features/vehicle/data/dto/VehicleOrderDTO.js +0 -139
- package/dist/features/vehicle/data/dto/VehicleTypeDTO.js +0 -102
- package/dist/features/vehicle/data/dto/VehicleWarrantyDTO.js +0 -47
- package/dist/features/vehicle/data/dto/index.js +0 -35
- package/dist/features/vehicle/data/enums/index.js +0 -46
- package/dist/features/vehicle/data/index.js +0 -20
- package/dist/features/vehicle/data/utilities.js +0 -520
- package/dist/features/vehicle/index.js +0 -17
- package/dist/features/vehicle-reservations/data/dto/VehicleReservationDTO.js +0 -346
- package/dist/features/vehicle-reservations/data/dto/index.js +0 -17
- package/dist/features/vehicle-reservations/data/enums/finance-type.js +0 -9
- package/dist/features/vehicle-reservations/data/enums/index.js +0 -19
- package/dist/features/vehicle-reservations/data/enums/reservation-type.js +0 -13
- package/dist/features/vehicle-reservations/data/enums/vehicle-reservation-type.js +0 -8
- package/dist/features/vehicle-reservations/index.js +0 -18
- package/dist/global/dto/BaseGetDTO.js +0 -18
- package/dist/global/dto/index.js +0 -17
- package/dist/global/index.js +0 -18
- package/dist/global/utilities.js +0 -173
- package/dist/models.js +0 -17
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// VehicleMakeDTO.ts
|
|
3
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
-
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;
|
|
7
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8
|
-
};
|
|
9
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.DynamicMakeDTO = exports.VehicleMakeUpdateDTO = exports.VehicleMakeCreateDTO = exports.VehicleMakeGetUniqueDTO = exports.VehicleMakeGetDTO = void 0;
|
|
14
|
-
const class_validator_1 = require("class-validator");
|
|
15
|
-
const class_transformer_1 = require("class-transformer");
|
|
16
|
-
const BaseDTO_1 = require("./BaseDTO");
|
|
17
|
-
class VehicleMakeGetDTO {
|
|
18
|
-
validate() {
|
|
19
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
20
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
21
|
-
}
|
|
22
|
-
static fromPlain(plain) {
|
|
23
|
-
return (0, class_transformer_1.plainToClass)(VehicleMakeGetDTO, plain);
|
|
24
|
-
}
|
|
25
|
-
static toPlain(entity) {
|
|
26
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.VehicleMakeGetDTO = VehicleMakeGetDTO;
|
|
30
|
-
// Use this to get a unique vehicle make by unique fields
|
|
31
|
-
class VehicleMakeGetUniqueDTO {
|
|
32
|
-
validate() {
|
|
33
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
34
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
35
|
-
}
|
|
36
|
-
static fromPlain(plain) {
|
|
37
|
-
return (0, class_transformer_1.plainToClass)(VehicleMakeGetUniqueDTO, plain);
|
|
38
|
-
}
|
|
39
|
-
static toPlain(entity) {
|
|
40
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.VehicleMakeGetUniqueDTO = VehicleMakeGetUniqueDTO;
|
|
44
|
-
class VehicleMakeCreateDTO extends BaseDTO_1.BaseCreateDTO {
|
|
45
|
-
// NOTE:
|
|
46
|
-
// - We are not validating the slug field because it is automatically generated from the name field.
|
|
47
|
-
// - We cannot create a attach vehicles and models to a make during creation because the make should be created first and then the vehicles and models should be created and attached to the make.
|
|
48
|
-
validate() {
|
|
49
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
50
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
51
|
-
}
|
|
52
|
-
static fromPlain(plain) {
|
|
53
|
-
return (0, class_transformer_1.plainToClass)(VehicleMakeCreateDTO, plain);
|
|
54
|
-
}
|
|
55
|
-
static toPlain(entity) {
|
|
56
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, class_validator_1.IsString)(),
|
|
61
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
62
|
-
(0, class_validator_1.IsDefined)(),
|
|
63
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
64
|
-
message: "Name can only contain letters, numbers, spaces, hyphens, and underscores.",
|
|
65
|
-
}),
|
|
66
|
-
__metadata("design:type", String)
|
|
67
|
-
], VehicleMakeCreateDTO.prototype, "name", void 0);
|
|
68
|
-
__decorate([
|
|
69
|
-
(0, class_validator_1.IsString)(),
|
|
70
|
-
(0, class_validator_1.IsOptional)(),
|
|
71
|
-
__metadata("design:type", String)
|
|
72
|
-
], VehicleMakeCreateDTO.prototype, "image", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
(0, class_validator_1.IsString)(),
|
|
75
|
-
(0, class_validator_1.IsOptional)(),
|
|
76
|
-
__metadata("design:type", String)
|
|
77
|
-
], VehicleMakeCreateDTO.prototype, "description", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
(0, class_validator_1.IsString)(),
|
|
80
|
-
(0, class_validator_1.IsOptional)(),
|
|
81
|
-
__metadata("design:type", String)
|
|
82
|
-
], VehicleMakeCreateDTO.prototype, "metaTitle", void 0);
|
|
83
|
-
__decorate([
|
|
84
|
-
(0, class_validator_1.IsString)(),
|
|
85
|
-
(0, class_validator_1.IsOptional)(),
|
|
86
|
-
__metadata("design:type", String)
|
|
87
|
-
], VehicleMakeCreateDTO.prototype, "metaDescription", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
(0, class_validator_1.IsString)(),
|
|
90
|
-
(0, class_validator_1.IsOptional)(),
|
|
91
|
-
__metadata("design:type", String)
|
|
92
|
-
], VehicleMakeCreateDTO.prototype, "metaKeywords", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
(0, class_validator_1.IsBoolean)(),
|
|
95
|
-
(0, class_validator_1.IsOptional)(),
|
|
96
|
-
__metadata("design:type", Boolean)
|
|
97
|
-
], VehicleMakeCreateDTO.prototype, "promoted", void 0);
|
|
98
|
-
__decorate([
|
|
99
|
-
(0, class_validator_1.IsBoolean)(),
|
|
100
|
-
(0, class_validator_1.IsOptional)(),
|
|
101
|
-
__metadata("design:type", Boolean)
|
|
102
|
-
], VehicleMakeCreateDTO.prototype, "showInFooter", void 0);
|
|
103
|
-
exports.VehicleMakeCreateDTO = VehicleMakeCreateDTO;
|
|
104
|
-
class VehicleMakeUpdateDTO extends BaseDTO_1.BaseUpdateDTO {
|
|
105
|
-
validate() {
|
|
106
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
107
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
108
|
-
}
|
|
109
|
-
static fromPlain(plain) {
|
|
110
|
-
return (0, class_transformer_1.plainToClass)(VehicleMakeUpdateDTO, plain);
|
|
111
|
-
}
|
|
112
|
-
static toPlain(entity) {
|
|
113
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
__decorate([
|
|
117
|
-
(0, class_validator_1.IsString)(),
|
|
118
|
-
(0, class_validator_1.IsOptional)(),
|
|
119
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
120
|
-
message: "Name can only contain letters, numbers, spaces, hyphens, and underscores.",
|
|
121
|
-
}),
|
|
122
|
-
__metadata("design:type", String)
|
|
123
|
-
], VehicleMakeUpdateDTO.prototype, "name", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
(0, class_validator_1.IsString)(),
|
|
126
|
-
(0, class_validator_1.IsOptional)(),
|
|
127
|
-
__metadata("design:type", String)
|
|
128
|
-
], VehicleMakeUpdateDTO.prototype, "image", void 0);
|
|
129
|
-
__decorate([
|
|
130
|
-
(0, class_validator_1.IsString)(),
|
|
131
|
-
(0, class_validator_1.IsOptional)(),
|
|
132
|
-
__metadata("design:type", String)
|
|
133
|
-
], VehicleMakeUpdateDTO.prototype, "description", void 0);
|
|
134
|
-
__decorate([
|
|
135
|
-
(0, class_validator_1.IsString)(),
|
|
136
|
-
(0, class_validator_1.IsOptional)(),
|
|
137
|
-
__metadata("design:type", String)
|
|
138
|
-
], VehicleMakeUpdateDTO.prototype, "metaTitle", void 0);
|
|
139
|
-
__decorate([
|
|
140
|
-
(0, class_validator_1.IsString)(),
|
|
141
|
-
(0, class_validator_1.IsOptional)(),
|
|
142
|
-
__metadata("design:type", String)
|
|
143
|
-
], VehicleMakeUpdateDTO.prototype, "metaDescription", void 0);
|
|
144
|
-
__decorate([
|
|
145
|
-
(0, class_validator_1.IsString)(),
|
|
146
|
-
(0, class_validator_1.IsOptional)(),
|
|
147
|
-
__metadata("design:type", String)
|
|
148
|
-
], VehicleMakeUpdateDTO.prototype, "metaKeywords", void 0);
|
|
149
|
-
__decorate([
|
|
150
|
-
(0, class_validator_1.IsBoolean)(),
|
|
151
|
-
(0, class_validator_1.IsOptional)(),
|
|
152
|
-
__metadata("design:type", Boolean)
|
|
153
|
-
], VehicleMakeUpdateDTO.prototype, "promoted", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
(0, class_validator_1.IsBoolean)(),
|
|
156
|
-
(0, class_validator_1.IsOptional)(),
|
|
157
|
-
__metadata("design:type", Boolean)
|
|
158
|
-
], VehicleMakeUpdateDTO.prototype, "showInFooter", void 0);
|
|
159
|
-
__decorate([
|
|
160
|
-
(0, class_validator_1.IsBoolean)(),
|
|
161
|
-
(0, class_validator_1.IsOptional)(),
|
|
162
|
-
__metadata("design:type", Boolean)
|
|
163
|
-
], VehicleMakeUpdateDTO.prototype, "isActive", void 0);
|
|
164
|
-
exports.VehicleMakeUpdateDTO = VehicleMakeUpdateDTO;
|
|
165
|
-
class DynamicMakeDTO {
|
|
166
|
-
validate() {
|
|
167
|
-
if (!this.existingId && !this.new) {
|
|
168
|
-
throw new Error("Either existingId or new details must be provided.");
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
static fromPlain(plain) {
|
|
172
|
-
return (0, class_transformer_1.plainToClass)(DynamicMakeDTO, plain);
|
|
173
|
-
}
|
|
174
|
-
static toPlain(entity) {
|
|
175
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
__decorate([
|
|
179
|
-
(0, class_validator_1.IsString)(),
|
|
180
|
-
(0, class_validator_1.IsOptional)(),
|
|
181
|
-
__metadata("design:type", String)
|
|
182
|
-
], DynamicMakeDTO.prototype, "existingId", void 0);
|
|
183
|
-
__decorate([
|
|
184
|
-
(0, class_validator_1.ValidateNested)(),
|
|
185
|
-
(0, class_transformer_1.Type)(() => VehicleMakeCreateDTO),
|
|
186
|
-
(0, class_validator_1.IsOptional)(),
|
|
187
|
-
__metadata("design:type", VehicleMakeCreateDTO)
|
|
188
|
-
], DynamicMakeDTO.prototype, "new", void 0);
|
|
189
|
-
exports.DynamicMakeDTO = DynamicMakeDTO;
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.VehicleMediaUpdateDTO = exports.S3MediaCreateURLDTO = exports.VehicleMediaCreateS3UrlDTO = exports.VehicleMediaFilterDTO = exports.VehicleMediaCreateDTO = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const enums_1 = require("../enums");
|
|
15
|
-
const class_transformer_1 = require("class-transformer");
|
|
16
|
-
class VehicleMediaCreateDTO {
|
|
17
|
-
validate() {
|
|
18
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
19
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
20
|
-
}
|
|
21
|
-
static fromPlain(plain) {
|
|
22
|
-
return (0, class_transformer_1.plainToClass)(VehicleMediaCreateDTO, plain);
|
|
23
|
-
}
|
|
24
|
-
static toPlain(entity) {
|
|
25
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], VehicleMediaCreateDTO.prototype, "vehicleId", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, class_validator_1.IsEnum)(enums_1.VehicleMediaType),
|
|
34
|
-
__metadata("design:type", String)
|
|
35
|
-
], VehicleMediaCreateDTO.prototype, "mediaType", void 0);
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
38
|
-
(0, class_validator_1.IsString)(),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], VehicleMediaCreateDTO.prototype, "mediaUrl", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
43
|
-
(0, class_validator_1.IsString)(),
|
|
44
|
-
__metadata("design:type", String)
|
|
45
|
-
], VehicleMediaCreateDTO.prototype, "placeholder", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, class_validator_1.IsOptional)(),
|
|
48
|
-
(0, class_validator_1.IsString)(),
|
|
49
|
-
__metadata("design:type", String)
|
|
50
|
-
], VehicleMediaCreateDTO.prototype, "thumbnailUrl", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
(0, class_validator_1.IsNumber)(),
|
|
53
|
-
__metadata("design:type", Number)
|
|
54
|
-
], VehicleMediaCreateDTO.prototype, "mediaIndex", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
57
|
-
(0, class_validator_1.IsBoolean)(),
|
|
58
|
-
__metadata("design:type", Boolean)
|
|
59
|
-
], VehicleMediaCreateDTO.prototype, "isPrimary", void 0);
|
|
60
|
-
exports.VehicleMediaCreateDTO = VehicleMediaCreateDTO;
|
|
61
|
-
class VehicleMediaFilterDTO {
|
|
62
|
-
validate() {
|
|
63
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
64
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
65
|
-
}
|
|
66
|
-
static fromPlain(plain) {
|
|
67
|
-
return (0, class_transformer_1.plainToClass)(VehicleMediaFilterDTO, plain);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
__decorate([
|
|
71
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
72
|
-
(0, class_validator_1.IsOptional)(),
|
|
73
|
-
__metadata("design:type", Object)
|
|
74
|
-
], VehicleMediaFilterDTO.prototype, "id", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
77
|
-
(0, class_validator_1.IsOptional)(),
|
|
78
|
-
__metadata("design:type", Object)
|
|
79
|
-
], VehicleMediaFilterDTO.prototype, "vehicleId", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
(0, class_validator_1.IsEnum)(enums_1.VehicleMediaType, { each: true }),
|
|
82
|
-
(0, class_validator_1.IsOptional)(),
|
|
83
|
-
__metadata("design:type", Object)
|
|
84
|
-
], VehicleMediaFilterDTO.prototype, "mediaType", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
87
|
-
(0, class_validator_1.IsOptional)(),
|
|
88
|
-
__metadata("design:type", Object)
|
|
89
|
-
], VehicleMediaFilterDTO.prototype, "mediaUrl", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
92
|
-
(0, class_validator_1.IsOptional)(),
|
|
93
|
-
__metadata("design:type", Object)
|
|
94
|
-
], VehicleMediaFilterDTO.prototype, "thumbnailUrl", void 0);
|
|
95
|
-
__decorate([
|
|
96
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
97
|
-
(0, class_validator_1.IsOptional)(),
|
|
98
|
-
__metadata("design:type", Boolean)
|
|
99
|
-
], VehicleMediaFilterDTO.prototype, "isPrimary", void 0);
|
|
100
|
-
exports.VehicleMediaFilterDTO = VehicleMediaFilterDTO;
|
|
101
|
-
class VehicleMediaCreateS3UrlDTO {
|
|
102
|
-
constructor() { }
|
|
103
|
-
}
|
|
104
|
-
exports.VehicleMediaCreateS3UrlDTO = VehicleMediaCreateS3UrlDTO;
|
|
105
|
-
class S3MediaCreateURLDTO {
|
|
106
|
-
}
|
|
107
|
-
__decorate([
|
|
108
|
-
(0, class_validator_1.IsString)(),
|
|
109
|
-
__metadata("design:type", String)
|
|
110
|
-
], S3MediaCreateURLDTO.prototype, "vehicleId", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
(0, class_validator_1.IsString)(),
|
|
113
|
-
__metadata("design:type", String)
|
|
114
|
-
], S3MediaCreateURLDTO.prototype, "folder", void 0);
|
|
115
|
-
__decorate([
|
|
116
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
117
|
-
(0, class_validator_1.IsArray)(),
|
|
118
|
-
__metadata("design:type", Array)
|
|
119
|
-
], S3MediaCreateURLDTO.prototype, "files", void 0);
|
|
120
|
-
exports.S3MediaCreateURLDTO = S3MediaCreateURLDTO;
|
|
121
|
-
class VehicleMediaUpdateDTO {
|
|
122
|
-
validate() {
|
|
123
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
124
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
125
|
-
}
|
|
126
|
-
static fromPlain(plain) {
|
|
127
|
-
return (0, class_transformer_1.plainToClass)(VehicleMediaUpdateDTO, plain);
|
|
128
|
-
}
|
|
129
|
-
static toPlain(entity) {
|
|
130
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
__decorate([
|
|
134
|
-
(0, class_validator_1.IsOptional)(),
|
|
135
|
-
(0, class_validator_1.IsArray)(),
|
|
136
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
137
|
-
(0, class_transformer_1.Type)(() => VehicleMediaCreateDTO) // This transforms each object in the array to the OtherDetailsDTO class
|
|
138
|
-
,
|
|
139
|
-
__metadata("design:type", Array)
|
|
140
|
-
], VehicleMediaUpdateDTO.prototype, "data", void 0);
|
|
141
|
-
__decorate([
|
|
142
|
-
(0, class_validator_1.IsOptional)(),
|
|
143
|
-
(0, class_validator_1.IsBoolean)(),
|
|
144
|
-
__metadata("design:type", Boolean)
|
|
145
|
-
], VehicleMediaUpdateDTO.prototype, "replace", void 0);
|
|
146
|
-
__decorate([
|
|
147
|
-
(0, class_validator_1.ValidateNested)(),
|
|
148
|
-
(0, class_transformer_1.Type)(() => VehicleMediaFilterDTO) // Create a VehicleMediaFilter class
|
|
149
|
-
,
|
|
150
|
-
__metadata("design:type", VehicleMediaFilterDTO)
|
|
151
|
-
], VehicleMediaUpdateDTO.prototype, "filter", void 0);
|
|
152
|
-
exports.VehicleMediaUpdateDTO = VehicleMediaUpdateDTO;
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// VehicleModelDTO.ts
|
|
3
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
-
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;
|
|
7
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8
|
-
};
|
|
9
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.DynamicModelDTO = exports.VehicleModelUpdateDTO = exports.VehicleModelCreateDTO = exports.VehicleModelGetUniqueDTO = exports.VehicleModelGetDTO = void 0;
|
|
14
|
-
const class_validator_1 = require("class-validator");
|
|
15
|
-
const class_transformer_1 = require("class-transformer");
|
|
16
|
-
const BaseDTO_1 = require("./BaseDTO");
|
|
17
|
-
const Vehicle_1 = require("../../../models/Vehicle");
|
|
18
|
-
const VehicleMake_1 = require("../../../models/VehicleMake");
|
|
19
|
-
class VehicleModelGetDTO {
|
|
20
|
-
validate() {
|
|
21
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
22
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
23
|
-
}
|
|
24
|
-
static fromPlain(plain) {
|
|
25
|
-
return (0, class_transformer_1.plainToClass)(VehicleModelGetDTO, plain);
|
|
26
|
-
}
|
|
27
|
-
static toPlain(entity) {
|
|
28
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.VehicleModelGetDTO = VehicleModelGetDTO;
|
|
32
|
-
class VehicleModelGetUniqueDTO {
|
|
33
|
-
validate() {
|
|
34
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
35
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
36
|
-
}
|
|
37
|
-
static fromPlain(plain) {
|
|
38
|
-
return (0, class_transformer_1.plainToClass)(VehicleModelGetUniqueDTO, plain);
|
|
39
|
-
}
|
|
40
|
-
toPlain() {
|
|
41
|
-
return (0, class_transformer_1.instanceToPlain)(this);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.VehicleModelGetUniqueDTO = VehicleModelGetUniqueDTO;
|
|
45
|
-
class VehicleModelCreateDTO extends BaseDTO_1.BaseCreateDTO {
|
|
46
|
-
// NOTE:
|
|
47
|
-
// - We are not validating the slug field because it is automatically generated from the name field.
|
|
48
|
-
// - We cannot create a attach vehicles and models to a make during creation because the make should be created first and then the vehicles and models should be created and attached to the make.
|
|
49
|
-
validate() {
|
|
50
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
51
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
52
|
-
}
|
|
53
|
-
static fromPlain(plain) {
|
|
54
|
-
return (0, class_transformer_1.plainToClass)(VehicleModelCreateDTO, plain);
|
|
55
|
-
}
|
|
56
|
-
static toPlain(entity) {
|
|
57
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, class_validator_1.IsString)(),
|
|
62
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
63
|
-
(0, class_validator_1.IsDefined)(),
|
|
64
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
65
|
-
message: "Name can only contain letters, numbers, spaces, hyphens, and underscores.",
|
|
66
|
-
}),
|
|
67
|
-
__metadata("design:type", String)
|
|
68
|
-
], VehicleModelCreateDTO.prototype, "name", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
(0, class_validator_1.IsString)(),
|
|
71
|
-
(0, class_validator_1.IsOptional)(),
|
|
72
|
-
__metadata("design:type", String)
|
|
73
|
-
], VehicleModelCreateDTO.prototype, "image", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
(0, class_validator_1.IsString)(),
|
|
76
|
-
(0, class_validator_1.IsOptional)(),
|
|
77
|
-
__metadata("design:type", String)
|
|
78
|
-
], VehicleModelCreateDTO.prototype, "description", void 0);
|
|
79
|
-
__decorate([
|
|
80
|
-
(0, class_validator_1.IsString)(),
|
|
81
|
-
(0, class_validator_1.IsOptional)(),
|
|
82
|
-
__metadata("design:type", String)
|
|
83
|
-
], VehicleModelCreateDTO.prototype, "metaTitle", void 0);
|
|
84
|
-
__decorate([
|
|
85
|
-
(0, class_validator_1.IsString)(),
|
|
86
|
-
(0, class_validator_1.IsOptional)(),
|
|
87
|
-
__metadata("design:type", String)
|
|
88
|
-
], VehicleModelCreateDTO.prototype, "metaDescription", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
(0, class_validator_1.IsString)(),
|
|
91
|
-
(0, class_validator_1.IsOptional)(),
|
|
92
|
-
__metadata("design:type", String)
|
|
93
|
-
], VehicleModelCreateDTO.prototype, "metaKeywords", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, class_validator_1.ValidateNested)(),
|
|
96
|
-
(0, class_transformer_1.Type)(() => VehicleMake_1.VehicleMake) // This transforms each object in the array to the OtherDetailsDTO class
|
|
97
|
-
,
|
|
98
|
-
__metadata("design:type", VehicleMake_1.VehicleMake)
|
|
99
|
-
], VehicleModelCreateDTO.prototype, "make", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
102
|
-
(0, class_transformer_1.Type)(() => Vehicle_1.Vehicle) // This transforms each object in the array to the OtherDetailsDTO class
|
|
103
|
-
,
|
|
104
|
-
__metadata("design:type", Array)
|
|
105
|
-
], VehicleModelCreateDTO.prototype, "vehicles", void 0);
|
|
106
|
-
exports.VehicleModelCreateDTO = VehicleModelCreateDTO;
|
|
107
|
-
class VehicleModelUpdateDTO extends BaseDTO_1.BaseUpdateDTO {
|
|
108
|
-
validate() {
|
|
109
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
110
|
-
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
111
|
-
}
|
|
112
|
-
static fromPlain(plain) {
|
|
113
|
-
return (0, class_transformer_1.plainToClass)(VehicleModelUpdateDTO, plain);
|
|
114
|
-
}
|
|
115
|
-
static toPlain(entity) {
|
|
116
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
__decorate([
|
|
120
|
-
(0, class_validator_1.IsString)(),
|
|
121
|
-
(0, class_validator_1.IsOptional)(),
|
|
122
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
123
|
-
message: "Name can only contain letters, numbers, spaces, hyphens, and underscores.",
|
|
124
|
-
}),
|
|
125
|
-
__metadata("design:type", String)
|
|
126
|
-
], VehicleModelUpdateDTO.prototype, "name", void 0);
|
|
127
|
-
__decorate([
|
|
128
|
-
(0, class_validator_1.IsString)(),
|
|
129
|
-
(0, class_validator_1.IsOptional)(),
|
|
130
|
-
__metadata("design:type", String)
|
|
131
|
-
], VehicleModelUpdateDTO.prototype, "image", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
(0, class_validator_1.IsString)(),
|
|
134
|
-
(0, class_validator_1.IsOptional)(),
|
|
135
|
-
__metadata("design:type", String)
|
|
136
|
-
], VehicleModelUpdateDTO.prototype, "description", void 0);
|
|
137
|
-
__decorate([
|
|
138
|
-
(0, class_validator_1.IsString)(),
|
|
139
|
-
(0, class_validator_1.IsOptional)(),
|
|
140
|
-
__metadata("design:type", String)
|
|
141
|
-
], VehicleModelUpdateDTO.prototype, "metaTitle", void 0);
|
|
142
|
-
__decorate([
|
|
143
|
-
(0, class_validator_1.IsString)(),
|
|
144
|
-
(0, class_validator_1.IsOptional)(),
|
|
145
|
-
__metadata("design:type", String)
|
|
146
|
-
], VehicleModelUpdateDTO.prototype, "metaDescription", void 0);
|
|
147
|
-
__decorate([
|
|
148
|
-
(0, class_validator_1.IsString)(),
|
|
149
|
-
(0, class_validator_1.IsOptional)(),
|
|
150
|
-
__metadata("design:type", String)
|
|
151
|
-
], VehicleModelUpdateDTO.prototype, "metaKeywords", void 0);
|
|
152
|
-
__decorate([
|
|
153
|
-
(0, class_validator_1.IsBoolean)(),
|
|
154
|
-
(0, class_validator_1.IsOptional)(),
|
|
155
|
-
__metadata("design:type", Boolean)
|
|
156
|
-
], VehicleModelUpdateDTO.prototype, "isActive", void 0);
|
|
157
|
-
exports.VehicleModelUpdateDTO = VehicleModelUpdateDTO;
|
|
158
|
-
class DynamicModelDTO {
|
|
159
|
-
validate() {
|
|
160
|
-
if (!this.existingId && !this.new) {
|
|
161
|
-
throw new Error("Either existingId or new details must be provided.");
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
static fromPlain(plain) {
|
|
165
|
-
return (0, class_transformer_1.plainToClass)(DynamicModelDTO, plain);
|
|
166
|
-
}
|
|
167
|
-
static toPlain(entity) {
|
|
168
|
-
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
__decorate([
|
|
172
|
-
(0, class_validator_1.IsString)(),
|
|
173
|
-
(0, class_validator_1.IsOptional)(),
|
|
174
|
-
__metadata("design:type", String)
|
|
175
|
-
], DynamicModelDTO.prototype, "existingId", void 0);
|
|
176
|
-
__decorate([
|
|
177
|
-
(0, class_validator_1.ValidateNested)(),
|
|
178
|
-
(0, class_transformer_1.Type)(() => VehicleModelCreateDTO),
|
|
179
|
-
(0, class_validator_1.IsOptional)(),
|
|
180
|
-
__metadata("design:type", VehicleModelCreateDTO)
|
|
181
|
-
], DynamicModelDTO.prototype, "new", void 0);
|
|
182
|
-
exports.DynamicModelDTO = DynamicModelDTO;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// VehicleOrderDTO.ts
|
|
3
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
-
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;
|
|
7
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8
|
-
};
|
|
9
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.VehicleOrderUpdateDTO = exports.VehicleOrderCreateDTO = exports.VehicleOrderGetDTO = void 0;
|
|
14
|
-
const class_validator_1 = require("class-validator");
|
|
15
|
-
const class_transformer_1 = require("class-transformer");
|
|
16
|
-
class VehicleOrderGetDTO {
|
|
17
|
-
static fromEntity(entity) {
|
|
18
|
-
return (0, class_transformer_1.plainToClass)(VehicleOrderGetDTO, entity);
|
|
19
|
-
}
|
|
20
|
-
toPlain() {
|
|
21
|
-
return (0, class_transformer_1.classToPlain)(this);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, class_validator_1.IsString)(),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], VehicleOrderGetDTO.prototype, "id", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, class_validator_1.IsString)(),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], VehicleOrderGetDTO.prototype, "userId", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, class_validator_1.IsString)(),
|
|
34
|
-
__metadata("design:type", String)
|
|
35
|
-
], VehicleOrderGetDTO.prototype, "vehicleId", void 0);
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, class_validator_1.IsString)(),
|
|
38
|
-
__metadata("design:type", String)
|
|
39
|
-
], VehicleOrderGetDTO.prototype, "paymentId", void 0);
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, class_validator_1.IsNumber)(),
|
|
42
|
-
__metadata("design:type", Number)
|
|
43
|
-
], VehicleOrderGetDTO.prototype, "orderAmount", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, class_validator_1.IsString)(),
|
|
46
|
-
__metadata("design:type", String)
|
|
47
|
-
], VehicleOrderGetDTO.prototype, "reservationComment", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, class_validator_1.IsString)(),
|
|
50
|
-
__metadata("design:type", String)
|
|
51
|
-
], VehicleOrderGetDTO.prototype, "cancellationComment", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, class_validator_1.IsString)(),
|
|
54
|
-
__metadata("design:type", String)
|
|
55
|
-
], VehicleOrderGetDTO.prototype, "status", void 0);
|
|
56
|
-
exports.VehicleOrderGetDTO = VehicleOrderGetDTO;
|
|
57
|
-
class VehicleOrderCreateDTO {
|
|
58
|
-
validate() {
|
|
59
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
60
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
61
|
-
}
|
|
62
|
-
static fromPlain(plain) {
|
|
63
|
-
return (0, class_transformer_1.plainToClass)(VehicleOrderCreateDTO, plain);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, class_validator_1.IsString)(),
|
|
68
|
-
__metadata("design:type", String)
|
|
69
|
-
], VehicleOrderCreateDTO.prototype, "userId", void 0);
|
|
70
|
-
__decorate([
|
|
71
|
-
(0, class_validator_1.IsString)(),
|
|
72
|
-
__metadata("design:type", String)
|
|
73
|
-
], VehicleOrderCreateDTO.prototype, "vehicleId", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
(0, class_validator_1.IsString)(),
|
|
76
|
-
__metadata("design:type", String)
|
|
77
|
-
], VehicleOrderCreateDTO.prototype, "paymentId", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
(0, class_validator_1.IsNumber)(),
|
|
80
|
-
__metadata("design:type", Number)
|
|
81
|
-
], VehicleOrderCreateDTO.prototype, "orderAmount", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, class_validator_1.IsString)(),
|
|
84
|
-
__metadata("design:type", String)
|
|
85
|
-
], VehicleOrderCreateDTO.prototype, "reservationComment", void 0);
|
|
86
|
-
__decorate([
|
|
87
|
-
(0, class_validator_1.IsString)(),
|
|
88
|
-
__metadata("design:type", String)
|
|
89
|
-
], VehicleOrderCreateDTO.prototype, "cancellationComment", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
(0, class_validator_1.IsString)(),
|
|
92
|
-
__metadata("design:type", String)
|
|
93
|
-
], VehicleOrderCreateDTO.prototype, "status", void 0);
|
|
94
|
-
exports.VehicleOrderCreateDTO = VehicleOrderCreateDTO;
|
|
95
|
-
class VehicleOrderUpdateDTO {
|
|
96
|
-
validate() {
|
|
97
|
-
const errors = (0, class_validator_1.validateSync)(this);
|
|
98
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
99
|
-
}
|
|
100
|
-
static fromPlain(plain) {
|
|
101
|
-
return (0, class_transformer_1.plainToClass)(VehicleOrderUpdateDTO, plain);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
__decorate([
|
|
105
|
-
(0, class_validator_1.IsOptional)(),
|
|
106
|
-
(0, class_validator_1.IsString)(),
|
|
107
|
-
__metadata("design:type", String)
|
|
108
|
-
], VehicleOrderUpdateDTO.prototype, "userId", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
(0, class_validator_1.IsOptional)(),
|
|
111
|
-
(0, class_validator_1.IsString)(),
|
|
112
|
-
__metadata("design:type", String)
|
|
113
|
-
], VehicleOrderUpdateDTO.prototype, "vehicleId", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
(0, class_validator_1.IsOptional)(),
|
|
116
|
-
(0, class_validator_1.IsString)(),
|
|
117
|
-
__metadata("design:type", String)
|
|
118
|
-
], VehicleOrderUpdateDTO.prototype, "paymentId", void 0);
|
|
119
|
-
__decorate([
|
|
120
|
-
(0, class_validator_1.IsOptional)(),
|
|
121
|
-
(0, class_validator_1.IsNumber)(),
|
|
122
|
-
__metadata("design:type", Number)
|
|
123
|
-
], VehicleOrderUpdateDTO.prototype, "orderAmount", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
(0, class_validator_1.IsOptional)(),
|
|
126
|
-
(0, class_validator_1.IsString)(),
|
|
127
|
-
__metadata("design:type", String)
|
|
128
|
-
], VehicleOrderUpdateDTO.prototype, "reservationComment", void 0);
|
|
129
|
-
__decorate([
|
|
130
|
-
(0, class_validator_1.IsOptional)(),
|
|
131
|
-
(0, class_validator_1.IsString)(),
|
|
132
|
-
__metadata("design:type", String)
|
|
133
|
-
], VehicleOrderUpdateDTO.prototype, "cancellationComment", void 0);
|
|
134
|
-
__decorate([
|
|
135
|
-
(0, class_validator_1.IsOptional)(),
|
|
136
|
-
(0, class_validator_1.IsString)(),
|
|
137
|
-
__metadata("design:type", String)
|
|
138
|
-
], VehicleOrderUpdateDTO.prototype, "status", void 0);
|
|
139
|
-
exports.VehicleOrderUpdateDTO = VehicleOrderUpdateDTO;
|