@alba-cars/common-modules 1.10.38 → 1.10.40

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.
Files changed (40) hide show
  1. package/dist/core/models/pagination/paginated_data.d.ts +2 -0
  2. package/dist/features/auth/data/dto/RoleDTO.d.ts +5 -1
  3. package/dist/features/auth/data/dto/RoleDTO.js +13 -0
  4. package/dist/features/faq/data/dtos/FaqFetchDTO.d.ts +4 -0
  5. package/dist/features/faq/data/dtos/FaqFetchDTO.js +2 -1
  6. package/dist/features/finance-eligibilty-request/data/dto/FinanceEligibilityRequestDTO.d.ts +4 -1
  7. package/dist/features/finance-eligibilty-request/data/dto/FinanceEligibilityRequestDTO.js +15 -0
  8. package/dist/features/sell-car-request/data/dto/SellCarRequestDTO.d.ts +4 -1
  9. package/dist/features/sell-car-request/data/dto/SellCarRequestDTO.js +15 -0
  10. package/dist/features/test-drive-request/data/utilities.d.ts +1 -0
  11. package/dist/features/test-drive-request/data/utilities.js +5 -0
  12. package/dist/features/vehicle-reservations/data/dto/VehicleReservationDTO.d.ts +7 -1
  13. package/dist/features/vehicle-reservations/data/dto/VehicleReservationDTO.js +18 -0
  14. package/package.json +1 -2
  15. package/dist/features/google-review/data/dto/GoogleReviewDTO.d.ts +0 -58
  16. package/dist/features/google-review/data/dto/GoogleReviewDTO.js +0 -20
  17. package/dist/features/sell-call-request/data/dto/SellCarRequestDTO.d.ts +0 -134
  18. package/dist/features/sell-call-request/data/dto/SellCarRequestDTO.js +0 -394
  19. package/dist/features/sell-call-request/data/index.d.ts +0 -1
  20. package/dist/features/sell-call-request/data/index.js +0 -17
  21. package/dist/features/sell-call-request/index.d.ts +0 -1
  22. package/dist/features/sell-call-request/index.js +0 -17
  23. package/dist/features/vehicle/api/body_types/CreateBodyType.d.ts +0 -2
  24. package/dist/features/vehicle/api/body_types/CreateBodyType.js +0 -22
  25. package/dist/features/vehicle/api/body_types/DeleteBodyType.d.ts +0 -2
  26. package/dist/features/vehicle/api/body_types/DeleteBodyType.js +0 -17
  27. package/dist/features/vehicle/api/body_types/GetAllBodyTypes.d.ts +0 -3
  28. package/dist/features/vehicle/api/body_types/GetAllBodyTypes.js +0 -37
  29. package/dist/features/vehicle/api/body_types/UpdateBodyType.d.ts +0 -2
  30. package/dist/features/vehicle/api/body_types/UpdateBodyType.js +0 -22
  31. package/dist/features/vehicle/api/body_types/index.d.ts +0 -4
  32. package/dist/features/vehicle/api/body_types/index.js +0 -20
  33. package/dist/features/vehicle/api/index.d.ts +0 -3
  34. package/dist/features/vehicle/api/index.js +0 -19
  35. package/dist/features/vehicle/api/make/GetOneMake.d.ts +0 -2
  36. package/dist/features/vehicle/api/make/GetOneMake.js +0 -16
  37. package/dist/features/vehicle/api/make/index.d.ts +0 -5
  38. package/dist/features/vehicle/api/make/index.js +0 -21
  39. package/dist/features/vehicle/api/models/index.d.ts +0 -4
  40. package/dist/features/vehicle/api/models/index.js +0 -20
@@ -11,6 +11,8 @@ export interface PaginatedData<Data = unknown> {
11
11
  limit: number;
12
12
  total: number;
13
13
  page: number;
14
+ isCSVExport?: boolean;
15
+ exportFields?: Set<string>;
14
16
  }
