@alba-cars/common-modules 1.2.6 → 1.2.8
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/core/error-handling/errorHandler.d.ts +1 -1
- package/dist/core/error-handling/errorHandler.js +36 -10
- package/dist/core/models/index.d.ts +1 -0
- package/dist/core/models/index.js +1 -0
- package/dist/core/models/media/index.d.ts +1 -0
- package/dist/core/models/media/index.js +17 -0
- package/dist/core/models/media/media_data.d.ts +4 -0
- package/dist/core/models/media/media_data.js +2 -0
- package/dist/core/network/endpoint-config.d.ts +8 -1
- package/dist/core/network/endpoint-config.js +55 -6
- package/dist/core/network/fetch-api.js +24 -20
- package/dist/core/network/index.d.ts +0 -1
- package/dist/core/network/index.js +0 -1
- package/dist/core/network/react-query.d.ts +3 -9
- package/dist/core/utils/global_validators.d.ts +2 -0
- package/dist/core/utils/global_validators.js +20 -0
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/core/utils/index.js +1 -0
- package/dist/features/finance-eligibilty-request/data/dto/FinanceEligibilityRequestDTO.d.ts +92 -0
- package/dist/features/finance-eligibilty-request/data/dto/FinanceEligibilityRequestDTO.js +286 -0
- package/dist/features/finance-eligibilty-request/data/index.d.ts +1 -0
- package/dist/features/finance-eligibilty-request/data/index.js +17 -0
- package/dist/features/finance-eligibilty-request/index.d.ts +1 -0
- package/dist/features/finance-eligibilty-request/index.js +17 -0
- package/dist/features/index.d.ts +7 -5
- package/dist/features/index.js +2 -0
- package/dist/features/sales-team/index.d.ts +0 -1
- package/dist/features/sales-team/index.js +0 -1
- package/dist/features/sell-call-request/data/dto/SellCarRequestDTO.d.ts +134 -0
- package/dist/features/sell-call-request/data/dto/SellCarRequestDTO.js +394 -0
- package/dist/features/sell-call-request/data/index.d.ts +1 -0
- package/dist/features/sell-call-request/data/index.js +17 -0
- package/dist/features/sell-call-request/index.d.ts +1 -0
- package/dist/features/sell-call-request/index.js +17 -0
- package/dist/features/showroom-visit/data/dto/ShowroomVisit.d.ts +27 -2
- package/dist/features/showroom-visit/data/dto/ShowroomVisit.js +86 -5
- package/dist/features/test-drive-request/data/dto/TestDriveRequestDTO.d.ts +9 -6
- package/dist/features/test-drive-request/data/dto/TestDriveRequestDTO.js +16 -3
- package/dist/features/vehicle/data/dto/MediaDTO.d.ts +5 -0
- package/dist/features/vehicle/data/dto/MediaDTO.js +2 -0
- package/dist/features/vehicle/data/dto/VehicleCategoryDTO.d.ts +39 -0
- package/dist/features/vehicle/data/dto/VehicleCategoryDTO.js +114 -0
- package/dist/features/vehicle/data/dto/VehicleDTO.d.ts +16 -8
- package/dist/features/vehicle/data/dto/VehicleDTO.js +43 -6
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.d.ts +230 -0
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.js +705 -0
- package/dist/features/vehicle/data/dto/VehicleFinanceDTO.d.ts +23 -12
- package/dist/features/vehicle/data/dto/VehicleFinanceDTO.js +41 -1
- package/dist/features/vehicle/data/dto/VehicleInspectionDTO.d.ts +147 -0
- package/dist/features/vehicle/data/dto/VehicleInspectionDTO.js +765 -0
- package/dist/features/vehicle/data/dto/VehicleMedia.d.ts +14 -0
- package/dist/features/vehicle/data/dto/VehicleMedia.js +29 -4
- package/dist/features/vehicle/data/dto/VehicleModelDTO.d.ts +5 -5
- package/dist/features/vehicle/data/dto/VehicleModelDTO.js +7 -7
- package/dist/features/vehicle/data/dto/VehicleTypeDTO.d.ts +1 -1
- package/dist/features/vehicle/data/dto/VehicleTypeDTO.js +1 -1
- package/dist/features/vehicle/data/dto/index.d.ts +5 -0
- package/dist/features/vehicle/data/dto/index.js +5 -0
- package/dist/features/vehicle/data/index.d.ts +0 -1
- package/dist/features/vehicle/data/index.js +1 -1
- package/dist/features/vehicle/data/models/VehicleFeature.d.ts +1 -0
- package/dist/features/vehicle/data/models/VehicleFeatureCategory.d.ts +1 -0
- package/dist/features/vehicle/data/models/VehicleFinance.d.ts +3 -0
- package/dist/features/vehicle/data/utilities.d.ts +32 -6
- package/dist/features/vehicle/data/utilities.js +1222 -19
- package/dist/features/vehicle/index.d.ts +0 -1
- package/dist/features/vehicle/index.js +0 -1
- package/dist/global/utilities.d.ts +4 -0
- package/dist/global/utilities.js +3 -1
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.VehicleOptions = exports.VehicleUniqueFilter = exports.VehicleFilter = exports.VehicleFeatureCategoryOptions = exports.VehicleFeatureCategoryUniqueFilter = exports.VehicleFeatureCategoryFilter = exports.VehicleFeatureOptions = exports.VehicleFeatureUniqueFilter = exports.VehicleFeatureFilter = exports.VehicleBodyTypeOptions = exports.VehicleBodyTypeUniqueFilter = exports.VehicleBodyTypeFilter = exports.VehicleModelOptions = exports.VehicleModelUniqueFilter = exports.VehicleModelFilter = exports.VehicleMakeOptions = exports.VehicleMakeUniqueFilter = exports.VehicleMakeFilter = void 0;
|
|
12
|
+
exports.VehicleCategoryOptions = exports.VehicleCategoryUniqueFilter = exports.VehicleCategoryFilter = exports.VehicleOptions = exports.VehicleUniqueFilter = exports.VehicleFilter = exports.VehicleFeatureCategoryOptions = exports.VehicleFeatureCategoryUniqueFilter = exports.VehicleFeatureCategoryFilter = exports.VehicleFeatureOptions = exports.VehicleFeatureUniqueFilter = exports.VehicleFeatureFilter = exports.VehicleBodyTypeOptions = exports.VehicleBodyTypeUniqueFilter = exports.VehicleBodyTypeFilter = exports.VehicleModelOptions = exports.VehicleModelUniqueFilter = exports.VehicleModelFilter = exports.VehicleMakeOptions = exports.VehicleMakeUniqueFilter = exports.VehicleMakeFilter = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const utilities_1 = require("../../../global/utilities");
|
|
@@ -93,7 +93,7 @@ const utilities_1 = require("../../../global/utilities");
|
|
|
93
93
|
class VehicleMakeFilter extends utilities_1.BaseFilter {
|
|
94
94
|
validate() {
|
|
95
95
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
96
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
96
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
97
97
|
}
|
|
98
98
|
static fromPlain(plain) {
|
|
99
99
|
return (0, class_transformer_1.plainToClass)(VehicleMakeFilter, plain);
|
|
@@ -142,7 +142,7 @@ exports.VehicleMakeFilter = VehicleMakeFilter;
|
|
|
142
142
|
class VehicleMakeUniqueFilter extends utilities_1.BaseFilter {
|
|
143
143
|
validate() {
|
|
144
144
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
145
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
145
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
146
146
|
}
|
|
147
147
|
static fromPlain(plain) {
|
|
148
148
|
return (0, class_transformer_1.plainToClass)(VehicleMakeFilter, plain);
|
|
@@ -170,7 +170,7 @@ exports.VehicleMakeUniqueFilter = VehicleMakeUniqueFilter;
|
|
|
170
170
|
class VehicleMakeOptions extends utilities_1.PaginationOptions {
|
|
171
171
|
validate() {
|
|
172
172
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
173
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
173
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
174
174
|
}
|
|
175
175
|
static fromPlain(plain) {
|
|
176
176
|
return (0, class_transformer_1.plainToClass)(VehicleMakeOptions, plain);
|
|
@@ -184,7 +184,7 @@ exports.VehicleMakeOptions = VehicleMakeOptions;
|
|
|
184
184
|
class VehicleModelFilter extends utilities_1.BaseFilter {
|
|
185
185
|
validate() {
|
|
186
186
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
187
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
187
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
188
188
|
}
|
|
189
189
|
static fromPlain(plain) {
|
|
190
190
|
return (0, class_transformer_1.plainToClass)(VehicleModelFilter, plain);
|
|
@@ -227,7 +227,7 @@ exports.VehicleModelFilter = VehicleModelFilter;
|
|
|
227
227
|
class VehicleModelUniqueFilter extends utilities_1.BaseFilter {
|
|
228
228
|
validate() {
|
|
229
229
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
230
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
230
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
231
231
|
}
|
|
232
232
|
static fromPlain(plain) {
|
|
233
233
|
return (0, class_transformer_1.plainToClass)(VehicleModelUniqueFilter, plain);
|
|
@@ -255,7 +255,7 @@ exports.VehicleModelUniqueFilter = VehicleModelUniqueFilter;
|
|
|
255
255
|
class VehicleModelOptions extends utilities_1.PaginationOptions {
|
|
256
256
|
validate() {
|
|
257
257
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
258
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
258
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
259
259
|
}
|
|
260
260
|
static fromPlain(plain) {
|
|
261
261
|
return (0, class_transformer_1.plainToClass)(VehicleModelOptions, plain);
|
|
@@ -269,7 +269,7 @@ exports.VehicleModelOptions = VehicleModelOptions;
|
|
|
269
269
|
class VehicleBodyTypeFilter extends utilities_1.BaseFilter {
|
|
270
270
|
validate() {
|
|
271
271
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
272
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
272
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
273
273
|
}
|
|
274
274
|
static fromPlain(plain) {
|
|
275
275
|
return (0, class_transformer_1.plainToClass)(VehicleModelFilter, plain);
|
|
@@ -312,7 +312,7 @@ exports.VehicleBodyTypeFilter = VehicleBodyTypeFilter;
|
|
|
312
312
|
class VehicleBodyTypeUniqueFilter {
|
|
313
313
|
validate() {
|
|
314
314
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
315
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
315
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
316
316
|
}
|
|
317
317
|
static fromPlain(plain) {
|
|
318
318
|
return (0, class_transformer_1.plainToClass)(VehicleModelFilter, plain);
|
|
@@ -340,7 +340,7 @@ exports.VehicleBodyTypeUniqueFilter = VehicleBodyTypeUniqueFilter;
|
|
|
340
340
|
class VehicleBodyTypeOptions extends utilities_1.PaginationOptions {
|
|
341
341
|
validate() {
|
|
342
342
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
343
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
343
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
344
344
|
}
|
|
345
345
|
static fromPlain(plain) {
|
|
346
346
|
return (0, class_transformer_1.plainToClass)(VehicleModelOptions, plain);
|
|
@@ -354,7 +354,7 @@ exports.VehicleBodyTypeOptions = VehicleBodyTypeOptions;
|
|
|
354
354
|
class VehicleFeatureFilter extends utilities_1.BaseFilter {
|
|
355
355
|
validate() {
|
|
356
356
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
357
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
357
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
358
358
|
}
|
|
359
359
|
static fromPlain(plain) {
|
|
360
360
|
return (0, class_transformer_1.plainToClass)(VehicleModelFilter, plain);
|
|
@@ -392,7 +392,7 @@ exports.VehicleFeatureFilter = VehicleFeatureFilter;
|
|
|
392
392
|
class VehicleFeatureUniqueFilter {
|
|
393
393
|
validate() {
|
|
394
394
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
395
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
395
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
396
396
|
}
|
|
397
397
|
static fromPlain(plain) {
|
|
398
398
|
return (0, class_transformer_1.plainToClass)(VehicleModelFilter, plain);
|
|
@@ -420,7 +420,7 @@ exports.VehicleFeatureUniqueFilter = VehicleFeatureUniqueFilter;
|
|
|
420
420
|
class VehicleFeatureOptions extends utilities_1.PaginationOptions {
|
|
421
421
|
validate() {
|
|
422
422
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
423
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
423
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
424
424
|
}
|
|
425
425
|
static fromPlain(plain) {
|
|
426
426
|
return (0, class_transformer_1.plainToClass)(VehicleFeatureOptions, plain);
|
|
@@ -434,7 +434,7 @@ exports.VehicleFeatureOptions = VehicleFeatureOptions;
|
|
|
434
434
|
class VehicleFeatureCategoryFilter extends utilities_1.BaseFilter {
|
|
435
435
|
validate() {
|
|
436
436
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
437
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
437
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
438
438
|
}
|
|
439
439
|
static fromPlain(plain) {
|
|
440
440
|
return (0, class_transformer_1.plainToClass)(VehicleModelFilter, plain);
|
|
@@ -472,7 +472,7 @@ exports.VehicleFeatureCategoryFilter = VehicleFeatureCategoryFilter;
|
|
|
472
472
|
class VehicleFeatureCategoryUniqueFilter {
|
|
473
473
|
validate() {
|
|
474
474
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
475
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
475
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
476
476
|
}
|
|
477
477
|
static fromPlain(plain) {
|
|
478
478
|
return (0, class_transformer_1.plainToClass)(VehicleModelFilter, plain);
|
|
@@ -500,7 +500,7 @@ exports.VehicleFeatureCategoryUniqueFilter = VehicleFeatureCategoryUniqueFilter;
|
|
|
500
500
|
class VehicleFeatureCategoryOptions extends utilities_1.PaginationOptions {
|
|
501
501
|
validate() {
|
|
502
502
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
503
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
503
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
504
504
|
}
|
|
505
505
|
static fromPlain(plain) {
|
|
506
506
|
return (0, class_transformer_1.plainToClass)(VehicleFeatureOptions, plain);
|
|
@@ -520,7 +520,9 @@ class VehicleFilter extends utilities_1.BaseFilter {
|
|
|
520
520
|
return [];
|
|
521
521
|
}
|
|
522
522
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
523
|
-
return errors
|
|
523
|
+
return errors
|
|
524
|
+
.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); })
|
|
525
|
+
.flat();
|
|
524
526
|
};
|
|
525
527
|
}
|
|
526
528
|
}
|
|
@@ -669,7 +671,7 @@ exports.VehicleFilter = VehicleFilter;
|
|
|
669
671
|
class VehicleUniqueFilter {
|
|
670
672
|
validate() {
|
|
671
673
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
672
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
674
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
673
675
|
}
|
|
674
676
|
static fromPlain(plain) {
|
|
675
677
|
return (0, class_transformer_1.plainToClass)(VehicleUniqueFilter, plain);
|
|
@@ -708,7 +710,9 @@ class VehicleOptions extends utilities_1.PaginationOptions {
|
|
|
708
710
|
return [];
|
|
709
711
|
}
|
|
710
712
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
711
|
-
return errors
|
|
713
|
+
return errors
|
|
714
|
+
.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); })
|
|
715
|
+
.flat();
|
|
712
716
|
};
|
|
713
717
|
}
|
|
714
718
|
}
|
|
@@ -720,3 +724,1202 @@ class VehicleOptions extends utilities_1.PaginationOptions {
|
|
|
720
724
|
}
|
|
721
725
|
}
|
|
722
726
|
exports.VehicleOptions = VehicleOptions;
|
|
727
|
+
// export type VehicleMakeSelectFields = keyof VehicleMake;
|
|
728
|
+
// export type VehicleModelSelectFields = keyof VehicleModel;
|
|
729
|
+
// export type VehicleSelectFields = keyof Vehicle;
|
|
730
|
+
// export type VehicleBodyTypeSelectFields = keyof VehicleBodyType;
|
|
731
|
+
// export type VehicleFeatureSelectFields = keyof VehicleFeature;
|
|
732
|
+
// export type VehicleCategorySelectFields = keyof VehicleCategory;
|
|
733
|
+
// export type VehicleFeatureCategorySelectFields = keyof VehicleFeatureCategory;
|
|
734
|
+
// export type VehicleMetaDataSelectFields = keyof VehicleMetaData;
|
|
735
|
+
// // -----------------------------------------------------CAR MAKE-------------------------------------------------------------------------
|
|
736
|
+
// export class VehicleMakeFilter extends BaseFilter {
|
|
737
|
+
// @IsOptional()
|
|
738
|
+
// @IsString({ each: true })
|
|
739
|
+
// id?: string | string[];
|
|
740
|
+
// @IsOptional()
|
|
741
|
+
// @IsString({ each: true })
|
|
742
|
+
// slug?: string | string[];
|
|
743
|
+
// @IsOptional()
|
|
744
|
+
// @IsString()
|
|
745
|
+
// name?: string;
|
|
746
|
+
// @IsOptional()
|
|
747
|
+
// @IsString({ each: true })
|
|
748
|
+
// metaKeywords?: string;
|
|
749
|
+
// @IsOptional()
|
|
750
|
+
// @IsString({ each: true })
|
|
751
|
+
// models?: string | string[]; // A list of model ids and/or names
|
|
752
|
+
// @IsOptional()
|
|
753
|
+
// @IsString({ each: true })
|
|
754
|
+
// vehicles?: string | string[]; // A list of vehicle ids and/or names
|
|
755
|
+
// @IsOptional()
|
|
756
|
+
// @IsString()
|
|
757
|
+
// search?: string; // A search string
|
|
758
|
+
// validate(): string[] {
|
|
759
|
+
// const errors = validateSync(this);
|
|
760
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
761
|
+
// }
|
|
762
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleMakeFilter {
|
|
763
|
+
// return plainToClass(VehicleMakeFilter, plain);
|
|
764
|
+
// }
|
|
765
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
766
|
+
// return instanceToPlain(entity);
|
|
767
|
+
// }
|
|
768
|
+
// }
|
|
769
|
+
// // This filter is used to get a unique vehicle make by unique fields
|
|
770
|
+
// export class VehicleMakeUniqueFilter extends BaseFilter {
|
|
771
|
+
// @IsOptional()
|
|
772
|
+
// @IsString()
|
|
773
|
+
// id?: string;
|
|
774
|
+
// @IsOptional()
|
|
775
|
+
// @IsString()
|
|
776
|
+
// slug?: string;
|
|
777
|
+
// @IsOptional()
|
|
778
|
+
// @IsString()
|
|
779
|
+
// name?: string;
|
|
780
|
+
// validate(): string[] {
|
|
781
|
+
// const errors = validateSync(this);
|
|
782
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
783
|
+
// }
|
|
784
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleMakeFilter {
|
|
785
|
+
// return plainToClass(VehicleMakeFilter, plain);
|
|
786
|
+
// }
|
|
787
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
788
|
+
// return instanceToPlain(entity);
|
|
789
|
+
// }
|
|
790
|
+
// }
|
|
791
|
+
// export type VehicleMakeSort = Record<
|
|
792
|
+
// keyof Pick<VehicleMake, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
793
|
+
// "asc" | "desc"
|
|
794
|
+
// >;
|
|
795
|
+
// export class VehicleMakeOptions extends PaginationOptions {
|
|
796
|
+
// sort?: VehicleMakeSort;
|
|
797
|
+
// withModels?: boolean;
|
|
798
|
+
// withVehicles?: boolean;
|
|
799
|
+
// select?: (VehicleMakeSelectFields | `models.${VehicleModelSelectFields}` | `vehicles.${VehicleSelectFields}`)[];
|
|
800
|
+
// validate(): string[] {
|
|
801
|
+
// const errors = validateSync(this);
|
|
802
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
803
|
+
// }
|
|
804
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleMakeOptions {
|
|
805
|
+
// return plainToClass(VehicleMakeOptions, plain);
|
|
806
|
+
// }
|
|
807
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
808
|
+
// return instanceToPlain(entity);
|
|
809
|
+
// }
|
|
810
|
+
// }
|
|
811
|
+
// // -----------------------------------------------------CAR MODEL-------------------------------------------------------------------------
|
|
812
|
+
// export class VehicleModelFilter extends BaseFilter {
|
|
813
|
+
// @IsOptional()
|
|
814
|
+
// @IsString({ each: true })
|
|
815
|
+
// id?: string | string[];
|
|
816
|
+
// @IsOptional()
|
|
817
|
+
// @IsString({ each: true })
|
|
818
|
+
// slug?: string | string[];
|
|
819
|
+
// @IsOptional()
|
|
820
|
+
// @IsString()
|
|
821
|
+
// name?: string;
|
|
822
|
+
// @IsOptional()
|
|
823
|
+
// @IsString({ each: true })
|
|
824
|
+
// metaKeywords?: string;
|
|
825
|
+
// @IsOptional()
|
|
826
|
+
// @IsString({ each: true })
|
|
827
|
+
// makes?: string | string[]; // A list of make ids and/or names
|
|
828
|
+
// @IsOptional()
|
|
829
|
+
// @IsString({ each: true })
|
|
830
|
+
// vehicles?: string | string[]; // A list of vehicle ids and/or names
|
|
831
|
+
// search?: string; // A search string
|
|
832
|
+
// validate(): string[] {
|
|
833
|
+
// const errors = validateSync(this);
|
|
834
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
835
|
+
// }
|
|
836
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
837
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
838
|
+
// }
|
|
839
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
840
|
+
// return instanceToPlain(entity);
|
|
841
|
+
// }
|
|
842
|
+
// }
|
|
843
|
+
// export class VehicleModelUniqueFilter extends BaseFilter {
|
|
844
|
+
// @IsOptional()
|
|
845
|
+
// @IsString()
|
|
846
|
+
// id?: string;
|
|
847
|
+
// @IsOptional()
|
|
848
|
+
// @IsString()
|
|
849
|
+
// slug?: string;
|
|
850
|
+
// @IsOptional()
|
|
851
|
+
// @IsString()
|
|
852
|
+
// name?: string;
|
|
853
|
+
// validate(): string[] {
|
|
854
|
+
// const errors = validateSync(this);
|
|
855
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
856
|
+
// }
|
|
857
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelUniqueFilter {
|
|
858
|
+
// return plainToClass(VehicleModelUniqueFilter, plain);
|
|
859
|
+
// }
|
|
860
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
861
|
+
// return instanceToPlain(entity);
|
|
862
|
+
// }
|
|
863
|
+
// }
|
|
864
|
+
// export type VehicleModelSort = Record<
|
|
865
|
+
// keyof Pick<VehicleModel, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
866
|
+
// "asc" | "desc"
|
|
867
|
+
// >;
|
|
868
|
+
// export class VehicleModelOptions extends PaginationOptions {
|
|
869
|
+
// sort?: VehicleModelSort;
|
|
870
|
+
// withVehicles?: boolean;
|
|
871
|
+
// withMake?: boolean;
|
|
872
|
+
// select?: (VehicleModelSelectFields | `vehicles.${VehicleSelectFields}` | `make.${VehicleMakeSelectFields}`)[];
|
|
873
|
+
// validate(): string[] {
|
|
874
|
+
// const errors = validateSync(this);
|
|
875
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
876
|
+
// }
|
|
877
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelOptions {
|
|
878
|
+
// return plainToClass(VehicleModelOptions, plain);
|
|
879
|
+
// }
|
|
880
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
881
|
+
// return instanceToPlain(entity);
|
|
882
|
+
// }
|
|
883
|
+
// }
|
|
884
|
+
// // -----------------------------------------------------CAR BODY TYPE----------------------------------------------------------------
|
|
885
|
+
// export class VehicleBodyTypeFilter extends BaseFilter {
|
|
886
|
+
// @IsOptional()
|
|
887
|
+
// @IsString({ each: true })
|
|
888
|
+
// id?: string | string[];
|
|
889
|
+
// @IsOptional()
|
|
890
|
+
// @IsString({ each: true })
|
|
891
|
+
// slug?: string | string[];
|
|
892
|
+
// @IsOptional()
|
|
893
|
+
// @IsString()
|
|
894
|
+
// name?: string;
|
|
895
|
+
// @IsOptional()
|
|
896
|
+
// @IsString({ each: true })
|
|
897
|
+
// vehicles?: string | string[]; // A list of vehicle ids and/or names
|
|
898
|
+
// @IsOptional()
|
|
899
|
+
// @IsString({ each: true })
|
|
900
|
+
// models?: string | string[]; // A list of model ids and/or names
|
|
901
|
+
// @IsOptional()
|
|
902
|
+
// @IsString()
|
|
903
|
+
// search?: string; // A search string
|
|
904
|
+
// validate(): string[] {
|
|
905
|
+
// const errors = validateSync(this);
|
|
906
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
907
|
+
// }
|
|
908
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
909
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
910
|
+
// }
|
|
911
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
912
|
+
// return instanceToPlain(entity);
|
|
913
|
+
// }
|
|
914
|
+
// }
|
|
915
|
+
// export class VehicleBodyTypeUniqueFilter {
|
|
916
|
+
// @IsOptional()
|
|
917
|
+
// @IsString()
|
|
918
|
+
// id?: string;
|
|
919
|
+
// @IsOptional()
|
|
920
|
+
// @IsString()
|
|
921
|
+
// slug?: string;
|
|
922
|
+
// @IsOptional()
|
|
923
|
+
// @IsString()
|
|
924
|
+
// name?: string;
|
|
925
|
+
// validate(): string[] {
|
|
926
|
+
// const errors = validateSync(this);
|
|
927
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
928
|
+
// }
|
|
929
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
930
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
931
|
+
// }
|
|
932
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
933
|
+
// return instanceToPlain(entity);
|
|
934
|
+
// }
|
|
935
|
+
// }
|
|
936
|
+
// export type VehicleBodyTypeSort = Record<
|
|
937
|
+
// keyof Pick<VehicleBodyType, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
938
|
+
// "asc" | "desc"
|
|
939
|
+
// >;
|
|
940
|
+
// export class VehicleBodyTypeOptions extends PaginationOptions {
|
|
941
|
+
// sort?: VehicleBodyTypeSort;
|
|
942
|
+
// withVehicles?: boolean;
|
|
943
|
+
// select?: (VehicleBodyTypeSelectFields | `vehicles.${VehicleSelectFields}` | `models.${VehicleModelSelectFields}`)[];
|
|
944
|
+
// validate(): string[] {
|
|
945
|
+
// const errors = validateSync(this);
|
|
946
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
947
|
+
// }
|
|
948
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelOptions {
|
|
949
|
+
// return plainToClass(VehicleModelOptions, plain);
|
|
950
|
+
// }
|
|
951
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
952
|
+
// return instanceToPlain(entity);
|
|
953
|
+
// }
|
|
954
|
+
// }
|
|
955
|
+
// // -----------------------------------------------------CAR FEATURE----------------------------------------------------------------
|
|
956
|
+
// export class VehicleFeatureFilter extends BaseFilter {
|
|
957
|
+
// @IsOptional()
|
|
958
|
+
// @IsString({ each: true })
|
|
959
|
+
// id?: string | string[];
|
|
960
|
+
// @IsOptional()
|
|
961
|
+
// @IsString({ each: true })
|
|
962
|
+
// slug?: string | string[];
|
|
963
|
+
// @IsOptional()
|
|
964
|
+
// @IsString()
|
|
965
|
+
// name?: string;
|
|
966
|
+
// @IsOptional()
|
|
967
|
+
// @IsString({ each: true })
|
|
968
|
+
// categories?: string | string[]; // A list of vehicle ids and/or names
|
|
969
|
+
// @IsOptional()
|
|
970
|
+
// @IsString()
|
|
971
|
+
// search?: string; // A search string
|
|
972
|
+
// validate(): string[] {
|
|
973
|
+
// const errors = validateSync(this);
|
|
974
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
975
|
+
// }
|
|
976
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
977
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
978
|
+
// }
|
|
979
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
980
|
+
// return instanceToPlain(entity);
|
|
981
|
+
// }
|
|
982
|
+
// }
|
|
983
|
+
// export class VehicleFeatureUniqueFilter {
|
|
984
|
+
// @IsOptional()
|
|
985
|
+
// @IsString()
|
|
986
|
+
// id?: string;
|
|
987
|
+
// @IsOptional()
|
|
988
|
+
// @IsString()
|
|
989
|
+
// slug?: string;
|
|
990
|
+
// @IsOptional()
|
|
991
|
+
// @IsString()
|
|
992
|
+
// name?: string;
|
|
993
|
+
// validate(): string[] {
|
|
994
|
+
// const errors = validateSync(this);
|
|
995
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
996
|
+
// }
|
|
997
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
998
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
999
|
+
// }
|
|
1000
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1001
|
+
// return instanceToPlain(entity);
|
|
1002
|
+
// }
|
|
1003
|
+
// }
|
|
1004
|
+
// export type VehicleFeatureSort = Record<
|
|
1005
|
+
// keyof Pick<VehicleFeature, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
1006
|
+
// "asc" | "desc"
|
|
1007
|
+
// >;
|
|
1008
|
+
// export class VehicleFeatureOptions extends PaginationOptions {
|
|
1009
|
+
// sort?: VehicleFeatureSort;
|
|
1010
|
+
// withCategories?: boolean;
|
|
1011
|
+
// select?: (VehicleFeatureSelectFields | `categories.${VehicleCategorySelectFields}`)[];
|
|
1012
|
+
// validate(): string[] {
|
|
1013
|
+
// const errors = validateSync(this);
|
|
1014
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1015
|
+
// }
|
|
1016
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFeatureOptions {
|
|
1017
|
+
// return plainToClass(VehicleFeatureOptions, plain);
|
|
1018
|
+
// }
|
|
1019
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1020
|
+
// return instanceToPlain(entity);
|
|
1021
|
+
// }
|
|
1022
|
+
// }
|
|
1023
|
+
// -----------------------------------------------------CAR FEATURE CATEGORY----------------------------------------------------------------
|
|
1024
|
+
// export class VehicleFeatureCategoryFilter extends BaseFilter {
|
|
1025
|
+
// @IsOptional()
|
|
1026
|
+
// @IsString({ each: true })
|
|
1027
|
+
// id?: string | string[];
|
|
1028
|
+
// @IsOptional()
|
|
1029
|
+
// @IsString({ each: true })
|
|
1030
|
+
// slug?: string | string[];
|
|
1031
|
+
// @IsOptional()
|
|
1032
|
+
// @IsString()
|
|
1033
|
+
// name?: string;
|
|
1034
|
+
// @IsOptional()
|
|
1035
|
+
// @IsString({ each: true })
|
|
1036
|
+
// features?: string | string[]; // A list of vehicle ids and/or names
|
|
1037
|
+
// @IsOptional()
|
|
1038
|
+
// @IsString()
|
|
1039
|
+
// search?: string; // A search string
|
|
1040
|
+
// validate(): string[] {
|
|
1041
|
+
// const errors = validateSync(this);
|
|
1042
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1043
|
+
// }
|
|
1044
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFeatureCategoryFilter {
|
|
1045
|
+
// return plainToClass(VehicleFeatureCategoryFilter, plain);
|
|
1046
|
+
// }
|
|
1047
|
+
// static toPlain(entity: VehicleFeatureCategoryFilter): Record<string, unknown> {
|
|
1048
|
+
// return instanceToPlain(entity);
|
|
1049
|
+
// }
|
|
1050
|
+
// }
|
|
1051
|
+
// export class VehicleFeatureCategoryUniqueFilter {
|
|
1052
|
+
// @IsOptional()
|
|
1053
|
+
// @IsString()
|
|
1054
|
+
// id?: string;
|
|
1055
|
+
// @IsOptional()
|
|
1056
|
+
// @IsString()
|
|
1057
|
+
// slug?: string;
|
|
1058
|
+
// @IsOptional()
|
|
1059
|
+
// @IsString()
|
|
1060
|
+
// name?: string;
|
|
1061
|
+
// validate(): string[] {
|
|
1062
|
+
// const errors = validateSync(this);
|
|
1063
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1064
|
+
// }
|
|
1065
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFeatureCategoryUniqueFilter {
|
|
1066
|
+
// return plainToClass(VehicleFeatureCategoryUniqueFilter, plain);
|
|
1067
|
+
// }
|
|
1068
|
+
// static toPlain(entity: VehicleFeatureCategoryUniqueFilter): Record<string, unknown> {
|
|
1069
|
+
// return instanceToPlain(entity);
|
|
1070
|
+
// }
|
|
1071
|
+
// }
|
|
1072
|
+
// export type VehicleFeatureCategorySort = Record<
|
|
1073
|
+
// keyof Pick<VehicleFeatureCategory, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
1074
|
+
// "asc" | "desc"
|
|
1075
|
+
// >;
|
|
1076
|
+
// export class VehicleFeatureCategoryOptions extends PaginationOptions {
|
|
1077
|
+
// sort?: VehicleFeatureCategorySort;
|
|
1078
|
+
// withFeatures?: boolean;
|
|
1079
|
+
// select?: (VehicleFeatureCategorySelectFields | `features.${VehicleFeatureSelectFields}`)[];
|
|
1080
|
+
// validate(): string[] {
|
|
1081
|
+
// const errors = validateSync(this);
|
|
1082
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1083
|
+
// }
|
|
1084
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFeatureCategoryOptions {
|
|
1085
|
+
// return plainToClass(VehicleFeatureCategoryOptions, plain);
|
|
1086
|
+
// }
|
|
1087
|
+
// static toPlain(entity: VehicleFeatureCategoryOptions): Record<string, unknown> {
|
|
1088
|
+
// return instanceToPlain(entity);
|
|
1089
|
+
// }
|
|
1090
|
+
// }
|
|
1091
|
+
// -----------------------------------------------------CAR CATEGORY----------------------------------------------------------------
|
|
1092
|
+
class VehicleCategoryFilter extends utilities_1.BaseFilter {
|
|
1093
|
+
validate() {
|
|
1094
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
1095
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
1096
|
+
}
|
|
1097
|
+
static fromPlain(plain) {
|
|
1098
|
+
return (0, class_transformer_1.plainToClass)(VehicleCategoryFilter, plain);
|
|
1099
|
+
}
|
|
1100
|
+
static toPlain(entity) {
|
|
1101
|
+
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
__decorate([
|
|
1105
|
+
(0, class_validator_1.IsOptional)(),
|
|
1106
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
1107
|
+
__metadata("design:type", Object)
|
|
1108
|
+
], VehicleCategoryFilter.prototype, "id", void 0);
|
|
1109
|
+
__decorate([
|
|
1110
|
+
(0, class_validator_1.IsOptional)(),
|
|
1111
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
1112
|
+
__metadata("design:type", Object)
|
|
1113
|
+
], VehicleCategoryFilter.prototype, "slug", void 0);
|
|
1114
|
+
__decorate([
|
|
1115
|
+
(0, class_validator_1.IsOptional)(),
|
|
1116
|
+
(0, class_validator_1.IsString)(),
|
|
1117
|
+
__metadata("design:type", String)
|
|
1118
|
+
], VehicleCategoryFilter.prototype, "name", void 0);
|
|
1119
|
+
__decorate([
|
|
1120
|
+
(0, class_validator_1.IsOptional)(),
|
|
1121
|
+
(0, class_validator_1.IsString)(),
|
|
1122
|
+
__metadata("design:type", String)
|
|
1123
|
+
], VehicleCategoryFilter.prototype, "search", void 0);
|
|
1124
|
+
exports.VehicleCategoryFilter = VehicleCategoryFilter;
|
|
1125
|
+
class VehicleCategoryUniqueFilter {
|
|
1126
|
+
validate() {
|
|
1127
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
1128
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
1129
|
+
}
|
|
1130
|
+
static fromPlain(plain) {
|
|
1131
|
+
return (0, class_transformer_1.plainToClass)(VehicleCategoryUniqueFilter, plain);
|
|
1132
|
+
}
|
|
1133
|
+
static toPlain(entity) {
|
|
1134
|
+
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
__decorate([
|
|
1138
|
+
(0, class_validator_1.IsOptional)(),
|
|
1139
|
+
(0, class_validator_1.IsString)(),
|
|
1140
|
+
__metadata("design:type", String)
|
|
1141
|
+
], VehicleCategoryUniqueFilter.prototype, "id", void 0);
|
|
1142
|
+
__decorate([
|
|
1143
|
+
(0, class_validator_1.IsOptional)(),
|
|
1144
|
+
(0, class_validator_1.IsString)(),
|
|
1145
|
+
__metadata("design:type", String)
|
|
1146
|
+
], VehicleCategoryUniqueFilter.prototype, "slug", void 0);
|
|
1147
|
+
__decorate([
|
|
1148
|
+
(0, class_validator_1.IsOptional)(),
|
|
1149
|
+
(0, class_validator_1.IsString)(),
|
|
1150
|
+
__metadata("design:type", String)
|
|
1151
|
+
], VehicleCategoryUniqueFilter.prototype, "name", void 0);
|
|
1152
|
+
exports.VehicleCategoryUniqueFilter = VehicleCategoryUniqueFilter;
|
|
1153
|
+
class VehicleCategoryOptions extends utilities_1.PaginationOptions {
|
|
1154
|
+
validate() {
|
|
1155
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
1156
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
1157
|
+
}
|
|
1158
|
+
static fromPlain(plain) {
|
|
1159
|
+
return (0, class_transformer_1.plainToClass)(VehicleFeatureOptions, plain);
|
|
1160
|
+
}
|
|
1161
|
+
static toPlain(entity) {
|
|
1162
|
+
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
exports.VehicleCategoryOptions = VehicleCategoryOptions;
|
|
1166
|
+
// -----------------------------------------------------CAR-------------------------------------------------------------------------
|
|
1167
|
+
// export class VehicleFilter extends BaseFilter {
|
|
1168
|
+
// @IsOptional()
|
|
1169
|
+
// @IsString({ each: true })
|
|
1170
|
+
// referenceNumber?: string | string[];
|
|
1171
|
+
// @IsOptional()
|
|
1172
|
+
// @IsString({ each: true })
|
|
1173
|
+
// make?: string | string[]; // id or list of ids or list of names of make
|
|
1174
|
+
// @IsOptional()
|
|
1175
|
+
// @IsString({ each: true })
|
|
1176
|
+
// model?: string | string[]; // id or list of ids or list of names of model
|
|
1177
|
+
// @IsOptional()
|
|
1178
|
+
// @IsString({ each: true })
|
|
1179
|
+
// bodyType?: string | string[]; // id or list of ids or list of names of body type
|
|
1180
|
+
// @IsOptional()
|
|
1181
|
+
// @IsString({ each: true })
|
|
1182
|
+
// vin?: string | string[];
|
|
1183
|
+
// @IsOptional()
|
|
1184
|
+
// @IsString({ each: true })
|
|
1185
|
+
// chassisNumber?: string | string[];
|
|
1186
|
+
// @IsOptional()
|
|
1187
|
+
// @ValidateNested()
|
|
1188
|
+
// @Type(() => NumberRange)
|
|
1189
|
+
// mileage?: NumberRange;
|
|
1190
|
+
// @IsOptional()
|
|
1191
|
+
// @IsString({ each: true })
|
|
1192
|
+
// fuelType?: string | string[];
|
|
1193
|
+
// @IsOptional()
|
|
1194
|
+
// @IsString({ each: true })
|
|
1195
|
+
// color?: string | string[];
|
|
1196
|
+
// @IsOptional()
|
|
1197
|
+
// @IsString({ each: true })
|
|
1198
|
+
// engineCapacity?: string | string[];
|
|
1199
|
+
// @IsOptional()
|
|
1200
|
+
// @ValidateNested()
|
|
1201
|
+
// @Type(() => NumberRange)
|
|
1202
|
+
// numberOfCylinders?: NumberRange;
|
|
1203
|
+
// @IsOptional()
|
|
1204
|
+
// @ValidateNested()
|
|
1205
|
+
// @Type(() => NumberRange)
|
|
1206
|
+
// cylinderCapacity?: NumberRange;
|
|
1207
|
+
// @IsOptional()
|
|
1208
|
+
// @ValidateNested()
|
|
1209
|
+
// @Type(() => NumberRange)
|
|
1210
|
+
// doors?: NumberRange;
|
|
1211
|
+
// @IsOptional()
|
|
1212
|
+
// @ValidateNested()
|
|
1213
|
+
// @Type(() => NumberRange)
|
|
1214
|
+
// seats?: NumberRange;
|
|
1215
|
+
// @IsOptional()
|
|
1216
|
+
// @ValidateNested()
|
|
1217
|
+
// @Type(() => NumberRange)
|
|
1218
|
+
// keys?: NumberRange;
|
|
1219
|
+
// @IsOptional()
|
|
1220
|
+
// @IsString({ each: true })
|
|
1221
|
+
// wheelsType?: string | string[];
|
|
1222
|
+
// @IsOptional()
|
|
1223
|
+
// @ValidateNested()
|
|
1224
|
+
// @Type(() => NumberRange)
|
|
1225
|
+
// airbags?: NumberRange;
|
|
1226
|
+
// @IsOptional()
|
|
1227
|
+
// @IsString({ each: true })
|
|
1228
|
+
// transmission?: string | string[];
|
|
1229
|
+
// @IsOptional()
|
|
1230
|
+
// @IsString({ each: true })
|
|
1231
|
+
// driveType?: string | string[];
|
|
1232
|
+
// @IsOptional()
|
|
1233
|
+
// @IsString({ each: true })
|
|
1234
|
+
// emissions?: string | string[];
|
|
1235
|
+
// @IsOptional()
|
|
1236
|
+
// @ValidateNested()
|
|
1237
|
+
// @Type(() => NumberRange)
|
|
1238
|
+
// year?: NumberRange;
|
|
1239
|
+
// @IsOptional()
|
|
1240
|
+
// @ValidateNested()
|
|
1241
|
+
// @Type(() => NumberRange)
|
|
1242
|
+
// price?: NumberRange;
|
|
1243
|
+
// @IsOptional()
|
|
1244
|
+
// @IsString({ each: true })
|
|
1245
|
+
// status?: string | string[];
|
|
1246
|
+
// @IsOptional()
|
|
1247
|
+
// @IsString({ each: true })
|
|
1248
|
+
// features?: string | string[]; // id or list of ids or list of names or name of feature or feature category
|
|
1249
|
+
// @IsOptional()
|
|
1250
|
+
// @IsString()
|
|
1251
|
+
// search?: string; // A search string
|
|
1252
|
+
// validate(): string[] {
|
|
1253
|
+
// const errors = validateSync(this);
|
|
1254
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1255
|
+
// }
|
|
1256
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFilter {
|
|
1257
|
+
// return plainToClass(VehicleFilter, plain);
|
|
1258
|
+
// }
|
|
1259
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1260
|
+
// return instanceToPlain(entity);
|
|
1261
|
+
// }
|
|
1262
|
+
// }
|
|
1263
|
+
// export class VehicleUniqueFilter {
|
|
1264
|
+
// @IsOptional()
|
|
1265
|
+
// @IsString()
|
|
1266
|
+
// id?: string;
|
|
1267
|
+
// @IsOptional()
|
|
1268
|
+
// @IsString()
|
|
1269
|
+
// referenceNumber?: string;
|
|
1270
|
+
// @IsOptional()
|
|
1271
|
+
// @IsString()
|
|
1272
|
+
// vin?: string;
|
|
1273
|
+
// @IsOptional()
|
|
1274
|
+
// @IsString()
|
|
1275
|
+
// chassisNumber?: string;
|
|
1276
|
+
// validate(): string[] {
|
|
1277
|
+
// const errors = validateSync(this);
|
|
1278
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1279
|
+
// }
|
|
1280
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleUniqueFilter {
|
|
1281
|
+
// return plainToClass(VehicleUniqueFilter, plain);
|
|
1282
|
+
// }
|
|
1283
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1284
|
+
// return instanceToPlain(entity);
|
|
1285
|
+
// }
|
|
1286
|
+
// }
|
|
1287
|
+
// export type VehicleSort = Record<
|
|
1288
|
+
// keyof Pick<
|
|
1289
|
+
// Vehicle,
|
|
1290
|
+
// | "referenceNumber"
|
|
1291
|
+
// | "mileage"
|
|
1292
|
+
// | "year"
|
|
1293
|
+
// | "createdAt"
|
|
1294
|
+
// | "updatedAt"
|
|
1295
|
+
// | "engineCapacity"
|
|
1296
|
+
// | "doors"
|
|
1297
|
+
// | "seats"
|
|
1298
|
+
// | "keys"
|
|
1299
|
+
// | "transmission"
|
|
1300
|
+
// | "driveType"
|
|
1301
|
+
// | "price"
|
|
1302
|
+
// | "status"
|
|
1303
|
+
// >,
|
|
1304
|
+
// "asc" | "desc"
|
|
1305
|
+
// >;
|
|
1306
|
+
// export class VehicleOptions extends PaginationOptions {
|
|
1307
|
+
// sort?: VehicleSort;
|
|
1308
|
+
// select?: (
|
|
1309
|
+
// | VehicleSelectFields
|
|
1310
|
+
// | `make.${VehicleMakeSelectFields}`
|
|
1311
|
+
// | `model.${VehicleModelSelectFields}`
|
|
1312
|
+
// | `bodyType.${VehicleBodyTypeSelectFields}`
|
|
1313
|
+
// | `features.${VehicleFeatureSelectFields}`
|
|
1314
|
+
// | `metaData.${VehicleMetaDataSelectFields}`
|
|
1315
|
+
// )[];
|
|
1316
|
+
// withMake?: boolean;
|
|
1317
|
+
// withModel?: boolean;
|
|
1318
|
+
// withBodyType?: boolean;
|
|
1319
|
+
// withFeatures?: boolean;
|
|
1320
|
+
// withMetaData?: boolean;
|
|
1321
|
+
// validate(): string[] {
|
|
1322
|
+
// const errors = validateSync(this);
|
|
1323
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1324
|
+
// }
|
|
1325
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleOptions {
|
|
1326
|
+
// return plainToClass(VehicleOptions, plain);
|
|
1327
|
+
// }
|
|
1328
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1329
|
+
// return instanceToPlain(entity);
|
|
1330
|
+
// }
|
|
1331
|
+
// }
|
|
1332
|
+
// export type VehicleMakeSelectFields = keyof VehicleMake;
|
|
1333
|
+
// export type VehicleModelSelectFields = keyof VehicleModel;
|
|
1334
|
+
// export type VehicleSelectFields = keyof Vehicle;
|
|
1335
|
+
// export type VehicleBodyTypeSelectFields = keyof VehicleBodyType;
|
|
1336
|
+
// export type VehicleFeatureSelectFields = keyof VehicleFeature;
|
|
1337
|
+
// export type VehicleCategorySelectFields = keyof VehicleCategory;
|
|
1338
|
+
// export type VehicleFeatureCategorySelectFields = keyof VehicleFeatureCategory;
|
|
1339
|
+
// export type VehicleMetaDataSelectFields = keyof VehicleMetaData;
|
|
1340
|
+
// // -----------------------------------------------------CAR MAKE-------------------------------------------------------------------------
|
|
1341
|
+
// export class VehicleMakeFilter extends BaseFilter {
|
|
1342
|
+
// @IsOptional()
|
|
1343
|
+
// @IsString({ each: true })
|
|
1344
|
+
// id?: string | string[];
|
|
1345
|
+
// @IsOptional()
|
|
1346
|
+
// @IsString({ each: true })
|
|
1347
|
+
// slug?: string | string[];
|
|
1348
|
+
// @IsOptional()
|
|
1349
|
+
// @IsString()
|
|
1350
|
+
// name?: string;
|
|
1351
|
+
// @IsOptional()
|
|
1352
|
+
// @IsString({ each: true })
|
|
1353
|
+
// metaKeywords?: string;
|
|
1354
|
+
// @IsOptional()
|
|
1355
|
+
// @IsString({ each: true })
|
|
1356
|
+
// models?: string | string[]; // A list of model ids and/or names
|
|
1357
|
+
// @IsOptional()
|
|
1358
|
+
// @IsString({ each: true })
|
|
1359
|
+
// vehicles?: string | string[]; // A list of vehicle ids and/or names
|
|
1360
|
+
// @IsOptional()
|
|
1361
|
+
// @IsString()
|
|
1362
|
+
// search?: string; // A search string
|
|
1363
|
+
// validate(): string[] {
|
|
1364
|
+
// const errors = validateSync(this);
|
|
1365
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1366
|
+
// }
|
|
1367
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleMakeFilter {
|
|
1368
|
+
// return plainToClass(VehicleMakeFilter, plain);
|
|
1369
|
+
// }
|
|
1370
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1371
|
+
// return instanceToPlain(entity);
|
|
1372
|
+
// }
|
|
1373
|
+
// }
|
|
1374
|
+
// // This filter is used to get a unique vehicle make by unique fields
|
|
1375
|
+
// export class VehicleMakeUniqueFilter extends BaseFilter {
|
|
1376
|
+
// @IsOptional()
|
|
1377
|
+
// @IsString()
|
|
1378
|
+
// id?: string;
|
|
1379
|
+
// @IsOptional()
|
|
1380
|
+
// @IsString()
|
|
1381
|
+
// slug?: string;
|
|
1382
|
+
// @IsOptional()
|
|
1383
|
+
// @IsString()
|
|
1384
|
+
// name?: string;
|
|
1385
|
+
// validate(): string[] {
|
|
1386
|
+
// const errors = validateSync(this);
|
|
1387
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1388
|
+
// }
|
|
1389
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleMakeFilter {
|
|
1390
|
+
// return plainToClass(VehicleMakeFilter, plain);
|
|
1391
|
+
// }
|
|
1392
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1393
|
+
// return instanceToPlain(entity);
|
|
1394
|
+
// }
|
|
1395
|
+
// }
|
|
1396
|
+
// export type VehicleMakeSort = Record<
|
|
1397
|
+
// keyof Pick<VehicleMake, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
1398
|
+
// "asc" | "desc"
|
|
1399
|
+
// >;
|
|
1400
|
+
// export class VehicleMakeOptions extends PaginationOptions {
|
|
1401
|
+
// sort?: VehicleMakeSort;
|
|
1402
|
+
// withModels?: boolean;
|
|
1403
|
+
// withVehicles?: boolean;
|
|
1404
|
+
// select?: (VehicleMakeSelectFields | `models.${VehicleModelSelectFields}` | `vehicles.${VehicleSelectFields}`)[];
|
|
1405
|
+
// validate(): string[] {
|
|
1406
|
+
// const errors = validateSync(this);
|
|
1407
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1408
|
+
// }
|
|
1409
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleMakeOptions {
|
|
1410
|
+
// return plainToClass(VehicleMakeOptions, plain);
|
|
1411
|
+
// }
|
|
1412
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1413
|
+
// return instanceToPlain(entity);
|
|
1414
|
+
// }
|
|
1415
|
+
// }
|
|
1416
|
+
// // -----------------------------------------------------CAR MODEL-------------------------------------------------------------------------
|
|
1417
|
+
// export class VehicleModelFilter extends BaseFilter {
|
|
1418
|
+
// @IsOptional()
|
|
1419
|
+
// @IsString({ each: true })
|
|
1420
|
+
// id?: string | string[];
|
|
1421
|
+
// @IsOptional()
|
|
1422
|
+
// @IsString({ each: true })
|
|
1423
|
+
// slug?: string | string[];
|
|
1424
|
+
// @IsOptional()
|
|
1425
|
+
// @IsString()
|
|
1426
|
+
// name?: string;
|
|
1427
|
+
// @IsOptional()
|
|
1428
|
+
// @IsString({ each: true })
|
|
1429
|
+
// metaKeywords?: string;
|
|
1430
|
+
// @IsOptional()
|
|
1431
|
+
// @IsString({ each: true })
|
|
1432
|
+
// makes?: string | string[]; // A list of make ids and/or names
|
|
1433
|
+
// @IsOptional()
|
|
1434
|
+
// @IsString({ each: true })
|
|
1435
|
+
// vehicles?: string | string[]; // A list of vehicle ids and/or names
|
|
1436
|
+
// search?: string; // A search string
|
|
1437
|
+
// validate(): string[] {
|
|
1438
|
+
// const errors = validateSync(this);
|
|
1439
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1440
|
+
// }
|
|
1441
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
1442
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
1443
|
+
// }
|
|
1444
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1445
|
+
// return instanceToPlain(entity);
|
|
1446
|
+
// }
|
|
1447
|
+
// }
|
|
1448
|
+
// export class VehicleModelUniqueFilter extends BaseFilter {
|
|
1449
|
+
// @IsOptional()
|
|
1450
|
+
// @IsString()
|
|
1451
|
+
// id?: string;
|
|
1452
|
+
// @IsOptional()
|
|
1453
|
+
// @IsString()
|
|
1454
|
+
// slug?: string;
|
|
1455
|
+
// @IsOptional()
|
|
1456
|
+
// @IsString()
|
|
1457
|
+
// name?: string;
|
|
1458
|
+
// validate(): string[] {
|
|
1459
|
+
// const errors = validateSync(this);
|
|
1460
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1461
|
+
// }
|
|
1462
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelUniqueFilter {
|
|
1463
|
+
// return plainToClass(VehicleModelUniqueFilter, plain);
|
|
1464
|
+
// }
|
|
1465
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1466
|
+
// return instanceToPlain(entity);
|
|
1467
|
+
// }
|
|
1468
|
+
// }
|
|
1469
|
+
// export type VehicleModelSort = Record<
|
|
1470
|
+
// keyof Pick<VehicleModel, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
1471
|
+
// "asc" | "desc"
|
|
1472
|
+
// >;
|
|
1473
|
+
// export class VehicleModelOptions extends PaginationOptions {
|
|
1474
|
+
// sort?: VehicleModelSort;
|
|
1475
|
+
// withVehicles?: boolean;
|
|
1476
|
+
// withMake?: boolean;
|
|
1477
|
+
// select?: (VehicleModelSelectFields | `vehicles.${VehicleSelectFields}` | `make.${VehicleMakeSelectFields}`)[];
|
|
1478
|
+
// validate(): string[] {
|
|
1479
|
+
// const errors = validateSync(this);
|
|
1480
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1481
|
+
// }
|
|
1482
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelOptions {
|
|
1483
|
+
// return plainToClass(VehicleModelOptions, plain);
|
|
1484
|
+
// }
|
|
1485
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1486
|
+
// return instanceToPlain(entity);
|
|
1487
|
+
// }
|
|
1488
|
+
// }
|
|
1489
|
+
// // -----------------------------------------------------CAR BODY TYPE----------------------------------------------------------------
|
|
1490
|
+
// export class VehicleBodyTypeFilter extends BaseFilter {
|
|
1491
|
+
// @IsOptional()
|
|
1492
|
+
// @IsString({ each: true })
|
|
1493
|
+
// id?: string | string[];
|
|
1494
|
+
// @IsOptional()
|
|
1495
|
+
// @IsString({ each: true })
|
|
1496
|
+
// slug?: string | string[];
|
|
1497
|
+
// @IsOptional()
|
|
1498
|
+
// @IsString()
|
|
1499
|
+
// name?: string;
|
|
1500
|
+
// @IsOptional()
|
|
1501
|
+
// @IsString({ each: true })
|
|
1502
|
+
// vehicles?: string | string[]; // A list of vehicle ids and/or names
|
|
1503
|
+
// @IsOptional()
|
|
1504
|
+
// @IsString({ each: true })
|
|
1505
|
+
// models?: string | string[]; // A list of model ids and/or names
|
|
1506
|
+
// @IsOptional()
|
|
1507
|
+
// @IsString()
|
|
1508
|
+
// search?: string; // A search string
|
|
1509
|
+
// validate(): string[] {
|
|
1510
|
+
// const errors = validateSync(this);
|
|
1511
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1512
|
+
// }
|
|
1513
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
1514
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
1515
|
+
// }
|
|
1516
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1517
|
+
// return instanceToPlain(entity);
|
|
1518
|
+
// }
|
|
1519
|
+
// }
|
|
1520
|
+
// export class VehicleBodyTypeUniqueFilter {
|
|
1521
|
+
// @IsOptional()
|
|
1522
|
+
// @IsString()
|
|
1523
|
+
// id?: string;
|
|
1524
|
+
// @IsOptional()
|
|
1525
|
+
// @IsString()
|
|
1526
|
+
// slug?: string;
|
|
1527
|
+
// @IsOptional()
|
|
1528
|
+
// @IsString()
|
|
1529
|
+
// name?: string;
|
|
1530
|
+
// validate(): string[] {
|
|
1531
|
+
// const errors = validateSync(this);
|
|
1532
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1533
|
+
// }
|
|
1534
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
1535
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
1536
|
+
// }
|
|
1537
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1538
|
+
// return instanceToPlain(entity);
|
|
1539
|
+
// }
|
|
1540
|
+
// }
|
|
1541
|
+
// export type VehicleBodyTypeSort = Record<
|
|
1542
|
+
// keyof Pick<VehicleBodyType, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
1543
|
+
// "asc" | "desc"
|
|
1544
|
+
// >;
|
|
1545
|
+
// export class VehicleBodyTypeOptions extends PaginationOptions {
|
|
1546
|
+
// sort?: VehicleBodyTypeSort;
|
|
1547
|
+
// withVehicles?: boolean;
|
|
1548
|
+
// select?: (VehicleBodyTypeSelectFields | `vehicles.${VehicleSelectFields}` | `models.${VehicleModelSelectFields}`)[];
|
|
1549
|
+
// validate(): string[] {
|
|
1550
|
+
// const errors = validateSync(this);
|
|
1551
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1552
|
+
// }
|
|
1553
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelOptions {
|
|
1554
|
+
// return plainToClass(VehicleModelOptions, plain);
|
|
1555
|
+
// }
|
|
1556
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1557
|
+
// return instanceToPlain(entity);
|
|
1558
|
+
// }
|
|
1559
|
+
// }
|
|
1560
|
+
// // -----------------------------------------------------CAR FEATURE----------------------------------------------------------------
|
|
1561
|
+
// export class VehicleFeatureFilter extends BaseFilter {
|
|
1562
|
+
// @IsOptional()
|
|
1563
|
+
// @IsString({ each: true })
|
|
1564
|
+
// id?: string | string[];
|
|
1565
|
+
// @IsOptional()
|
|
1566
|
+
// @IsString({ each: true })
|
|
1567
|
+
// slug?: string | string[];
|
|
1568
|
+
// @IsOptional()
|
|
1569
|
+
// @IsString()
|
|
1570
|
+
// name?: string;
|
|
1571
|
+
// @IsOptional()
|
|
1572
|
+
// @IsString({ each: true })
|
|
1573
|
+
// categories?: string | string[]; // A list of vehicle ids and/or names
|
|
1574
|
+
// @IsOptional()
|
|
1575
|
+
// @IsString()
|
|
1576
|
+
// search?: string; // A search string
|
|
1577
|
+
// validate(): string[] {
|
|
1578
|
+
// const errors = validateSync(this);
|
|
1579
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1580
|
+
// }
|
|
1581
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
1582
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
1583
|
+
// }
|
|
1584
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1585
|
+
// return instanceToPlain(entity);
|
|
1586
|
+
// }
|
|
1587
|
+
// }
|
|
1588
|
+
// export class VehicleFeatureUniqueFilter {
|
|
1589
|
+
// @IsOptional()
|
|
1590
|
+
// @IsString()
|
|
1591
|
+
// id?: string;
|
|
1592
|
+
// @IsOptional()
|
|
1593
|
+
// @IsString()
|
|
1594
|
+
// slug?: string;
|
|
1595
|
+
// @IsOptional()
|
|
1596
|
+
// @IsString()
|
|
1597
|
+
// name?: string;
|
|
1598
|
+
// validate(): string[] {
|
|
1599
|
+
// const errors = validateSync(this);
|
|
1600
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1601
|
+
// }
|
|
1602
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleModelFilter {
|
|
1603
|
+
// return plainToClass(VehicleModelFilter, plain);
|
|
1604
|
+
// }
|
|
1605
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1606
|
+
// return instanceToPlain(entity);
|
|
1607
|
+
// }
|
|
1608
|
+
// }
|
|
1609
|
+
// export type VehicleFeatureSort = Record<
|
|
1610
|
+
// keyof Pick<VehicleFeature, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
1611
|
+
// "asc" | "desc"
|
|
1612
|
+
// >;
|
|
1613
|
+
// export class VehicleFeatureOptions extends PaginationOptions {
|
|
1614
|
+
// sort?: VehicleFeatureSort;
|
|
1615
|
+
// withCategories?: boolean;
|
|
1616
|
+
// select?: (VehicleFeatureSelectFields | `categories.${VehicleCategorySelectFields}`)[];
|
|
1617
|
+
// validate(): string[] {
|
|
1618
|
+
// const errors = validateSync(this);
|
|
1619
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1620
|
+
// }
|
|
1621
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFeatureOptions {
|
|
1622
|
+
// return plainToClass(VehicleFeatureOptions, plain);
|
|
1623
|
+
// }
|
|
1624
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1625
|
+
// return instanceToPlain(entity);
|
|
1626
|
+
// }
|
|
1627
|
+
// }
|
|
1628
|
+
// // -----------------------------------------------------CAR FEATURE CATEGORY----------------------------------------------------------------
|
|
1629
|
+
// export class VehicleFeatureCategoryFilter extends BaseFilter {
|
|
1630
|
+
// @IsOptional()
|
|
1631
|
+
// @IsString({ each: true })
|
|
1632
|
+
// id?: string | string[];
|
|
1633
|
+
// @IsOptional()
|
|
1634
|
+
// @IsString({ each: true })
|
|
1635
|
+
// slug?: string | string[];
|
|
1636
|
+
// @IsOptional()
|
|
1637
|
+
// @IsString()
|
|
1638
|
+
// name?: string;
|
|
1639
|
+
// @IsOptional()
|
|
1640
|
+
// @IsString({ each: true })
|
|
1641
|
+
// features?: string | string[]; // A list of vehicle ids and/or names
|
|
1642
|
+
// @IsOptional()
|
|
1643
|
+
// @IsString()
|
|
1644
|
+
// search?: string; // A search string
|
|
1645
|
+
// validate(): string[] {
|
|
1646
|
+
// const errors = validateSync(this);
|
|
1647
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1648
|
+
// }
|
|
1649
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFeatureCategoryFilter {
|
|
1650
|
+
// return plainToClass(VehicleFeatureCategoryFilter, plain);
|
|
1651
|
+
// }
|
|
1652
|
+
// static toPlain(entity: VehicleFeatureCategoryFilter): Record<string, unknown> {
|
|
1653
|
+
// return instanceToPlain(entity);
|
|
1654
|
+
// }
|
|
1655
|
+
// }
|
|
1656
|
+
// export class VehicleFeatureCategoryUniqueFilter {
|
|
1657
|
+
// @IsOptional()
|
|
1658
|
+
// @IsString()
|
|
1659
|
+
// id?: string;
|
|
1660
|
+
// @IsOptional()
|
|
1661
|
+
// @IsString()
|
|
1662
|
+
// slug?: string;
|
|
1663
|
+
// @IsOptional()
|
|
1664
|
+
// @IsString()
|
|
1665
|
+
// name?: string;
|
|
1666
|
+
// validate(): string[] {
|
|
1667
|
+
// const errors = validateSync(this);
|
|
1668
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1669
|
+
// }
|
|
1670
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFeatureCategoryUniqueFilter {
|
|
1671
|
+
// return plainToClass(VehicleFeatureCategoryUniqueFilter, plain);
|
|
1672
|
+
// }
|
|
1673
|
+
// static toPlain(entity: VehicleFeatureCategoryUniqueFilter): Record<string, unknown> {
|
|
1674
|
+
// return instanceToPlain(entity);
|
|
1675
|
+
// }
|
|
1676
|
+
// }
|
|
1677
|
+
// export type VehicleFeatureCategorySort = Record<
|
|
1678
|
+
// keyof Pick<VehicleFeatureCategory, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
1679
|
+
// "asc" | "desc"
|
|
1680
|
+
// >;
|
|
1681
|
+
// export class VehicleFeatureCategoryOptions extends PaginationOptions {
|
|
1682
|
+
// sort?: VehicleFeatureCategorySort;
|
|
1683
|
+
// withFeatures?: boolean;
|
|
1684
|
+
// select?: (VehicleFeatureCategorySelectFields | `features.${VehicleFeatureSelectFields}`)[];
|
|
1685
|
+
// validate(): string[] {
|
|
1686
|
+
// const errors = validateSync(this);
|
|
1687
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1688
|
+
// }
|
|
1689
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFeatureCategoryOptions {
|
|
1690
|
+
// return plainToClass(VehicleFeatureCategoryOptions, plain);
|
|
1691
|
+
// }
|
|
1692
|
+
// static toPlain(entity: VehicleFeatureCategoryOptions): Record<string, unknown> {
|
|
1693
|
+
// return instanceToPlain(entity);
|
|
1694
|
+
// }
|
|
1695
|
+
// }
|
|
1696
|
+
// // -----------------------------------------------------CAR CATEGORY----------------------------------------------------------------
|
|
1697
|
+
// export class VehicleCategoryFilter extends BaseFilter {
|
|
1698
|
+
// @IsOptional()
|
|
1699
|
+
// @IsString({ each: true })
|
|
1700
|
+
// id?: string | string[];
|
|
1701
|
+
// @IsOptional()
|
|
1702
|
+
// @IsString({ each: true })
|
|
1703
|
+
// slug?: string | string[];
|
|
1704
|
+
// @IsOptional()
|
|
1705
|
+
// @IsString()
|
|
1706
|
+
// name?: string;
|
|
1707
|
+
// @IsOptional()
|
|
1708
|
+
// @IsString()
|
|
1709
|
+
// search?: string; // A search string
|
|
1710
|
+
// validate(): string[] {
|
|
1711
|
+
// const errors = validateSync(this);
|
|
1712
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1713
|
+
// }
|
|
1714
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleCategoryFilter {
|
|
1715
|
+
// return plainToClass(VehicleCategoryFilter, plain);
|
|
1716
|
+
// }
|
|
1717
|
+
// static toPlain(entity: VehicleCategoryFilter): Record<string, unknown> {
|
|
1718
|
+
// return instanceToPlain(entity);
|
|
1719
|
+
// }
|
|
1720
|
+
// }
|
|
1721
|
+
// export class VehicleCategoryUniqueFilter {
|
|
1722
|
+
// @IsOptional()
|
|
1723
|
+
// @IsString()
|
|
1724
|
+
// id?: string;
|
|
1725
|
+
// @IsOptional()
|
|
1726
|
+
// @IsString()
|
|
1727
|
+
// slug?: string;
|
|
1728
|
+
// @IsOptional()
|
|
1729
|
+
// @IsString()
|
|
1730
|
+
// name?: string;
|
|
1731
|
+
// validate(): string[] {
|
|
1732
|
+
// const errors = validateSync(this);
|
|
1733
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1734
|
+
// }
|
|
1735
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleCategoryUniqueFilter {
|
|
1736
|
+
// return plainToClass(VehicleCategoryUniqueFilter, plain);
|
|
1737
|
+
// }
|
|
1738
|
+
// static toPlain(entity: VehicleCategoryUniqueFilter): Record<string, unknown> {
|
|
1739
|
+
// return instanceToPlain(entity);
|
|
1740
|
+
// }
|
|
1741
|
+
// }
|
|
1742
|
+
// export type VehicleCategorySort = Record<
|
|
1743
|
+
// keyof Pick<VehicleCategory, "name" | "isActive" | "createdAt" | "updatedAt">,
|
|
1744
|
+
// "asc" | "desc"
|
|
1745
|
+
// >;
|
|
1746
|
+
// export class VehicleCategoryOptions extends PaginationOptions {
|
|
1747
|
+
// sort?: VehicleCategorySort;
|
|
1748
|
+
// select?: (VehicleCategorySelectFields | `features.${VehicleFeatureSelectFields}`)[];
|
|
1749
|
+
// validate(): string[] {
|
|
1750
|
+
// const errors = validateSync(this);
|
|
1751
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1752
|
+
// }
|
|
1753
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFeatureOptions {
|
|
1754
|
+
// return plainToClass(VehicleFeatureOptions, plain);
|
|
1755
|
+
// }
|
|
1756
|
+
// static toPlain(entity: VehicleCategoryOptions): Record<string, unknown> {
|
|
1757
|
+
// return instanceToPlain(entity);
|
|
1758
|
+
// }
|
|
1759
|
+
// }
|
|
1760
|
+
// // -----------------------------------------------------CAR-------------------------------------------------------------------------
|
|
1761
|
+
// export class VehicleFilter extends BaseFilter {
|
|
1762
|
+
// @IsOptional()
|
|
1763
|
+
// @IsString({ each: true })
|
|
1764
|
+
// referenceNumber?: string | string[];
|
|
1765
|
+
// @IsOptional()
|
|
1766
|
+
// @IsString({ each: true })
|
|
1767
|
+
// make?: string | string[]; // id or list of ids or list of names of make
|
|
1768
|
+
// @IsOptional()
|
|
1769
|
+
// @IsString({ each: true })
|
|
1770
|
+
// model?: string | string[]; // id or list of ids or list of names of model
|
|
1771
|
+
// @IsOptional()
|
|
1772
|
+
// @IsString({ each: true })
|
|
1773
|
+
// bodyType?: string | string[]; // id or list of ids or list of names of body type
|
|
1774
|
+
// @IsOptional()
|
|
1775
|
+
// @IsString({ each: true })
|
|
1776
|
+
// vin?: string | string[];
|
|
1777
|
+
// @IsOptional()
|
|
1778
|
+
// @IsString({ each: true })
|
|
1779
|
+
// chassisNumber?: string | string[];
|
|
1780
|
+
// @IsOptional()
|
|
1781
|
+
// @ValidateNested()
|
|
1782
|
+
// @Type(() => NumberRange)
|
|
1783
|
+
// mileage?: NumberRange;
|
|
1784
|
+
// @IsOptional()
|
|
1785
|
+
// @IsString({ each: true })
|
|
1786
|
+
// fuelType?: string | string[];
|
|
1787
|
+
// @IsOptional()
|
|
1788
|
+
// @IsString({ each: true })
|
|
1789
|
+
// color?: string | string[];
|
|
1790
|
+
// @IsOptional()
|
|
1791
|
+
// @IsString({ each: true })
|
|
1792
|
+
// engineCapacity?: string | string[];
|
|
1793
|
+
// @IsOptional()
|
|
1794
|
+
// @ValidateNested()
|
|
1795
|
+
// @Type(() => NumberRange)
|
|
1796
|
+
// numberOfCylinders?: NumberRange;
|
|
1797
|
+
// @IsOptional()
|
|
1798
|
+
// @ValidateNested()
|
|
1799
|
+
// @Type(() => NumberRange)
|
|
1800
|
+
// cylinderCapacity?: NumberRange;
|
|
1801
|
+
// @IsOptional()
|
|
1802
|
+
// @ValidateNested()
|
|
1803
|
+
// @Type(() => NumberRange)
|
|
1804
|
+
// doors?: NumberRange;
|
|
1805
|
+
// @IsOptional()
|
|
1806
|
+
// @ValidateNested()
|
|
1807
|
+
// @Type(() => NumberRange)
|
|
1808
|
+
// seats?: NumberRange;
|
|
1809
|
+
// @IsOptional()
|
|
1810
|
+
// @ValidateNested()
|
|
1811
|
+
// @Type(() => NumberRange)
|
|
1812
|
+
// keys?: NumberRange;
|
|
1813
|
+
// @IsOptional()
|
|
1814
|
+
// @IsString({ each: true })
|
|
1815
|
+
// wheelsType?: string | string[];
|
|
1816
|
+
// @IsOptional()
|
|
1817
|
+
// @ValidateNested()
|
|
1818
|
+
// @Type(() => NumberRange)
|
|
1819
|
+
// airbags?: NumberRange;
|
|
1820
|
+
// @IsOptional()
|
|
1821
|
+
// @IsString({ each: true })
|
|
1822
|
+
// transmission?: string | string[];
|
|
1823
|
+
// @IsOptional()
|
|
1824
|
+
// @IsString({ each: true })
|
|
1825
|
+
// driveType?: string | string[];
|
|
1826
|
+
// @IsOptional()
|
|
1827
|
+
// @IsString({ each: true })
|
|
1828
|
+
// emissions?: string | string[];
|
|
1829
|
+
// @IsOptional()
|
|
1830
|
+
// @ValidateNested()
|
|
1831
|
+
// @Type(() => NumberRange)
|
|
1832
|
+
// year?: NumberRange;
|
|
1833
|
+
// @IsOptional()
|
|
1834
|
+
// @ValidateNested()
|
|
1835
|
+
// @Type(() => NumberRange)
|
|
1836
|
+
// price?: NumberRange;
|
|
1837
|
+
// @IsOptional()
|
|
1838
|
+
// @IsString({ each: true })
|
|
1839
|
+
// status?: string | string[];
|
|
1840
|
+
// @IsOptional()
|
|
1841
|
+
// @IsString({ each: true })
|
|
1842
|
+
// features?: string | string[]; // id or list of ids or list of names or name of feature or feature category
|
|
1843
|
+
// @IsOptional()
|
|
1844
|
+
// @IsString()
|
|
1845
|
+
// search?: string; // A search string
|
|
1846
|
+
// validate(): string[] {
|
|
1847
|
+
// const errors = validateSync(this);
|
|
1848
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1849
|
+
// }
|
|
1850
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleFilter {
|
|
1851
|
+
// return plainToClass(VehicleFilter, plain);
|
|
1852
|
+
// }
|
|
1853
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1854
|
+
// return instanceToPlain(entity);
|
|
1855
|
+
// }
|
|
1856
|
+
// }
|
|
1857
|
+
// export class VehicleUniqueFilter {
|
|
1858
|
+
// @IsOptional()
|
|
1859
|
+
// @IsString()
|
|
1860
|
+
// id?: string;
|
|
1861
|
+
// @IsOptional()
|
|
1862
|
+
// @IsString()
|
|
1863
|
+
// referenceNumber?: string;
|
|
1864
|
+
// @IsOptional()
|
|
1865
|
+
// @IsString()
|
|
1866
|
+
// vin?: string;
|
|
1867
|
+
// @IsOptional()
|
|
1868
|
+
// @IsString()
|
|
1869
|
+
// chassisNumber?: string;
|
|
1870
|
+
// validate(): string[] {
|
|
1871
|
+
// const errors = validateSync(this);
|
|
1872
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1873
|
+
// }
|
|
1874
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleUniqueFilter {
|
|
1875
|
+
// return plainToClass(VehicleUniqueFilter, plain);
|
|
1876
|
+
// }
|
|
1877
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1878
|
+
// return instanceToPlain(entity);
|
|
1879
|
+
// }
|
|
1880
|
+
// }
|
|
1881
|
+
// export type VehicleSort = Record<
|
|
1882
|
+
// keyof Pick<
|
|
1883
|
+
// Vehicle,
|
|
1884
|
+
// | "referenceNumber"
|
|
1885
|
+
// | "mileage"
|
|
1886
|
+
// | "year"
|
|
1887
|
+
// | "createdAt"
|
|
1888
|
+
// | "updatedAt"
|
|
1889
|
+
// | "engineCapacity"
|
|
1890
|
+
// | "doors"
|
|
1891
|
+
// | "seats"
|
|
1892
|
+
// | "keys"
|
|
1893
|
+
// | "transmission"
|
|
1894
|
+
// | "driveType"
|
|
1895
|
+
// | "price"
|
|
1896
|
+
// | "status"
|
|
1897
|
+
// >,
|
|
1898
|
+
// "asc" | "desc"
|
|
1899
|
+
// >;
|
|
1900
|
+
// export class VehicleOptions extends PaginationOptions {
|
|
1901
|
+
// sort?: VehicleSort;
|
|
1902
|
+
// select?: (
|
|
1903
|
+
// | VehicleSelectFields
|
|
1904
|
+
// | `make.${VehicleMakeSelectFields}`
|
|
1905
|
+
// | `model.${VehicleModelSelectFields}`
|
|
1906
|
+
// | `bodyType.${VehicleBodyTypeSelectFields}`
|
|
1907
|
+
// | `features.${VehicleFeatureSelectFields}`
|
|
1908
|
+
// | `metaData.${VehicleMetaDataSelectFields}`
|
|
1909
|
+
// )[];
|
|
1910
|
+
// withMake?: boolean;
|
|
1911
|
+
// withModel?: boolean;
|
|
1912
|
+
// withBodyType?: boolean;
|
|
1913
|
+
// withFeatures?: boolean;
|
|
1914
|
+
// withMetaData?: boolean;
|
|
1915
|
+
// validate(): string[] {
|
|
1916
|
+
// const errors = validateSync(this);
|
|
1917
|
+
// return errors.map((error) => Object.values(error.constraints ?? {})).flat();
|
|
1918
|
+
// }
|
|
1919
|
+
// static fromPlain(plain: Record<string, unknown>): VehicleOptions {
|
|
1920
|
+
// return plainToClass(VehicleOptions, plain);
|
|
1921
|
+
// }
|
|
1922
|
+
// static toPlain(entity: any): Record<string, unknown> {
|
|
1923
|
+
// return instanceToPlain(entity);
|
|
1924
|
+
// }
|
|
1925
|
+
// }
|