@alba-cars/common-modules 1.2.7 → 1.2.9
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/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/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/global/utilities.d.ts +4 -0
- package/dist/global/utilities.js +3 -1
- package/package.json +2 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BaseCreateDTO, BaseUpdateDTO } from "./BaseDTO";
|
|
2
|
+
import { VehicleCategoryFilter, VehicleCategoryOptions, VehicleCategoryUniqueFilter } from "./VehicleFilterDTO";
|
|
3
|
+
export declare class VehicleCategoryGetDTO {
|
|
4
|
+
filter?: VehicleCategoryFilter;
|
|
5
|
+
options?: VehicleCategoryOptions;
|
|
6
|
+
validate(): string[];
|
|
7
|
+
static fromPlain(plain: Record<string, unknown>): VehicleCategoryGetDTO;
|
|
8
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export declare class VehicleCategoryGetUniqueDTO {
|
|
11
|
+
filter?: VehicleCategoryUniqueFilter;
|
|
12
|
+
options?: Omit<VehicleCategoryOptions, 'page' | 'limit' | 'sort'>;
|
|
13
|
+
validate(): string[];
|
|
14
|
+
static fromPlain(plain: Record<string, unknown>): VehicleCategoryGetUniqueDTO;
|
|
15
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare class VehicleCategoryCreateDTO extends BaseCreateDTO {
|
|
18
|
+
name: string;
|
|
19
|
+
validate(): string[];
|
|
20
|
+
static fromPlain(plain: Record<string, unknown>): VehicleCategoryCreateDTO;
|
|
21
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export declare class VehicleCategoryUpdateDTO extends BaseUpdateDTO {
|
|
24
|
+
name?: string;
|
|
25
|
+
validate(): string[];
|
|
26
|
+
static fromPlain(plain: Record<string, unknown>): VehicleCategoryUpdateDTO;
|
|
27
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export declare class DynamicVehicleCategoryDTO {
|
|
30
|
+
constructor(payload: {
|
|
31
|
+
existingId?: string;
|
|
32
|
+
new?: VehicleCategoryCreateDTO;
|
|
33
|
+
});
|
|
34
|
+
existingId?: string;
|
|
35
|
+
new?: VehicleCategoryCreateDTO;
|
|
36
|
+
validate(): void;
|
|
37
|
+
static fromPlain(plain: Record<string, unknown>): DynamicVehicleCategoryDTO;
|
|
38
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
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.DynamicVehicleCategoryDTO = exports.VehicleCategoryUpdateDTO = exports.VehicleCategoryCreateDTO = exports.VehicleCategoryGetUniqueDTO = exports.VehicleCategoryGetDTO = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const BaseDTO_1 = require("./BaseDTO");
|
|
16
|
+
class VehicleCategoryGetDTO {
|
|
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)(VehicleCategoryGetDTO, plain);
|
|
23
|
+
}
|
|
24
|
+
static toPlain(entity) {
|
|
25
|
+
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.VehicleCategoryGetDTO = VehicleCategoryGetDTO;
|
|
29
|
+
// Use this to get a unique vehicle make by unique fields
|
|
30
|
+
class VehicleCategoryGetUniqueDTO {
|
|
31
|
+
validate() {
|
|
32
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
33
|
+
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
34
|
+
}
|
|
35
|
+
static fromPlain(plain) {
|
|
36
|
+
return (0, class_transformer_1.plainToClass)(VehicleCategoryGetUniqueDTO, plain);
|
|
37
|
+
}
|
|
38
|
+
static toPlain(entity) {
|
|
39
|
+
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.VehicleCategoryGetUniqueDTO = VehicleCategoryGetUniqueDTO;
|
|
43
|
+
class VehicleCategoryCreateDTO extends BaseDTO_1.BaseCreateDTO {
|
|
44
|
+
validate() {
|
|
45
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
46
|
+
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
47
|
+
}
|
|
48
|
+
static fromPlain(plain) {
|
|
49
|
+
return (0, class_transformer_1.plainToClass)(VehicleCategoryCreateDTO, plain);
|
|
50
|
+
}
|
|
51
|
+
static toPlain(entity) {
|
|
52
|
+
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.IsString)(),
|
|
57
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
58
|
+
(0, class_validator_1.IsDefined)(),
|
|
59
|
+
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
60
|
+
message: 'Name can only contain letters, numbers, spaces, hyphens, and underscores.',
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], VehicleCategoryCreateDTO.prototype, "name", void 0);
|
|
64
|
+
exports.VehicleCategoryCreateDTO = VehicleCategoryCreateDTO;
|
|
65
|
+
class VehicleCategoryUpdateDTO extends BaseDTO_1.BaseUpdateDTO {
|
|
66
|
+
validate() {
|
|
67
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
68
|
+
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
69
|
+
}
|
|
70
|
+
static fromPlain(plain) {
|
|
71
|
+
return (0, class_transformer_1.plainToClass)(VehicleCategoryUpdateDTO, plain);
|
|
72
|
+
}
|
|
73
|
+
static toPlain(entity) {
|
|
74
|
+
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, class_validator_1.IsString)(),
|
|
79
|
+
(0, class_validator_1.IsOptional)(),
|
|
80
|
+
(0, class_validator_1.Matches)(/^[a-zA-Z0-9\s\-\_]*$/, {
|
|
81
|
+
message: 'Name can only contain letters, numbers, spaces, hyphens, and underscores.',
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], VehicleCategoryUpdateDTO.prototype, "name", void 0);
|
|
85
|
+
exports.VehicleCategoryUpdateDTO = VehicleCategoryUpdateDTO;
|
|
86
|
+
class DynamicVehicleCategoryDTO {
|
|
87
|
+
constructor(payload) {
|
|
88
|
+
this.existingId = payload.existingId;
|
|
89
|
+
this.new = payload.new;
|
|
90
|
+
}
|
|
91
|
+
validate() {
|
|
92
|
+
if (!this.existingId && !this.new) {
|
|
93
|
+
throw new Error('Either existingId or new details must be provided.');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
static fromPlain(plain) {
|
|
97
|
+
return (0, class_transformer_1.plainToClass)(DynamicVehicleCategoryDTO, plain);
|
|
98
|
+
}
|
|
99
|
+
static toPlain(entity) {
|
|
100
|
+
return (0, class_transformer_1.instanceToPlain)(entity);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, class_validator_1.IsString)(),
|
|
105
|
+
(0, class_validator_1.IsOptional)(),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], DynamicVehicleCategoryDTO.prototype, "existingId", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, class_validator_1.ValidateNested)(),
|
|
110
|
+
(0, class_transformer_1.Type)(() => VehicleCategoryCreateDTO),
|
|
111
|
+
(0, class_validator_1.IsOptional)(),
|
|
112
|
+
__metadata("design:type", VehicleCategoryCreateDTO)
|
|
113
|
+
], DynamicVehicleCategoryDTO.prototype, "new", void 0);
|
|
114
|
+
exports.DynamicVehicleCategoryDTO = DynamicVehicleCategoryDTO;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { VehicleFilter, VehicleOptions, VehicleUniqueFilter } from
|
|
2
|
-
import { BaseCreateDTO, BaseUpdateDTO } from
|
|
3
|
-
import { DynamicMakeDTO } from
|
|
4
|
-
import { DynamicModelDTO } from
|
|
5
|
-
import { DynamicVehicleBodyTypeDTO } from
|
|
6
|
-
import { VehicleMediaCreateDTO, VehicleMediaUpdateDTO } from
|
|
1
|
+
import { VehicleFilter, VehicleOptions, VehicleUniqueFilter } from "../utilities";
|
|
2
|
+
import { BaseCreateDTO, BaseUpdateDTO } from "./BaseDTO";
|
|
3
|
+
import { DynamicMakeDTO } from "./VehicleMakeDTO";
|
|
4
|
+
import { DynamicModelDTO } from "./VehicleModelDTO";
|
|
5
|
+
import { DynamicVehicleBodyTypeDTO } from "./VehicleTypeDTO";
|
|
6
|
+
import { VehicleMediaCreateDTO, VehicleMediaUpdateDTO } from "./VehicleMedia";
|
|
7
7
|
export declare class VehicleGetDTO {
|
|
8
8
|
filter?: VehicleFilter;
|
|
9
9
|
options?: VehicleOptions;
|
|
10
10
|
validate?: (shouldValidate?: boolean) => string[];
|
|
11
11
|
constructor(shouldIncludeValidate?: boolean);
|
|
12
12
|
static fromPlain(plain: Record<string, unknown>): VehicleGetDTO;
|
|
13
|
-
|
|
13
|
+
toPlain(): Record<string, unknown>;
|
|
14
14
|
}
|
|
15
15
|
export declare class VehicleGetUniqueDTO {
|
|
16
16
|
filter?: VehicleUniqueFilter;
|
|
17
|
-
options?: Omit<VehicleOptions,
|
|
17
|
+
options?: Omit<VehicleOptions, "page" | "limit" | "sort">;
|
|
18
18
|
validate(): string[];
|
|
19
19
|
static fromPlain(plain: Record<string, unknown>): VehicleGetUniqueDTO;
|
|
20
20
|
static toPlain(entity: any): Record<string, unknown>;
|
|
@@ -24,6 +24,7 @@ export declare class VehicleMetaDataDTO {
|
|
|
24
24
|
metaDescription?: string;
|
|
25
25
|
metaKeywords?: string;
|
|
26
26
|
vehicleDescription: string;
|
|
27
|
+
vehicleId: string;
|
|
27
28
|
others?: Record<string, string>;
|
|
28
29
|
validate(): string[];
|
|
29
30
|
static fromPlain(plain: Record<string, unknown>): VehicleMetaDataDTO;
|
|
@@ -34,8 +35,10 @@ export declare class VehicleCreateDTO extends BaseCreateDTO {
|
|
|
34
35
|
model: DynamicModelDTO;
|
|
35
36
|
bodyType: DynamicVehicleBodyTypeDTO;
|
|
36
37
|
vin: string;
|
|
38
|
+
vehicleSpec: string;
|
|
37
39
|
chassisNumber: string;
|
|
38
40
|
mileage: number;
|
|
41
|
+
odometer: number;
|
|
39
42
|
fuelType: string;
|
|
40
43
|
color: string;
|
|
41
44
|
engineCapacity: string;
|
|
@@ -55,6 +58,8 @@ export declare class VehicleCreateDTO extends BaseCreateDTO {
|
|
|
55
58
|
status: string;
|
|
56
59
|
features?: string[];
|
|
57
60
|
metaData?: VehicleMetaDataDTO;
|
|
61
|
+
isDraft?: boolean;
|
|
62
|
+
pageNo?: number;
|
|
58
63
|
validate(): string[];
|
|
59
64
|
static fromPlain(plain: Record<string, unknown>): VehicleCreateDTO;
|
|
60
65
|
static toPlain(entity: any): Record<string, unknown>;
|
|
@@ -82,6 +87,7 @@ export declare class VehicleUpdateDTO extends BaseUpdateDTO {
|
|
|
82
87
|
doors: number;
|
|
83
88
|
seats: number;
|
|
84
89
|
keys: number;
|
|
90
|
+
odometer: number;
|
|
85
91
|
wheelsType: string;
|
|
86
92
|
airbags: number;
|
|
87
93
|
transmission: string;
|
|
@@ -91,6 +97,8 @@ export declare class VehicleUpdateDTO extends BaseUpdateDTO {
|
|
|
91
97
|
year: number;
|
|
92
98
|
price: number;
|
|
93
99
|
status: string;
|
|
100
|
+
isDraft?: boolean;
|
|
101
|
+
pageNo?: number;
|
|
94
102
|
features: VehicleFeaturesUpdateDTO;
|
|
95
103
|
metaData: VehicleMetaDataDTO;
|
|
96
104
|
validate(): string[];
|
|
@@ -26,22 +26,24 @@ class VehicleGetDTO {
|
|
|
26
26
|
return [];
|
|
27
27
|
}
|
|
28
28
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
29
|
-
return errors
|
|
29
|
+
return errors
|
|
30
|
+
.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); })
|
|
31
|
+
.flat();
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
static fromPlain(plain) {
|
|
34
36
|
return (0, class_transformer_1.plainToClass)(VehicleGetDTO, plain);
|
|
35
37
|
}
|
|
36
|
-
|
|
37
|
-
return (0, class_transformer_1.instanceToPlain)(
|
|
38
|
+
toPlain() {
|
|
39
|
+
return (0, class_transformer_1.instanceToPlain)(this);
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
exports.VehicleGetDTO = VehicleGetDTO;
|
|
41
43
|
class VehicleGetUniqueDTO {
|
|
42
44
|
validate() {
|
|
43
45
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
44
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
46
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
45
47
|
}
|
|
46
48
|
static fromPlain(plain) {
|
|
47
49
|
return (0, class_transformer_1.plainToClass)(VehicleGetUniqueDTO, plain);
|
|
@@ -54,7 +56,7 @@ exports.VehicleGetUniqueDTO = VehicleGetUniqueDTO;
|
|
|
54
56
|
class VehicleMetaDataDTO {
|
|
55
57
|
validate() {
|
|
56
58
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
57
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
59
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
58
60
|
}
|
|
59
61
|
static fromPlain(plain) {
|
|
60
62
|
return (0, class_transformer_1.plainToClass)(VehicleMetaDataDTO, plain);
|
|
@@ -83,6 +85,10 @@ __decorate([
|
|
|
83
85
|
(0, class_validator_1.IsString)(),
|
|
84
86
|
__metadata("design:type", String)
|
|
85
87
|
], VehicleMetaDataDTO.prototype, "vehicleDescription", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, class_validator_1.IsString)(),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], VehicleMetaDataDTO.prototype, "vehicleId", void 0);
|
|
86
92
|
__decorate([
|
|
87
93
|
(0, class_validator_1.IsOptional)(),
|
|
88
94
|
(0, class_validator_1.IsArray)(),
|
|
@@ -127,6 +133,11 @@ __decorate([
|
|
|
127
133
|
(0, class_validator_1.IsString)(),
|
|
128
134
|
__metadata("design:type", String)
|
|
129
135
|
], VehicleCreateDTO.prototype, "vin", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
138
|
+
(0, class_validator_1.IsString)(),
|
|
139
|
+
__metadata("design:type", String)
|
|
140
|
+
], VehicleCreateDTO.prototype, "vehicleSpec", void 0);
|
|
130
141
|
__decorate([
|
|
131
142
|
(0, class_validator_1.IsNotEmpty)(),
|
|
132
143
|
(0, class_validator_1.IsString)(),
|
|
@@ -137,6 +148,11 @@ __decorate([
|
|
|
137
148
|
(0, class_validator_1.IsNumber)(),
|
|
138
149
|
__metadata("design:type", Number)
|
|
139
150
|
], VehicleCreateDTO.prototype, "mileage", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
153
|
+
(0, class_validator_1.IsNumber)(),
|
|
154
|
+
__metadata("design:type", Number)
|
|
155
|
+
], VehicleCreateDTO.prototype, "odometer", void 0);
|
|
140
156
|
__decorate([
|
|
141
157
|
(0, class_validator_1.IsNotEmpty)(),
|
|
142
158
|
(0, class_validator_1.IsString)(),
|
|
@@ -236,11 +252,19 @@ __decorate([
|
|
|
236
252
|
(0, class_transformer_1.Type)(() => VehicleMetaDataDTO),
|
|
237
253
|
__metadata("design:type", VehicleMetaDataDTO)
|
|
238
254
|
], VehicleCreateDTO.prototype, "metaData", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
(0, class_validator_1.IsOptional)(),
|
|
257
|
+
__metadata("design:type", Boolean)
|
|
258
|
+
], VehicleCreateDTO.prototype, "isDraft", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
(0, class_validator_1.IsOptional)(),
|
|
261
|
+
__metadata("design:type", Number)
|
|
262
|
+
], VehicleCreateDTO.prototype, "pageNo", void 0);
|
|
239
263
|
exports.VehicleCreateDTO = VehicleCreateDTO;
|
|
240
264
|
class VehicleFeaturesUpdateDTO {
|
|
241
265
|
validate() {
|
|
242
266
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
243
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
267
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
244
268
|
}
|
|
245
269
|
static fromPlain(plain) {
|
|
246
270
|
return (0, class_transformer_1.plainToClass)(VehicleFeaturesUpdateDTO, plain);
|
|
@@ -351,6 +375,11 @@ __decorate([
|
|
|
351
375
|
(0, class_validator_1.IsNumber)(),
|
|
352
376
|
__metadata("design:type", Number)
|
|
353
377
|
], VehicleUpdateDTO.prototype, "keys", void 0);
|
|
378
|
+
__decorate([
|
|
379
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
380
|
+
(0, class_validator_1.IsNumber)(),
|
|
381
|
+
__metadata("design:type", Number)
|
|
382
|
+
], VehicleUpdateDTO.prototype, "odometer", void 0);
|
|
354
383
|
__decorate([
|
|
355
384
|
(0, class_validator_1.IsOptional)(),
|
|
356
385
|
(0, class_validator_1.IsString)(),
|
|
@@ -398,6 +427,14 @@ __decorate([
|
|
|
398
427
|
(0, class_validator_1.IsString)(),
|
|
399
428
|
__metadata("design:type", String)
|
|
400
429
|
], VehicleUpdateDTO.prototype, "status", void 0);
|
|
430
|
+
__decorate([
|
|
431
|
+
(0, class_validator_1.IsOptional)(),
|
|
432
|
+
__metadata("design:type", Boolean)
|
|
433
|
+
], VehicleUpdateDTO.prototype, "isDraft", void 0);
|
|
434
|
+
__decorate([
|
|
435
|
+
(0, class_validator_1.IsOptional)(),
|
|
436
|
+
__metadata("design:type", Number)
|
|
437
|
+
], VehicleUpdateDTO.prototype, "pageNo", void 0);
|
|
401
438
|
__decorate([
|
|
402
439
|
(0, class_validator_1.IsOptional)(),
|
|
403
440
|
(0, class_validator_1.ValidateNested)(),
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { BaseFilter, PaginationOptions, NumberRange } from "../../../../global";
|
|
2
|
+
import { VehicleMake, VehicleModel, Vehicle, VehicleBodyType, VehicleFeature, VehicleFeatureCategory, VehicleMetaData } from "../models";
|
|
3
|
+
import { VehicleCategory } from "../models/VehicleCategory";
|
|
4
|
+
export type VehicleMakeSelectFields = keyof VehicleMake;
|
|
5
|
+
export type VehicleModelSelectFields = keyof VehicleModel;
|
|
6
|
+
export type VehicleSelectFields = keyof Vehicle;
|
|
7
|
+
export type VehicleBodyTypeSelectFields = keyof VehicleBodyType;
|
|
8
|
+
export type VehicleFeatureSelectFields = keyof VehicleFeature;
|
|
9
|
+
export type VehicleCategorySelectFields = keyof VehicleCategory;
|
|
10
|
+
export type VehicleFeatureCategorySelectFields = keyof VehicleFeatureCategory;
|
|
11
|
+
export type VehicleMetaDataSelectFields = keyof VehicleMetaData;
|
|
12
|
+
export declare class VehicleMakeFilter extends BaseFilter {
|
|
13
|
+
id?: string | string[];
|
|
14
|
+
slug?: string | string[];
|
|
15
|
+
name?: string;
|
|
16
|
+
metaKeywords?: string;
|
|
17
|
+
models?: string | string[];
|
|
18
|
+
vehicles?: string | string[];
|
|
19
|
+
search?: string;
|
|
20
|
+
validate(): string[];
|
|
21
|
+
static fromPlain(plain: Record<string, unknown>): VehicleMakeFilter;
|
|
22
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export declare class VehicleMakeUniqueFilter extends BaseFilter {
|
|
25
|
+
id?: string;
|
|
26
|
+
slug?: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
validate(): string[];
|
|
29
|
+
static fromPlain(plain: Record<string, unknown>): VehicleMakeFilter;
|
|
30
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
export type VehicleMakeSort = Record<keyof Pick<VehicleMake, "name" | "isActive" | "createdAt" | "updatedAt">, "asc" | "desc">;
|
|
33
|
+
export declare class VehicleMakeOptions extends PaginationOptions {
|
|
34
|
+
sort?: VehicleMakeSort;
|
|
35
|
+
withModels?: boolean;
|
|
36
|
+
withVehicles?: boolean;
|
|
37
|
+
select?: (VehicleMakeSelectFields | `models.${VehicleModelSelectFields}` | `vehicles.${VehicleSelectFields}`)[];
|
|
38
|
+
validate(): string[];
|
|
39
|
+
static fromPlain(plain: Record<string, unknown>): VehicleMakeOptions;
|
|
40
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
export declare class VehicleModelFilter extends BaseFilter {
|
|
43
|
+
id?: string | string[];
|
|
44
|
+
slug?: string | string[];
|
|
45
|
+
name?: string;
|
|
46
|
+
metaKeywords?: string;
|
|
47
|
+
makes?: string | string[];
|
|
48
|
+
vehicles?: string | string[];
|
|
49
|
+
search?: string;
|
|
50
|
+
validate(): string[];
|
|
51
|
+
static fromPlain(plain: Record<string, unknown>): VehicleModelFilter;
|
|
52
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
export declare class VehicleModelUniqueFilter extends BaseFilter {
|
|
55
|
+
id?: string;
|
|
56
|
+
slug?: string;
|
|
57
|
+
name?: string;
|
|
58
|
+
validate(): string[];
|
|
59
|
+
static fromPlain(plain: Record<string, unknown>): VehicleModelUniqueFilter;
|
|
60
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
61
|
+
}
|
|
62
|
+
export type VehicleModelSort = Record<keyof Pick<VehicleModel, "name" | "isActive" | "createdAt" | "updatedAt">, "asc" | "desc">;
|
|
63
|
+
export declare class VehicleModelOptions extends PaginationOptions {
|
|
64
|
+
sort?: VehicleModelSort;
|
|
65
|
+
withVehicles?: boolean;
|
|
66
|
+
withMake?: boolean;
|
|
67
|
+
select?: (VehicleModelSelectFields | `vehicles.${VehicleSelectFields}` | `make.${VehicleMakeSelectFields}`)[];
|
|
68
|
+
validate(): string[];
|
|
69
|
+
static fromPlain(plain: Record<string, unknown>): VehicleModelOptions;
|
|
70
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
export declare class VehicleBodyTypeFilter extends BaseFilter {
|
|
73
|
+
id?: string | string[];
|
|
74
|
+
slug?: string | string[];
|
|
75
|
+
name?: string;
|
|
76
|
+
vehicles?: string | string[];
|
|
77
|
+
models?: string | string[];
|
|
78
|
+
search?: string;
|
|
79
|
+
validate(): string[];
|
|
80
|
+
static fromPlain(plain: Record<string, unknown>): VehicleModelFilter;
|
|
81
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
export declare class VehicleBodyTypeUniqueFilter {
|
|
84
|
+
id?: string;
|
|
85
|
+
slug?: string;
|
|
86
|
+
name?: string;
|
|
87
|
+
validate(): string[];
|
|
88
|
+
static fromPlain(plain: Record<string, unknown>): VehicleModelFilter;
|
|
89
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
90
|
+
}
|
|
91
|
+
export type VehicleBodyTypeSort = Record<keyof Pick<VehicleBodyType, "name" | "isActive" | "createdAt" | "updatedAt">, "asc" | "desc">;
|
|
92
|
+
export declare class VehicleBodyTypeOptions extends PaginationOptions {
|
|
93
|
+
sort?: VehicleBodyTypeSort;
|
|
94
|
+
withVehicles?: boolean;
|
|
95
|
+
select?: (VehicleBodyTypeSelectFields | `vehicles.${VehicleSelectFields}` | `models.${VehicleModelSelectFields}`)[];
|
|
96
|
+
validate(): string[];
|
|
97
|
+
static fromPlain(plain: Record<string, unknown>): VehicleModelOptions;
|
|
98
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
99
|
+
}
|
|
100
|
+
export declare class VehicleFeatureFilter extends BaseFilter {
|
|
101
|
+
id?: string | string[];
|
|
102
|
+
slug?: string | string[];
|
|
103
|
+
name?: string;
|
|
104
|
+
categories?: string | string[];
|
|
105
|
+
search?: string;
|
|
106
|
+
validate(): string[];
|
|
107
|
+
static fromPlain(plain: Record<string, unknown>): VehicleModelFilter;
|
|
108
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
109
|
+
}
|
|
110
|
+
export declare class VehicleFeatureUniqueFilter {
|
|
111
|
+
id?: string;
|
|
112
|
+
slug?: string;
|
|
113
|
+
name?: string;
|
|
114
|
+
validate(): string[];
|
|
115
|
+
static fromPlain(plain: Record<string, unknown>): VehicleModelFilter;
|
|
116
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
117
|
+
}
|
|
118
|
+
export type VehicleFeatureSort = Record<keyof Pick<VehicleFeature, "name" | "isActive" | "createdAt" | "updatedAt">, "asc" | "desc">;
|
|
119
|
+
export declare class VehicleFeatureOptions extends PaginationOptions {
|
|
120
|
+
sort?: VehicleFeatureSort;
|
|
121
|
+
withCategories?: boolean;
|
|
122
|
+
select?: (VehicleFeatureSelectFields | `categories.${VehicleCategorySelectFields}`)[];
|
|
123
|
+
validate(): string[];
|
|
124
|
+
static fromPlain(plain: Record<string, unknown>): VehicleFeatureOptions;
|
|
125
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
126
|
+
}
|
|
127
|
+
export declare class VehicleFeatureCategoryFilter extends BaseFilter {
|
|
128
|
+
id?: string | string[];
|
|
129
|
+
slug?: string | string[];
|
|
130
|
+
name?: string;
|
|
131
|
+
features?: string | string[];
|
|
132
|
+
search?: string;
|
|
133
|
+
validate(): string[];
|
|
134
|
+
static fromPlain(plain: Record<string, unknown>): VehicleFeatureCategoryFilter;
|
|
135
|
+
static toPlain(entity: VehicleFeatureCategoryFilter): Record<string, unknown>;
|
|
136
|
+
}
|
|
137
|
+
export declare class VehicleFeatureCategoryUniqueFilter {
|
|
138
|
+
id?: string;
|
|
139
|
+
slug?: string;
|
|
140
|
+
name?: string;
|
|
141
|
+
validate(): string[];
|
|
142
|
+
static fromPlain(plain: Record<string, unknown>): VehicleFeatureCategoryUniqueFilter;
|
|
143
|
+
static toPlain(entity: VehicleFeatureCategoryUniqueFilter): Record<string, unknown>;
|
|
144
|
+
}
|
|
145
|
+
export type VehicleFeatureCategorySort = Record<keyof Pick<VehicleFeatureCategory, "name" | "isActive" | "createdAt" | "updatedAt">, "asc" | "desc">;
|
|
146
|
+
export declare class VehicleFeatureCategoryOptions extends PaginationOptions {
|
|
147
|
+
sort?: VehicleFeatureCategorySort;
|
|
148
|
+
withFeatures?: boolean;
|
|
149
|
+
select?: (VehicleFeatureCategorySelectFields | `features.${VehicleFeatureSelectFields}`)[];
|
|
150
|
+
validate(): string[];
|
|
151
|
+
static fromPlain(plain: Record<string, unknown>): VehicleFeatureCategoryOptions;
|
|
152
|
+
static toPlain(entity: VehicleFeatureCategoryOptions): Record<string, unknown>;
|
|
153
|
+
}
|
|
154
|
+
export declare class VehicleCategoryFilter extends BaseFilter {
|
|
155
|
+
id?: string | string[];
|
|
156
|
+
slug?: string | string[];
|
|
157
|
+
name?: string;
|
|
158
|
+
search?: string;
|
|
159
|
+
validate(): string[];
|
|
160
|
+
static fromPlain(plain: Record<string, unknown>): VehicleCategoryFilter;
|
|
161
|
+
static toPlain(entity: VehicleCategoryFilter): Record<string, unknown>;
|
|
162
|
+
}
|
|
163
|
+
export declare class VehicleCategoryUniqueFilter {
|
|
164
|
+
id?: string;
|
|
165
|
+
slug?: string;
|
|
166
|
+
name?: string;
|
|
167
|
+
validate(): string[];
|
|
168
|
+
static fromPlain(plain: Record<string, unknown>): VehicleCategoryUniqueFilter;
|
|
169
|
+
static toPlain(entity: VehicleCategoryUniqueFilter): Record<string, unknown>;
|
|
170
|
+
}
|
|
171
|
+
export type VehicleCategorySort = Record<keyof Pick<VehicleCategory, "name" | "isActive" | "createdAt" | "updatedAt">, "asc" | "desc">;
|
|
172
|
+
export declare class VehicleCategoryOptions extends PaginationOptions {
|
|
173
|
+
sort?: VehicleCategorySort;
|
|
174
|
+
select?: (VehicleCategorySelectFields | `features.${VehicleFeatureSelectFields}`)[];
|
|
175
|
+
validate(): string[];
|
|
176
|
+
static fromPlain(plain: Record<string, unknown>): VehicleFeatureOptions;
|
|
177
|
+
static toPlain(entity: VehicleCategoryOptions): Record<string, unknown>;
|
|
178
|
+
}
|
|
179
|
+
export declare class VehicleFilter extends BaseFilter {
|
|
180
|
+
referenceNumber?: string | string[];
|
|
181
|
+
make?: string | string[];
|
|
182
|
+
model?: string | string[];
|
|
183
|
+
bodyType?: string | string[];
|
|
184
|
+
vin?: string | string[];
|
|
185
|
+
chassisNumber?: string | string[];
|
|
186
|
+
mileage?: NumberRange;
|
|
187
|
+
fuelType?: string | string[];
|
|
188
|
+
color?: string | string[];
|
|
189
|
+
engineCapacity?: string | string[];
|
|
190
|
+
numberOfCylinders?: NumberRange;
|
|
191
|
+
cylinderCapacity?: NumberRange;
|
|
192
|
+
doors?: NumberRange;
|
|
193
|
+
seats?: NumberRange;
|
|
194
|
+
keys?: NumberRange;
|
|
195
|
+
wheelsType?: string | string[];
|
|
196
|
+
airbags?: NumberRange;
|
|
197
|
+
transmission?: string | string[];
|
|
198
|
+
driveType?: string | string[];
|
|
199
|
+
emissions?: string | string[];
|
|
200
|
+
year?: NumberRange;
|
|
201
|
+
price?: NumberRange;
|
|
202
|
+
status?: string | string[];
|
|
203
|
+
features?: string | string[];
|
|
204
|
+
search?: string;
|
|
205
|
+
validate(): string[];
|
|
206
|
+
static fromPlain(plain: Record<string, unknown>): VehicleFilter;
|
|
207
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
208
|
+
}
|
|
209
|
+
export declare class VehicleUniqueFilter {
|
|
210
|
+
id?: string;
|
|
211
|
+
referenceNumber?: string;
|
|
212
|
+
vin?: string;
|
|
213
|
+
chassisNumber?: string;
|
|
214
|
+
validate(): string[];
|
|
215
|
+
static fromPlain(plain: Record<string, unknown>): VehicleUniqueFilter;
|
|
216
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
217
|
+
}
|
|
218
|
+
export type VehicleSort = Record<keyof Pick<Vehicle, "referenceNumber" | "mileage" | "year" | "createdAt" | "updatedAt" | "engineCapacity" | "doors" | "seats" | "keys" | "transmission" | "driveType" | "price" | "status">, "asc" | "desc">;
|
|
219
|
+
export declare class VehicleOptions extends PaginationOptions {
|
|
220
|
+
sort?: VehicleSort;
|
|
221
|
+
select?: (VehicleSelectFields | `make.${VehicleMakeSelectFields}` | `model.${VehicleModelSelectFields}` | `bodyType.${VehicleBodyTypeSelectFields}` | `features.${VehicleFeatureSelectFields}` | `metaData.${VehicleMetaDataSelectFields}`)[];
|
|
222
|
+
withMake?: boolean;
|
|
223
|
+
withModel?: boolean;
|
|
224
|
+
withBodyType?: boolean;
|
|
225
|
+
withFeatures?: boolean;
|
|
226
|
+
withMetaData?: boolean;
|
|
227
|
+
validate(): string[];
|
|
228
|
+
static fromPlain(plain: Record<string, unknown>): VehicleOptions;
|
|
229
|
+
static toPlain(entity: any): Record<string, unknown>;
|
|
230
|
+
}
|