15
17
  export declare class ReturnTypeWithPagination<Data = unknown> {
16
18
  success: boolean;
@@ -1,9 +1,10 @@
1
- import { User } from "../../../models";
1
+ import { User } from "../../../vehicle";
2
2
  export declare class RoleGetDTO {
3
3
  id: string;
4
4
  name: string;
5
5
  description?: string;
6
6
  permissions: string[];
7
+ permissionsMap: Record<string, string[]>;
7
8
  isActive: boolean;
8
9
  createdAt: Date;
9
10
  updatedAt: Date;
@@ -15,6 +16,7 @@ export declare class RoleCreateDTO {
15
16
  name: string;
16
17
  description?: string;
17
18
  permissions: string[];
19
+ permissionsMap?: Record<string, string[]>;
18
20
  isActive?: boolean;
19
21
  validate(): string[];
20
22
  static fromPlain(plain: Record<string, unknown>): RoleCreateDTO;
@@ -24,6 +26,7 @@ export declare class RoleUpdateDTO {
24
26
  name?: string;
25
27
  description?: string;
26
28
  permissions?: string[];
29
+ permissionsMap?: Record<string, string[]>;
27
30
  isActive?: boolean;
28
31
  validate(): string[];
29
32
  static fromPlain(plain: Record<string, unknown>): RoleUpdateDTO;
@@ -31,6 +34,7 @@ export declare class RoleUpdateDTO {
31
34
  }
32
35
  export declare class RolePermissionUpdateDTO {
33
36
  permissions: string[];
37
+ permissionsMap?: Record<string, string[]>;
34
38
  validate(): string[];
35
39
  static fromPlain(plain: Record<string, unknown>): RolePermissionUpdateDTO;
36
40
  toPlain(): Record<string, unknown>;
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ // File: types/Role.ts
2
3
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
4
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
5
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -54,6 +55,10 @@ __decorate([
54
55
  (0, class_validator_1.IsString)({ each: true }),
55
56
  __metadata("design:type", Array)
56
57
  ], RoleCreateDTO.prototype, "permissions", void 0);
58
+ __decorate([
59
+ (0, class_validator_1.IsOptional)(),
60
+ __metadata("design:type", Object)
61
+ ], RoleCreateDTO.prototype, "permissionsMap", void 0);
57
62
  __decorate([
58
63
  (0, class_validator_1.IsOptional)(),
59
64
  (0, class_validator_1.IsBoolean)(),
@@ -91,6 +96,10 @@ __decorate([
91
96
  (0, class_validator_1.IsString)({ each: true }),
92
97
  __metadata("design:type", Array)
93
98
  ], RoleUpdateDTO.prototype, "permissions", void 0);
99
+ __decorate([
100
+ (0, class_validator_1.IsOptional)(),
101
+ __metadata("design:type", Object)
102
+ ], RoleUpdateDTO.prototype, "permissionsMap", void 0);
94
103
  __decorate([
95
104
  (0, class_validator_1.IsOptional)(),
96
105
  (0, class_validator_1.IsBoolean)(),
@@ -116,4 +125,8 @@ __decorate([
116
125
  (0, class_validator_1.IsString)({ each: true }),
117
126
  __metadata("design:type", Array)
118
127
  ], RolePermissionUpdateDTO.prototype, "permissions", void 0);
128
+ __decorate([
129
+ (0, class_validator_1.IsOptional)(),
130
+ __metadata("design:type", Object)
131
+ ], RolePermissionUpdateDTO.prototype, "permissionsMap", void 0);
119
132
  exports.RolePermissionUpdateDTO = RolePermissionUpdateDTO;
@@ -23,6 +23,10 @@ export declare class FaqFilterDTO {
23
23
  static fromPlain(plain: any): FaqFilterDTO;
24
24
  static toPlain(instance: FaqFilterDTO): Record<string, unknown>;
25
25
  }
26
+ export declare class SortDTO {
27
+ field: string;
28
+ direction: 'asc' | 'desc';
29
+ }
26
30
  export declare class FaqOptionsDTO {
27
31
  page: number;
28
32
  limit: number;
@@ -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.FaqResponseDTO = exports.FaqFetchDTO = exports.FaqOptionsDTO = exports.FaqFilterDTO = exports.MultilingualContentFetch = void 0;
12
+ exports.FaqResponseDTO = exports.FaqFetchDTO = exports.FaqOptionsDTO = exports.SortDTO = exports.FaqFilterDTO = exports.MultilingualContentFetch = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const enums_1 = require("../enums");
@@ -137,6 +137,7 @@ __decorate([
137
137
  (0, class_validator_1.IsString)(),
138
138
  __metadata("design:type", String)
139
139
  ], SortDTO.prototype, "direction", void 0);
140
+ exports.SortDTO = SortDTO;
140
141
  class FaqOptionsDTO {
141
142
  constructor(init) {
142
143
  this.page = 1;
@@ -1,4 +1,4 @@
1
- import { PaginationOptions } from "../../../../global";
1
+ import { DateFilter, PaginationOptions } from "../../../../global";
2
2
  import { Lead, User } from "../../../models";
3
3
  export declare enum SalaryType {
4
4
  WPS = "wps",
@@ -116,7 +116,10 @@ export declare class FinanceEligibilityFilterDTO {
116
116
  search?: string;
117
117
  vehicleId?: string;
118
118
  leadId?: string;
119
+ eligibility?: EligibilityStatus;
120
+ salaryType?: SalaryType;
119
121
  isActive?: boolean;
122
+ createdAt?: DateFilter;
120
123
  static fromPlain(plain: Record<string, unknown>): FinanceEligibilityFilterDTO;
121
124
  toPlain(): Record<string, unknown>;
122
125
  }
@@ -380,11 +380,26 @@ __decorate([
380
380
  (0, class_validator_1.IsOptional)(),
381
381
  __metadata("design:type", String)
382
382
  ], FinanceEligibilityFilterDTO.prototype, "leadId", void 0);
383
+ __decorate([
384
+ (0, class_validator_1.IsEnum)(EligibilityStatus),
385
+ (0, class_validator_1.IsOptional)(),
386
+ __metadata("design:type", Number)
387
+ ], FinanceEligibilityFilterDTO.prototype, "eligibility", void 0);
388
+ __decorate([
389
+ (0, class_validator_1.IsEnum)(SalaryType),
390
+ (0, class_validator_1.IsOptional)(),
391
+ __metadata("design:type", String)
392
+ ], FinanceEligibilityFilterDTO.prototype, "salaryType", void 0);
383
393
  __decorate([
384
394
  (0, class_validator_1.IsBoolean)(),
385
395
  (0, class_validator_1.IsOptional)(),
386
396
  __metadata("design:type", Boolean)
387
397
  ], FinanceEligibilityFilterDTO.prototype, "isActive", void 0);
398
+ __decorate([
399
+ (0, class_validator_1.IsObject)(),
400
+ (0, class_validator_1.IsOptional)(),
401
+ __metadata("design:type", global_1.DateFilter)
402
+ ], FinanceEligibilityFilterDTO.prototype, "createdAt", void 0);
388
403
  exports.FinanceEligibilityFilterDTO = FinanceEligibilityFilterDTO;
389
404
  class FinanceEligibilityOptionsDTO extends global_1.PaginationOptions {
390
405
  static fromPlain(plain) {
@@ -1,4 +1,4 @@
1
- import { PaginationOptions } from "../../../../global";
1
+ import { DateFilter, PaginationOptions } from "../../../../global";
2
2
  import { VehicleMediaCreateDTO } from "../../../vehicle";
3
3
  export declare enum RequestType {
4
4
  SELL = "sell",
@@ -49,6 +49,7 @@ export declare class SellCarRequestCreateDTO {
49
49
  mileage: number;
50
50
  expectedSellingPrice?: number;
51
51
  description: string;
52
+ emirates: string;
52
53
  specification: string;
53
54
  specificationName: string;
54
55
  requestType?: RequestType;
@@ -133,6 +134,8 @@ export declare class SellCarFilterDTO {
133
134
  search?: string;
134
135
  leadId?: string;
135
136
  isActive?: boolean;
137
+ createdAt?: DateFilter;
138
+ tradeIn?: TradeInOption;
136
139
  validate(): string[];
137
140
  static fromPlain(plain: Record<string, unknown>): SellCarFilterDTO;
138
141
  toPlain(): Record<string, unknown>;
@@ -191,6 +191,11 @@ __decorate([
191
191
  (0, class_validator_1.IsOptional)(),
192
192
  __metadata("design:type", String)
193
193
  ], SellCarRequestCreateDTO.prototype, "description", void 0);
194
+ __decorate([
195
+ (0, class_validator_1.IsString)(),
196
+ (0, class_validator_1.IsOptional)(),
197
+ __metadata("design:type", String)
198
+ ], SellCarRequestCreateDTO.prototype, "emirates", void 0);
194
199
  __decorate([
195
200
  (0, class_validator_1.IsString)(),
196
201
  (0, class_validator_1.IsOptional)(),
@@ -507,6 +512,16 @@ __decorate([
507
512
  (0, class_validator_1.IsOptional)(),
508
513
  __metadata("design:type", Boolean)
509
514
  ], SellCarFilterDTO.prototype, "isActive", void 0);
515
+ __decorate([
516
+ (0, class_validator_1.IsObject)(),
517
+ (0, class_validator_1.IsOptional)(),
518
+ __metadata("design:type", global_1.DateFilter)
519
+ ], SellCarFilterDTO.prototype, "createdAt", void 0);
520
+ __decorate([
521
+ (0, class_validator_1.IsEnum)(TradeInOption),
522
+ (0, class_validator_1.IsOptional)(),
523
+ __metadata("design:type", String)
524
+ ], SellCarFilterDTO.prototype, "tradeIn", void 0);
510
525
  exports.SellCarFilterDTO = SellCarFilterDTO;
511
526
  class SellCarOptionsDTO extends global_1.PaginationOptions {
512
527
  static fromPlain(plain) {
@@ -15,6 +15,7 @@ export declare class TestDriveRequestFilter extends TypedFilter {
15
15
  testDriveDate?: DateFilter;
16
16
  leadThrough?: LeadThrough | LeadThrough[];
17
17
  comments?: string;
18
+ createdAt?: DateFilter;
18
19
  validate(): string[];
19
20
  fromPlain(plain: Record<string, unknown>): TestDriveRequestFilter;
20
21
  toPlain(): Record<string, unknown>;
@@ -82,6 +82,11 @@ __decorate([
82
82
  (0, class_validator_1.IsString)(),
83
83
  __metadata("design:type", String)
84
84
  ], TestDriveRequestFilter.prototype, "comments", void 0);
85
+ __decorate([
86
+ (0, class_validator_1.IsOptional)(),
87
+ (0, class_validator_1.IsObject)(),
88
+ __metadata("design:type", utilities_1.DateFilter)
89
+ ], TestDriveRequestFilter.prototype, "createdAt", void 0);
85
90
  exports.TestDriveRequestFilter = TestDriveRequestFilter;
86
91
  class TestDriveRequestOptions extends utilities_1.PaginationOptions {
87
92
  validate() {
@@ -1,7 +1,7 @@
1
1
  import { FinanceType } from "../enums/finance-type";
2
2
  import { ReservationStatus } from "../enums/reservation-type";
3
3
  import { Vehicle } from "../../../vehicle/data";
4
- import { PaginationOptions } from "../../../../global";
4
+ import { DateFilter, PaginationOptions } from "../../../../global";
5
5
  import { LeadCreateDTO, LeadDTO } from "../../../lead/data/dto/lead_dto";
6
6
  export declare class CreateVehicleReservationDto {
7
7
  leadId?: string;
@@ -73,6 +73,10 @@ export declare class UpdateVehicleReservationDto {
73
73
  toPlain(): Record<string, unknown>;
74
74
  }
75
75
  export declare class VehicleReservationsOptions extends PaginationOptions {
76
+ sort?: {
77
+ field: string;
78
+ direction: 'asc' | 'desc';
79
+ };
76
80
  static fromPlain(plain: Record<string, unknown>): GetVehicleReservationsFilterDto;
77
81
  toPlain(): Record<string, unknown>;
78
82
  }
@@ -86,8 +90,10 @@ export declare class GetVehicleReservationsFilterDto {
86
90
  search?: string;
87
91
  status?: ReservationStatus;
88
92
  exceptStatus?: ReservationStatus;
93
+ financeTypes?: FinanceType[];
89
94
  financeType?: FinanceType;
90
95
  vehicleId?: string;
96
+ createdAt?: DateFilter;
91
97
  leadId?: string;
92
98
  isActive?: boolean;
93
99
  validate(): string[];
@@ -16,6 +16,7 @@ const reservation_type_1 = require("../enums/reservation-type");
16
16
  const class_transformer_1 = require("class-transformer");
17
17
  const global_1 = require("../../../../global");
18
18
  const lead_dto_1 = require("../../../lead/data/dto/lead_dto");
19
+ const faq_1 = require("../../../faq");
19
20
  class CreateVehicleReservationDto {
20
21
  validate() {
21
22
  const errors = (0, class_validator_1.validateSync)(this);
@@ -269,6 +270,12 @@ class VehicleReservationsOptions extends global_1.PaginationOptions {
269
270
  return (0, class_transformer_1.classToPlain)(this);
270
271
  }
271
272
  }
273
+ __decorate([
274
+ (0, class_validator_1.IsOptional)(),
275
+ (0, class_validator_1.ValidateNested)(),
276
+ (0, class_transformer_1.Type)(() => faq_1.SortDTO),
277
+ __metadata("design:type", Object)
278
+ ], VehicleReservationsOptions.prototype, "sort", void 0);
272
279
  exports.VehicleReservationsOptions = VehicleReservationsOptions;
273
280
  class GetVehicleReservationsDTO {
274
281
  static fromPlain(plain) {
@@ -305,6 +312,12 @@ __decorate([
305
312
  (0, class_validator_1.IsOptional)(),
306
313
  __metadata("design:type", String)
307
314
  ], GetVehicleReservationsFilterDto.prototype, "exceptStatus", void 0);
315
+ __decorate([
316
+ (0, class_validator_1.IsEnum)(finance_type_1.FinanceType),
317
+ (0, class_validator_1.IsOptional)(),
318
+ (0, class_validator_1.IsArray)(),
319
+ __metadata("design:type", Array)
320
+ ], GetVehicleReservationsFilterDto.prototype, "financeTypes", void 0);
308
321
  __decorate([
309
322
  (0, class_validator_1.IsEnum)(finance_type_1.FinanceType),
310
323
  (0, class_validator_1.IsOptional)(),
@@ -315,6 +328,11 @@ __decorate([
315
328
  (0, class_validator_1.IsOptional)(),
316
329
  __metadata("design:type", String)
317
330
  ], GetVehicleReservationsFilterDto.prototype, "vehicleId", void 0);
331
+ __decorate([
332
+ (0, class_validator_1.IsObject)(),
333
+ (0, class_validator_1.IsOptional)(),
334
+ __metadata("design:type", global_1.DateFilter)
335
+ ], GetVehicleReservationsFilterDto.prototype, "createdAt", void 0);
318
336
  __decorate([
319
337
  (0, class_validator_1.IsUUID)(),
320
338
  (0, class_validator_1.IsOptional)(),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.10.38",
6
+ "version": "1.10.40",
7
7
  "description": "A package containing DTOs, validation classes and common modules and interfaces for Alba Cars",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -36,7 +36,6 @@
36
36
  "axios": "^1.7.9",
37
37
  "class-transformer": "^0.5.1",
38
38
  "class-validator": "^0.14.1",
39
-
40
39
  "qs": "^6.13.1"
41
40
  },
42
41
  "devDependencies": {
@@ -1,58 +0,0 @@
1
- import { ReviewPlatform } from "../enums";
2
- export interface GoogleApiReviewDTO {
3
- authorName: string;
4
- authorUrl?: string;
5
- profilePhotoUrl?: string;
6
- rating: number;
7
- text: string;
8
- time: number;
9
- relativeTimeDescription: string;
10
- placeId: string;
11
- }
12
- export interface ReviewCreateDTO {
13
- username: string;
14
- rating: number;
15
- comment: string;
16
- date: Date;
17
- platform: ReviewPlatform;
18
- showPublic: boolean;
19
- authorUrl?: string;
20
- profilePhotoUrl?: string;
21
- placeId?: string;
22
- relativeTimeDescription?: string;
23
- }
24
- export interface ReviewUpdateDTO {
25
- rating?: number;
26
- comment?: string;
27
- showPublic?: boolean;
28
- }
29
- export interface ReviewGetUniqueDTO {
30
- id?: string;
31
- username?: string;
32
- placeId?: string;
33
- platform?: ReviewPlatform;
34
- }
35
- export interface ReviewGetDTO {
36
- placeId?: string;
37
- platform?: ReviewPlatform;
38
- minRating?: number;
39
- maxRating?: number;
40
- username?: string;
41
- showPublic?: boolean;
42
- limit?: number;
43
- page?: number;
44
- }
45
- export interface ReviewResponseDTO {
46
- id: string;
47
- username: string;
48
- rating: number;
49
- comment: string;
50
- date: Date;
51
- platform: ReviewPlatform;
52
- showPublic: boolean;
53
- authorUrl?: string;
54
- profilePhotoUrl?: string;
55
- placeId?: string;
56
- relativeTimeDescription?: string;
57
- }
58
- export declare function convertGoogleApiToReviewCreate(googleReview: GoogleApiReviewDTO): ReviewCreateDTO;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertGoogleApiToReviewCreate = void 0;
4
- const enums_1 = require("../enums");
5
- // Helper function to convert Google API review to database format
6
- function convertGoogleApiToReviewCreate(googleReview) {
7
- return {
8
- username: googleReview.authorName,
9
- rating: googleReview.rating,
10
- comment: googleReview.text,
11
- date: new Date(googleReview.time * 1000),
12
- platform: enums_1.ReviewPlatform.GOOGLE,
13
- showPublic: true,
14
- authorUrl: googleReview.authorUrl,
15
- profilePhotoUrl: googleReview.profilePhotoUrl,
16
- placeId: googleReview.placeId,
17
- relativeTimeDescription: googleReview.relativeTimeDescription
18
- };
19
- }
20
- exports.convertGoogleApiToReviewCreate = convertGoogleApiToReviewCreate;
@@ -1,134 +0,0 @@
1
- export declare enum RequestType {
2
- SELL = "sell",
3
- TRADE_IN = "trade_in"
4
- }
5
- export declare class SellCarRequestCreateDTO {
6
- name: string;
7
- phone: string;
8
- email?: string;
9
- city: string;
10
- requestType: RequestType;
11
- makeId: string;
12
- modelId: string;
13
- year: number;
14
- mileage: number;
15
- expectedSellingPrice?: number;
16
- vehicleOptions?: string;
17
- specification?: string;
18
- images?: string[];
19
- desiredVehicleId?: string;
20
- color?: string;
21
- transmission?: string;
22
- condition?: string;
23
- fuelType?: string;
24
- engineCapacity?: string;
25
- description?: string;
26
- additionalDetails?: {
27
- serviceHistory?: boolean;
28
- numberOfOwners?: number;
29
- accidentHistory?: boolean;
30
- modifications?: string[];
31
- lastServiceDate?: Date;
32
- warrantyValid?: boolean;
33
- tradeIn?: boolean;
34
- inspectionDate?: Date;
35
- inspectionLocation?: string;
36
- finalTradeInOffer?: number;
37
- [key: string]: any;
38
- };
39
- validate(): string[];
40
- static fromPlain(plain: Record<string, unknown>): SellCarRequestCreateDTO;
41
- toPlain(): Record<string, unknown>;
42
- }
43
- export declare class SellCarRequestUpdateDTO {
44
- name?: string;
45
- phone?: string;
46
- email?: string;
47
- city?: string;
48
- requestType?: RequestType;
49
- makeId?: string;
50
- modelId?: string;
51
- year?: number;
52
- mileage?: number;
53
- expectedSellingPrice?: number;
54
- vehicleOptions?: string;
55
- specification?: string;
56
- condition?: string;
57
- images?: string[];
58
- desiredVehicleId?: string;
59
- color?: string;
60
- transmission?: string;
61
- fuelType?: string;
62
- engineCapacity?: string;
63
- description?: string;
64
- status?: "pending" | "inspection_scheduled" | "inspected" | "valued" | "approved" | "rejected" | "completed";
65
- additionalDetails?: {
66
- serviceHistory?: boolean;
67
- numberOfOwners?: number;
68
- accidentHistory?: boolean;
69
- modifications?: string[];
70
- lastServiceDate?: Date;
71
- warrantyValid?: boolean;
72
- tradeIn?: boolean;
73
- inspectionDate?: Date;
74
- inspectionLocation?: string;
75
- finalTradeInOffer?: number;
76
- [key: string]: any;
77
- };
78
- validate(): string[];
79
- static fromPlain(plain: Record<string, unknown>): SellCarRequestUpdateDTO;
80
- toPlain(): Record<string, unknown>;
81
- }
82
- export declare class SellCarRequestResponseDTO {
83
- id: string;
84
- name: string;
85
- phone: string;
86
- email?: string;
87
- city: string;
88
- requestType: RequestType;
89
- make?: {
90
- id: string;
91
- name: string;
92
- };
93
- model?: {
94
- id: string;
95
- name: string;
96
- };
97
- year?: number;
98
- mileage?: number;
99
- expectedSellingPrice?: number;
100
- vehicleOptions?: string;
101
- specification?: string;
102
- images?: string[];
103
- desiredVehicle?: {
104
- id: string;
105
- make: string;
106
- model: string;
107
- year: number;
108
- };
109
- color?: string;
110
- transmission?: string;
111
- condition?: string;
112
- fuelType?: string;
113
- engineCapacity?: string;
114
- description?: string;
115
- status: "pending" | "inspection_scheduled" | "inspected" | "valued" | "approved" | "rejected" | "completed";
116
- additionalDetails?: {
117
- serviceHistory?: boolean;
118
- numberOfOwners?: number;
119
- accidentHistory?: boolean;
120
- modifications?: string[];
121
- lastServiceDate?: Date;
122
- warrantyValid?: boolean;
123
- tradeIn?: boolean;
124
- inspectionDate?: Date;
125
- inspectionLocation?: string;
126
- finalTradeInOffer?: number;
127
- [key: string]: any;
128
- };
129
- createdAt: Date;
130
- updatedAt: Date;
131
- validate(): string[];
132
- static fromPlain(plain: Record<string, unknown>): SellCarRequestResponseDTO;
133
- toPlain(): Record<string, unknown>;
134
- }
@@ -1,394 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SellCarRequestResponseDTO = exports.SellCarRequestUpdateDTO = exports.SellCarRequestCreateDTO = exports.RequestType = void 0;
13
- const class_validator_1 = require("class-validator");
14
- const class_transformer_1 = require("class-transformer");
15
- var RequestType;
16
- (function (RequestType) {
17
- RequestType["SELL"] = "sell";
18
- RequestType["TRADE_IN"] = "trade_in";
19
- })(RequestType = exports.RequestType || (exports.RequestType = {}));
20
- class SellCarRequestCreateDTO {
21
- validate() {
22
- const errors = (0, class_validator_1.validateSync)(this);
23
- return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
24
- }
25
- static fromPlain(plain) {
26
- const requestType = plain.desiredVehicleId
27
- ? RequestType.TRADE_IN
28
- : RequestType.SELL;
29
- return (0, class_transformer_1.plainToClass)(SellCarRequestCreateDTO, { ...plain, requestType });
30
- }
31
- toPlain() {
32
- return (0, class_transformer_1.classToPlain)(this);
33
- }
34
- }
35
- __decorate([
36
- (0, class_validator_1.IsString)(),
37
- __metadata("design:type", String)
38
- ], SellCarRequestCreateDTO.prototype, "name", void 0);
39
- __decorate([
40
- (0, class_validator_1.IsPhoneNumber)(),
41
- __metadata("design:type", String)
42
- ], SellCarRequestCreateDTO.prototype, "phone", void 0);
43
- __decorate([
44
- (0, class_validator_1.IsEmail)(),
45
- (0, class_validator_1.IsOptional)(),
46
- __metadata("design:type", String)
47
- ], SellCarRequestCreateDTO.prototype, "email", void 0);
48
- __decorate([
49
- (0, class_validator_1.IsString)(),
50
- __metadata("design:type", String)
51
- ], SellCarRequestCreateDTO.prototype, "city", void 0);
52
- __decorate([
53
- (0, class_validator_1.IsEnum)(RequestType),
54
- __metadata("design:type", String)
55
- ], SellCarRequestCreateDTO.prototype, "requestType", void 0);
56
- __decorate([
57
- (0, class_validator_1.IsUUID)(),
58
- __metadata("design:type", String)
59
- ], SellCarRequestCreateDTO.prototype, "makeId", void 0);
60
- __decorate([
61
- (0, class_validator_1.IsUUID)(),
62
- __metadata("design:type", String)
63
- ], SellCarRequestCreateDTO.prototype, "modelId", void 0);
64
- __decorate([
65
- (0, class_validator_1.IsNumber)(),
66
- (0, class_validator_1.IsPositive)(),
67
- __metadata("design:type", Number)
68
- ], SellCarRequestCreateDTO.prototype, "year", void 0);
69
- __decorate([
70
- (0, class_validator_1.IsNumber)(),
71
- (0, class_validator_1.IsPositive)(),
72
- __metadata("design:type", Number)
73
- ], SellCarRequestCreateDTO.prototype, "mileage", void 0);
74
- __decorate([
75
- (0, class_validator_1.IsNumber)(),
76
- (0, class_validator_1.IsPositive)(),
77
- (0, class_validator_1.ValidateIf)((o) => o.requestType === RequestType.SELL),
78
- (0, class_validator_1.IsOptional)(),
79
- __metadata("design:type", Number)
80
- ], SellCarRequestCreateDTO.prototype, "expectedSellingPrice", void 0);
81
- __decorate([
82
- (0, class_validator_1.IsString)(),
83
- (0, class_validator_1.ValidateIf)((o) => o.requestType === RequestType.SELL),
84
- (0, class_validator_1.IsOptional)(),
85
- __metadata("design:type", String)
86
- ], SellCarRequestCreateDTO.prototype, "vehicleOptions", void 0);
87
- __decorate([
88
- (0, class_validator_1.IsString)(),
89
- (0, class_validator_1.ValidateIf)((o) => o.requestType === RequestType.SELL),
90
- (0, class_validator_1.IsOptional)(),
91
- __metadata("design:type", String)
92
- ], SellCarRequestCreateDTO.prototype, "specification", void 0);
93
- __decorate([
94
- (0, class_validator_1.IsArray)(),
95
- (0, class_validator_1.IsString)({ each: true }),
96
- (0, class_validator_1.ValidateIf)((o) => o.requestType === RequestType.SELL),
97
- (0, class_validator_1.IsOptional)(),
98
- __metadata("design:type", Array)
99
- ], SellCarRequestCreateDTO.prototype, "images", void 0);
100
- __decorate([
101
- (0, class_validator_1.IsUUID)(),
102
- (0, class_validator_1.ValidateIf)((o) => o.requestType === RequestType.TRADE_IN),
103
- (0, class_validator_1.IsOptional)(),
104
- __metadata("design:type", String)
105
- ], SellCarRequestCreateDTO.prototype, "desiredVehicleId", void 0);
106
- __decorate([
107
- (0, class_validator_1.IsString)(),
108
- (0, class_validator_1.IsOptional)(),
109
- __metadata("design:type", String)
110
- ], SellCarRequestCreateDTO.prototype, "color", void 0);
111
- __decorate([
112
- (0, class_validator_1.IsString)(),
113
- (0, class_validator_1.IsOptional)(),
114
- __metadata("design:type", String)
115
- ], SellCarRequestCreateDTO.prototype, "transmission", void 0);
116
- __decorate([
117
- (0, class_validator_1.IsString)(),
118
- (0, class_validator_1.IsOptional)(),
119
- __metadata("design:type", String)
120
- ], SellCarRequestCreateDTO.prototype, "condition", void 0);
121
- __decorate([
122
- (0, class_validator_1.IsString)(),
123
- (0, class_validator_1.IsOptional)(),
124
- __metadata("design:type", String)
125
- ], SellCarRequestCreateDTO.prototype, "fuelType", void 0);
126
- __decorate([
127
- (0, class_validator_1.IsString)(),
128
- (0, class_validator_1.IsOptional)(),
129
- __metadata("design:type", String)
130
- ], SellCarRequestCreateDTO.prototype, "engineCapacity", void 0);
131
- __decorate([
132
- (0, class_validator_1.IsString)(),
133
- (0, class_validator_1.IsOptional)(),
134
- __metadata("design:type", String)
135
- ], SellCarRequestCreateDTO.prototype, "description", void 0);
136
- __decorate([
137
- (0, class_validator_1.IsOptional)(),
138
- __metadata("design:type", Object)
139
- ], SellCarRequestCreateDTO.prototype, "additionalDetails", void 0);
140
- exports.SellCarRequestCreateDTO = SellCarRequestCreateDTO;
141
- class SellCarRequestUpdateDTO {
142
- validate() {
143
- const errors = (0, class_validator_1.validateSync)(this);
144
- return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
145
- }
146
- static fromPlain(plain) {
147
- return (0, class_transformer_1.plainToClass)(SellCarRequestUpdateDTO, plain);
148
- }
149
- toPlain() {
150
- return (0, class_transformer_1.classToPlain)(this);
151
- }
152
- }
153
- __decorate([
154
- (0, class_validator_1.IsOptional)(),
155
- (0, class_validator_1.IsString)(),
156
- __metadata("design:type", String)
157
- ], SellCarRequestUpdateDTO.prototype, "name", void 0);
158
- __decorate([
159
- (0, class_validator_1.IsOptional)(),
160
- (0, class_validator_1.IsPhoneNumber)(),
161
- __metadata("design:type", String)
162
- ], SellCarRequestUpdateDTO.prototype, "phone", void 0);
163
- __decorate([
164
- (0, class_validator_1.IsOptional)(),
165
- (0, class_validator_1.IsEmail)(),
166
- __metadata("design:type", String)
167
- ], SellCarRequestUpdateDTO.prototype, "email", void 0);
168
- __decorate([
169
- (0, class_validator_1.IsOptional)(),
170
- (0, class_validator_1.IsString)(),
171
- __metadata("design:type", String)
172
- ], SellCarRequestUpdateDTO.prototype, "city", void 0);
173
- __decorate([
174
- (0, class_validator_1.IsOptional)(),
175
- (0, class_validator_1.IsEnum)(RequestType),
176
- __metadata("design:type", String)
177
- ], SellCarRequestUpdateDTO.prototype, "requestType", void 0);
178
- __decorate([
179
- (0, class_validator_1.IsOptional)(),
180
- (0, class_validator_1.IsUUID)(),
181
- __metadata("design:type", String)
182
- ], SellCarRequestUpdateDTO.prototype, "makeId", void 0);
183
- __decorate([
184
- (0, class_validator_1.IsOptional)(),
185
- (0, class_validator_1.IsUUID)(),
186
- __metadata("design:type", String)
187
- ], SellCarRequestUpdateDTO.prototype, "modelId", void 0);
188
- __decorate([
189
- (0, class_validator_1.IsOptional)(),
190
- (0, class_validator_1.IsNumber)(),
191
- (0, class_validator_1.IsPositive)(),
192
- __metadata("design:type", Number)
193
- ], SellCarRequestUpdateDTO.prototype, "year", void 0);
194
- __decorate([
195
- (0, class_validator_1.IsOptional)(),
196
- (0, class_validator_1.IsNumber)(),
197
- (0, class_validator_1.IsPositive)(),
198
- __metadata("design:type", Number)
199
- ], SellCarRequestUpdateDTO.prototype, "mileage", void 0);
200
- __decorate([
201
- (0, class_validator_1.IsOptional)(),
202
- (0, class_validator_1.IsNumber)(),
203
- (0, class_validator_1.IsPositive)(),
204
- __metadata("design:type", Number)
205
- ], SellCarRequestUpdateDTO.prototype, "expectedSellingPrice", void 0);
206
- __decorate([
207
- (0, class_validator_1.IsOptional)(),
208
- (0, class_validator_1.IsString)(),
209
- __metadata("design:type", String)
210
- ], SellCarRequestUpdateDTO.prototype, "vehicleOptions", void 0);
211
- __decorate([
212
- (0, class_validator_1.IsOptional)(),
213
- (0, class_validator_1.IsString)(),
214
- __metadata("design:type", String)
215
- ], SellCarRequestUpdateDTO.prototype, "specification", void 0);
216
- __decorate([
217
- (0, class_validator_1.IsString)(),
218
- (0, class_validator_1.IsOptional)(),
219
- __metadata("design:type", String)
220
- ], SellCarRequestUpdateDTO.prototype, "condition", void 0);
221
- __decorate([
222
- (0, class_validator_1.IsOptional)(),
223
- (0, class_validator_1.IsArray)(),
224
- (0, class_validator_1.IsString)({ each: true }),
225
- __metadata("design:type", Array)
226
- ], SellCarRequestUpdateDTO.prototype, "images", void 0);
227
- __decorate([
228
- (0, class_validator_1.IsOptional)(),
229
- (0, class_validator_1.IsUUID)(),
230
- __metadata("design:type", String)
231
- ], SellCarRequestUpdateDTO.prototype, "desiredVehicleId", void 0);
232
- __decorate([
233
- (0, class_validator_1.IsOptional)(),
234
- (0, class_validator_1.IsString)(),
235
- __metadata("design:type", String)
236
- ], SellCarRequestUpdateDTO.prototype, "color", void 0);
237
- __decorate([
238
- (0, class_validator_1.IsOptional)(),
239
- (0, class_validator_1.IsString)(),
240
- __metadata("design:type", String)
241
- ], SellCarRequestUpdateDTO.prototype, "transmission", void 0);
242
- __decorate([
243
- (0, class_validator_1.IsOptional)(),
244
- (0, class_validator_1.IsString)(),
245
- __metadata("design:type", String)
246
- ], SellCarRequestUpdateDTO.prototype, "fuelType", void 0);
247
- __decorate([
248
- (0, class_validator_1.IsOptional)(),
249
- (0, class_validator_1.IsString)(),
250
- __metadata("design:type", String)
251
- ], SellCarRequestUpdateDTO.prototype, "engineCapacity", void 0);
252
- __decorate([
253
- (0, class_validator_1.IsOptional)(),
254
- (0, class_validator_1.IsString)(),
255
- __metadata("design:type", String)
256
- ], SellCarRequestUpdateDTO.prototype, "description", void 0);
257
- __decorate([
258
- (0, class_validator_1.IsOptional)(),
259
- (0, class_validator_1.IsEnum)([
260
- "pending",
261
- "inspection_scheduled",
262
- "inspected",
263
- "valued",
264
- "approved",
265
- "rejected",
266
- "completed",
267
- ]),
268
- __metadata("design:type", String)
269
- ], SellCarRequestUpdateDTO.prototype, "status", void 0);
270
- __decorate([
271
- (0, class_validator_1.IsOptional)(),
272
- __metadata("design:type", Object)
273
- ], SellCarRequestUpdateDTO.prototype, "additionalDetails", void 0);
274
- exports.SellCarRequestUpdateDTO = SellCarRequestUpdateDTO;
275
- class SellCarRequestResponseDTO {
276
- validate() {
277
- const errors = (0, class_validator_1.validateSync)(this);
278
- return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
279
- }
280
- static fromPlain(plain) {
281
- return (0, class_transformer_1.plainToClass)(SellCarRequestResponseDTO, plain);
282
- }
283
- toPlain() {
284
- return (0, class_transformer_1.classToPlain)(this);
285
- }
286
- }
287
- __decorate([
288
- (0, class_validator_1.IsString)(),
289
- __metadata("design:type", String)
290
- ], SellCarRequestResponseDTO.prototype, "id", void 0);
291
- __decorate([
292
- (0, class_validator_1.IsString)(),
293
- __metadata("design:type", String)
294
- ], SellCarRequestResponseDTO.prototype, "name", void 0);
295
- __decorate([
296
- (0, class_validator_1.IsPhoneNumber)(),
297
- __metadata("design:type", String)
298
- ], SellCarRequestResponseDTO.prototype, "phone", void 0);
299
- __decorate([
300
- (0, class_validator_1.IsEmail)(),
301
- (0, class_validator_1.IsOptional)(),
302
- __metadata("design:type", String)
303
- ], SellCarRequestResponseDTO.prototype, "email", void 0);
304
- __decorate([
305
- (0, class_validator_1.IsString)(),
306
- __metadata("design:type", String)
307
- ], SellCarRequestResponseDTO.prototype, "city", void 0);
308
- __decorate([
309
- (0, class_validator_1.IsEnum)(RequestType),
310
- __metadata("design:type", String)
311
- ], SellCarRequestResponseDTO.prototype, "requestType", void 0);
312
- __decorate([
313
- (0, class_validator_1.IsNumber)(),
314
- (0, class_validator_1.IsOptional)(),
315
- __metadata("design:type", Number)
316
- ], SellCarRequestResponseDTO.prototype, "year", void 0);
317
- __decorate([
318
- (0, class_validator_1.IsNumber)(),
319
- (0, class_validator_1.IsOptional)(),
320
- __metadata("design:type", Number)
321
- ], SellCarRequestResponseDTO.prototype, "mileage", void 0);
322
- __decorate([
323
- (0, class_validator_1.IsNumber)(),
324
- (0, class_validator_1.IsOptional)(),
325
- __metadata("design:type", Number)
326
- ], SellCarRequestResponseDTO.prototype, "expectedSellingPrice", void 0);
327
- __decorate([
328
- (0, class_validator_1.IsString)(),
329
- (0, class_validator_1.IsOptional)(),
330
- __metadata("design:type", String)
331
- ], SellCarRequestResponseDTO.prototype, "vehicleOptions", void 0);
332
- __decorate([
333
- (0, class_validator_1.IsString)(),
334
- (0, class_validator_1.IsOptional)(),
335
- __metadata("design:type", String)
336
- ], SellCarRequestResponseDTO.prototype, "specification", void 0);
337
- __decorate([
338
- (0, class_validator_1.IsArray)(),
339
- (0, class_validator_1.IsString)({ each: true }),
340
- (0, class_validator_1.IsOptional)(),
341
- __metadata("design:type", Array)
342
- ], SellCarRequestResponseDTO.prototype, "images", void 0);
343
- __decorate([
344
- (0, class_validator_1.IsOptional)(),
345
- __metadata("design:type", Object)
346
- ], SellCarRequestResponseDTO.prototype, "desiredVehicle", void 0);
347
- __decorate([
348
- (0, class_validator_1.IsString)(),
349
- (0, class_validator_1.IsOptional)(),
350
- __metadata("design:type", String)
351
- ], SellCarRequestResponseDTO.prototype, "color", void 0);
352
- __decorate([
353
- (0, class_validator_1.IsString)(),
354
- (0, class_validator_1.IsOptional)(),
355
- __metadata("design:type", String)
356
- ], SellCarRequestResponseDTO.prototype, "transmission", void 0);
357
- __decorate([
358
- (0, class_validator_1.IsString)(),
359
- (0, class_validator_1.IsOptional)(),
360
- __metadata("design:type", String)
361
- ], SellCarRequestResponseDTO.prototype, "condition", void 0);
362
- __decorate([
363
- (0, class_validator_1.IsString)(),
364
- (0, class_validator_1.IsOptional)(),
365
- __metadata("design:type", String)
366
- ], SellCarRequestResponseDTO.prototype, "fuelType", void 0);
367
- __decorate([
368
- (0, class_validator_1.IsString)(),
369
- (0, class_validator_1.IsOptional)(),
370
- __metadata("design:type", String)
371
- ], SellCarRequestResponseDTO.prototype, "engineCapacity", void 0);
372
- __decorate([
373
- (0, class_validator_1.IsString)(),
374
- (0, class_validator_1.IsOptional)(),
375
- __metadata("design:type", String)
376
- ], SellCarRequestResponseDTO.prototype, "description", void 0);
377
- __decorate([
378
- (0, class_validator_1.IsString)(),
379
- (0, class_validator_1.IsEnum)([
380
- "pending",
381
- "inspection_scheduled",
382
- "inspected",
383
- "valued",
384
- "approved",
385
- "rejected",
386
- "completed",
387
- ]),
388
- __metadata("design:type", String)
389
- ], SellCarRequestResponseDTO.prototype, "status", void 0);
390
- __decorate([
391
- (0, class_validator_1.IsOptional)(),
392
- __metadata("design:type", Object)
393
- ], SellCarRequestResponseDTO.prototype, "additionalDetails", void 0);
394
- exports.SellCarRequestResponseDTO = SellCarRequestResponseDTO;
@@ -1 +0,0 @@
1
- export * from "./dto/SellCarRequestDTO";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./dto/SellCarRequestDTO"), exports);
@@ -1 +0,0 @@
1
- export * from "./data";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./data"), exports);
@@ -1,2 +0,0 @@
1
- import { VehicleBodyType, VehicleBodyTypeCreateDTO } from "../../data";
2
- export declare const createVehicleBodyType: (vehicleBodyTypeDTO: VehicleBodyTypeCreateDTO) => Promise<VehicleBodyType>;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createVehicleBodyType = void 0;
4
- const core_1 = require("../../../../core");
5
- const createVehicleBodyType = async (vehicleBodyTypeDTO) => {
6
- var _a, _b;
7
- try {
8
- const response = await (0, core_1.apiRequest)(core_1.API_ENDPOINTS.vehicleType.create.toString(), {
9
- method: core_1.HttpMethods.POST,
10
- body: JSON.stringify(vehicleBodyTypeDTO)
11
- });
12
- if (!response.success) {
13
- throw Error((_a = response.message) !== null && _a !== void 0 ? _a : (_b = response.error) === null || _b === void 0 ? void 0 : _b.message);
14
- }
15
- return response.data;
16
- }
17
- catch (error) {
18
- console.error('Failed to create vehicle make:', error);
19
- return Promise.reject(error);
20
- }
21
- };
22
- exports.createVehicleBodyType = createVehicleBodyType;
@@ -1,2 +0,0 @@
1
- import { VehicleBodyType } from "../../data";
2
- export declare const deleteVehicleBodyType: (bodyTypeId: string) => Promise<VehicleBodyType>;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteVehicleBodyType = void 0;
4
- const core_1 = require("../../../../core");
5
- const deleteVehicleBodyType = async (bodyTypeId) => {
6
- try {
7
- const response = await (0, core_1.apiRequest)(core_1.API_ENDPOINTS.vehicleType.deleteOne(bodyTypeId).toString(), {
8
- method: core_1.HttpMethods.DELETE,
9
- });
10
- return response;
11
- }
12
- catch (error) {
13
- console.error('Failed to delete vehicle body type:', error);
14
- return Promise.reject(error);
15
- }
16
- };
17
- exports.deleteVehicleBodyType = deleteVehicleBodyType;
@@ -1,3 +0,0 @@
1
- import { PaginatedData } from "../../../../core";
2
- import { VehicleBodyType } from "../../data";
3
- export declare const getAllVehicleBodyTypes: (page: number | null, searchQuery: string | null) => Promise<PaginatedData<VehicleBodyType[]>>;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getAllVehicleBodyTypes = void 0;
7
- const qs_1 = __importDefault(require("qs"));
8
- const core_1 = require("../../../../core");
9
- const data_1 = require("../../data");
10
- const getAllVehicleBodyTypes = async (page, searchQuery) => {
11
- var _a, _b, _c;
12
- try {
13
- let getDTO = new data_1.VehicleBodyTypeGetDTO();
14
- let options = new data_1.VehicleBodyTypeOptions();
15
- if ((searchQuery !== null && searchQuery !== void 0 ? searchQuery : "").trim().length > 1) {
16
- let filter = new data_1.VehicleBodyTypeFilter();
17
- filter.search = searchQuery;
18
- getDTO.filter = filter;
19
- }
20
- // options.withVehicles = true;
21
- options.page = (page !== null && page !== void 0 ? page : 0) + 1;
22
- getDTO.options = options;
23
- const endpoint = `${core_1.API_ENDPOINTS.vehicleType.getAll.toString()}?${qs_1.default.stringify(getDTO.toPlain(), { arrayFormat: 'brackets', allowEmptyArrays: false, skipNulls: true })}`;
24
- const response = await (0, core_1.apiRequest)(endpoint, {
25
- method: core_1.HttpMethods.GET,
26
- });
27
- if (!response.success) {
28
- throw Error((_a = response.message) !== null && _a !== void 0 ? _a : (_b = response.error) === null || _b === void 0 ? void 0 : _b.message);
29
- }
30
- return (_c = response.data) !== null && _c !== void 0 ? _c : [];
31
- }
32
- catch (error) {
33
- console.error('Failed to fetch vehicle types:', error);
34
- return Promise.reject(error);
35
- }
36
- };
37
- exports.getAllVehicleBodyTypes = getAllVehicleBodyTypes;
@@ -1,2 +0,0 @@
1
- import { VehicleBodyType, VehicleBodyTypeUpdateDTO } from "../../data";
2
- export declare const updateVehicleBodyType: (bodyTypeId: string | number, params: VehicleBodyTypeUpdateDTO) => Promise<VehicleBodyType>;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateVehicleBodyType = void 0;
4
- const core_1 = require("../../../../core");
5
- const updateVehicleBodyType = async (bodyTypeId, params) => {
6
- var _a, _b;
7
- try {
8
- const res = await (0, core_1.apiRequest)(core_1.API_ENDPOINTS.vehicleType.updateOne(bodyTypeId), {
9
- method: core_1.HttpMethods.PUT,
10
- body: JSON.stringify(params),
11
- });
12
- if (!res.success) {
13
- throw Error((_a = res.message) !== null && _a !== void 0 ? _a : (_b = res.error) === null || _b === void 0 ? void 0 : _b.message);
14
- }
15
- return res.data;
16
- }
17
- catch (error) {
18
- console.log('Failed to update make with id:', bodyTypeId, 'Error:', error);
19
- return await Promise.reject(error);
20
- }
21
- };
22
- exports.updateVehicleBodyType = updateVehicleBodyType;
@@ -1,4 +0,0 @@
1
- export * from "./CreateBodyType";
2
- export * from "./DeleteBodyType";
3
- export * from "./GetAllBodyTypes";
4
- export * from "./UpdateBodyType";
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./CreateBodyType"), exports);
18
- __exportStar(require("./DeleteBodyType"), exports);
19
- __exportStar(require("./GetAllBodyTypes"), exports);
20
- __exportStar(require("./UpdateBodyType"), exports);
@@ -1,3 +0,0 @@
1
- export * from "./make";
2
- export * from "./models";
3
- export * from "./body_types";
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./make"), exports);
18
- __exportStar(require("./models"), exports);
19
- __exportStar(require("./body_types"), exports);
@@ -1,2 +0,0 @@
1
- import { VehicleMakeGetDTO } from "../../data";
2
- export default function getOneMake(makeID: string | number): Promise<VehicleMakeGetDTO>;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("../../../../core");
4
- async function getOneMake(makeID) {
5
- try {
6
- const res = await (0, core_1.apiRequest)(core_1.API_ENDPOINTS.vehicleMake.getOne(makeID), {
7
- method: core_1.HttpMethods.GET,
8
- });
9
- return res;
10
- }
11
- catch (error) {
12
- console.log('Failed to update make with id:', makeID, 'Error:', error);
13
- return await Promise.reject(error);
14
- }
15
- }
16
- exports.default = getOneMake;
@@ -1,5 +0,0 @@
1
- export * from "./CreateMake";
2
- export * from "./DeleteMake";
3
- export * from "./GetAllMakes";
4
- export * from "./GetOneMake";
5
- export * from "./UpdateMake";
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./CreateMake"), exports);
18
- __exportStar(require("./DeleteMake"), exports);
19
- __exportStar(require("./GetAllMakes"), exports);
20
- __exportStar(require("./GetOneMake"), exports);
21
- __exportStar(require("./UpdateMake"), exports);
@@ -1,4 +0,0 @@
1
- export * from "./CreateModel";
2
- export * from "./GetAllModels";
3
- export * from "./DeleteModel";
4
- export * from "./UpdateModel";
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./CreateModel"), exports);
18
- __exportStar(require("./GetAllModels"), exports);
19
- __exportStar(require("./DeleteModel"), exports);
20
- __exportStar(require("./UpdateModel"), exports);