@alba-cars/common-modules 1.6.3 → 1.6.5

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.
@@ -1,4 +1,5 @@
1
1
  import { PaginationOptions } from "../../../../global";
2
+ import { VehicleMediaCreateDTO } from "../../../vehicle";
2
3
  export declare enum RequestType {
3
4
  SELL = "sell",
4
5
  TRADE_IN = "trade_in"
@@ -59,11 +60,14 @@ export declare class SellCarRequestCreateDTO {
59
60
  city: string;
60
61
  emirates: string;
61
62
  engineCylinderCount: number;
62
- requestType?: RequestType;
63
63
  specification: string;
64
64
  specificationName: string;
65
+ requestType?: RequestType;
65
66
  tradeIn: TradeInOption;
66
67
  vehicleOptions: VehicleOption;
68
+ additionalDetails?: string;
69
+ dealDriveEstimation?: number;
70
+ media?: VehicleMediaCreateDTO[];
67
71
  validate(): string[];
68
72
  static fromPlain(plain: Record<string, unknown>): SellCarRequestCreateDTO;
69
73
  toPlain(): Record<string, unknown>;
@@ -109,47 +113,37 @@ export declare class SellCarRequestUpdateDTO {
109
113
  }
110
114
  export declare class SellCarRequestResponseDTO {
111
115
  id: string;
116
+ refId: number;
112
117
  name: string;
113
118
  phone: string;
114
- email?: string;
119
+ brand: string;
115
120
  brandName: string;
116
- marketPrice?: string;
121
+ model: string;
117
122
  modelName: string;
118
123
  modelVersion: string;
119
124
  modelVersionName: string;
120
- mileage: number;
125
+ trim: string;
126
+ trimName: string;
121
127
  year: string;
128
+ mileage: number;
122
129
  expectedSellingPrice: number;
123
- specification?: string;
124
- images?: string[];
125
- desiredVehicle?: {
126
- id: string;
127
- make: string;
128
- model: string;
129
- year: number;
130
- };
131
- color?: string;
132
- transmission?: string;
133
- condition?: string;
134
- fuelType?: string;
135
- engineCapacity?: string;
136
- description?: string;
137
- status: "pending" | "inspection_scheduled" | "inspected" | "valued" | "approved" | "rejected" | "completed";
138
- additionalDetails?: {
139
- serviceHistory?: boolean;
140
- numberOfOwners?: number;
141
- accidentHistory?: boolean;
142
- modifications?: string[];
143
- lastServiceDate?: Date;
144
- warrantyValid?: boolean;
145
- tradeIn?: boolean;
146
- inspectionDate?: Date;
147
- inspectionLocation?: string;
148
- finalTradeInOffer?: number;
149
- [key: string]: any;
150
- };
151
- createdAt: Date;
152
- updatedAt: Date;
130
+ description: string;
131
+ city: string;
132
+ emirates: string;
133
+ engineCylinderCount: number;
134
+ specification: string;
135
+ specificationName: string;
136
+ requestType?: RequestType;
137
+ tradeIn: TradeInOption;
138
+ vehicleOptions: VehicleOption;
139
+ dealDriveEstimation?: number;
140
+ additionalDetails?: string;
141
+ isDeleted: boolean;
142
+ isActive: boolean;
143
+ media?: VehicleMediaCreateDTO[];
144
+ createdById?: string | null;
145
+ updatedById?: string | null;
146
+ deletedById?: string | null;
153
147
  validate(): string[];
154
148
  static fromPlain(plain: Record<string, unknown>): SellCarRequestResponseDTO;
155
149
  toPlain(): Record<string, unknown>;
@@ -12,7 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SellCarFetchDTO = exports.SellCarOptionsDTO = exports.SellCarFilterDTO = exports.SellCarRequestResponseDTO = exports.SellCarRequestUpdateDTO = exports.SellCarRequestCreateDTO = exports.SellCarRequestDTO = exports.VehicleOption = exports.TradeInOption = exports.RequestType = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const class_transformer_1 = require("class-transformer");
15
+ const class_transformer_2 = require("class-transformer");
15
16
  const global_1 = require("../../../../global");
17
+ const vehicle_1 = require("../../../vehicle");
16
18
  var RequestType;
17
19
  (function (RequestType) {
18
20
  RequestType["SELL"] = "sell";
@@ -159,6 +161,7 @@ class SellCarRequestCreateDTO {
159
161
  }
160
162
  __decorate([
161
163
  (0, class_validator_1.IsString)(),
164
+ (0, class_validator_1.IsNotEmpty)(),
162
165
  __metadata("design:type", String)
163
166
  ], SellCarRequestCreateDTO.prototype, "name", void 0);
164
167
  __decorate([
@@ -226,11 +229,6 @@ __decorate([
226
229
  (0, class_validator_1.IsNumber)(),
227
230
  __metadata("design:type", Number)
228
231
  ], SellCarRequestCreateDTO.prototype, "engineCylinderCount", void 0);
229
- __decorate([
230
- (0, class_validator_1.IsOptional)(),
231
- (0, class_validator_1.IsEnum)(RequestType),
232
- __metadata("design:type", String)
233
- ], SellCarRequestCreateDTO.prototype, "requestType", void 0);
234
232
  __decorate([
235
233
  (0, class_validator_1.IsString)(),
236
234
  __metadata("design:type", String)
@@ -239,6 +237,11 @@ __decorate([
239
237
  (0, class_validator_1.IsString)(),
240
238
  __metadata("design:type", String)
241
239
  ], SellCarRequestCreateDTO.prototype, "specificationName", void 0);
240
+ __decorate([
241
+ (0, class_validator_1.IsEnum)(RequestType),
242
+ (0, class_validator_1.IsOptional)(),
243
+ __metadata("design:type", String)
244
+ ], SellCarRequestCreateDTO.prototype, "requestType", void 0);
242
245
  __decorate([
243
246
  (0, class_validator_1.IsEnum)(TradeInOption),
244
247
  __metadata("design:type", String)
@@ -247,6 +250,22 @@ __decorate([
247
250
  (0, class_validator_1.IsEnum)(VehicleOption),
248
251
  __metadata("design:type", String)
249
252
  ], SellCarRequestCreateDTO.prototype, "vehicleOptions", void 0);
253
+ __decorate([
254
+ (0, class_validator_1.IsString)(),
255
+ (0, class_validator_1.IsOptional)(),
256
+ __metadata("design:type", String)
257
+ ], SellCarRequestCreateDTO.prototype, "additionalDetails", void 0);
258
+ __decorate([
259
+ (0, class_validator_1.IsNumber)(),
260
+ (0, class_validator_1.IsOptional)(),
261
+ __metadata("design:type", Number)
262
+ ], SellCarRequestCreateDTO.prototype, "dealDriveEstimation", void 0);
263
+ __decorate([
264
+ (0, class_validator_1.ValidateNested)({ each: true }),
265
+ (0, class_transformer_2.Type)(() => vehicle_1.VehicleMediaCreateDTO),
266
+ (0, class_validator_1.IsOptional)(),
267
+ __metadata("design:type", Array)
268
+ ], SellCarRequestCreateDTO.prototype, "media", void 0);
250
269
  exports.SellCarRequestCreateDTO = SellCarRequestCreateDTO;
251
270
  class SellCarRequestUpdateDTO {
252
271
  validate() {
@@ -398,8 +417,13 @@ __decorate([
398
417
  (0, class_validator_1.IsString)(),
399
418
  __metadata("design:type", String)
400
419
  ], SellCarRequestResponseDTO.prototype, "id", void 0);
420
+ __decorate([
421
+ (0, class_validator_1.IsNumber)(),
422
+ __metadata("design:type", Number)
423
+ ], SellCarRequestResponseDTO.prototype, "refId", void 0);
401
424
  __decorate([
402
425
  (0, class_validator_1.IsString)(),
426
+ (0, class_validator_1.IsNotEmpty)(),
403
427
  __metadata("design:type", String)
404
428
  ], SellCarRequestResponseDTO.prototype, "name", void 0);
405
429
  __decorate([
@@ -408,19 +432,17 @@ __decorate([
408
432
  __metadata("design:type", String)
409
433
  ], SellCarRequestResponseDTO.prototype, "phone", void 0);
410
434
  __decorate([
411
- (0, class_validator_1.IsEmail)(),
412
- (0, class_validator_1.IsOptional)(),
435
+ (0, class_validator_1.IsString)(),
413
436
  __metadata("design:type", String)
414
- ], SellCarRequestResponseDTO.prototype, "email", void 0);
437
+ ], SellCarRequestResponseDTO.prototype, "brand", void 0);
415
438
  __decorate([
416
439
  (0, class_validator_1.IsString)(),
417
440
  __metadata("design:type", String)
418
441
  ], SellCarRequestResponseDTO.prototype, "brandName", void 0);
419
442
  __decorate([
420
443
  (0, class_validator_1.IsString)(),
421
- (0, class_validator_1.IsOptional)(),
422
444
  __metadata("design:type", String)
423
- ], SellCarRequestResponseDTO.prototype, "marketPrice", void 0);
445
+ ], SellCarRequestResponseDTO.prototype, "model", void 0);
424
446
  __decorate([
425
447
  (0, class_validator_1.IsString)(),
426
448
  __metadata("design:type", String)
@@ -434,79 +456,101 @@ __decorate([
434
456
  __metadata("design:type", String)
435
457
  ], SellCarRequestResponseDTO.prototype, "modelVersionName", void 0);
436
458
  __decorate([
437
- (0, class_validator_1.IsNumber)(),
438
- __metadata("design:type", Number)
439
- ], SellCarRequestResponseDTO.prototype, "mileage", void 0);
459
+ (0, class_validator_1.IsString)(),
460
+ __metadata("design:type", String)
461
+ ], SellCarRequestResponseDTO.prototype, "trim", void 0);
462
+ __decorate([
463
+ (0, class_validator_1.IsString)(),
464
+ __metadata("design:type", String)
465
+ ], SellCarRequestResponseDTO.prototype, "trimName", void 0);
440
466
  __decorate([
441
467
  (0, class_validator_1.IsString)(),
442
468
  __metadata("design:type", String)
443
469
  ], SellCarRequestResponseDTO.prototype, "year", void 0);
470
+ __decorate([
471
+ (0, class_validator_1.IsNumber)(),
472
+ __metadata("design:type", Number)
473
+ ], SellCarRequestResponseDTO.prototype, "mileage", void 0);
444
474
  __decorate([
445
475
  (0, class_validator_1.IsNumber)(),
446
476
  __metadata("design:type", Number)
447
477
  ], SellCarRequestResponseDTO.prototype, "expectedSellingPrice", void 0);
448
478
  __decorate([
449
479
  (0, class_validator_1.IsString)(),
450
- (0, class_validator_1.IsOptional)(),
451
480
  __metadata("design:type", String)
452
- ], SellCarRequestResponseDTO.prototype, "specification", void 0);
453
- __decorate([
454
- (0, class_validator_1.IsArray)(),
455
- (0, class_validator_1.IsString)({ each: true }),
456
- (0, class_validator_1.IsOptional)(),
457
- __metadata("design:type", Array)
458
- ], SellCarRequestResponseDTO.prototype, "images", void 0);
459
- __decorate([
460
- (0, class_validator_1.IsOptional)(),
461
- __metadata("design:type", Object)
462
- ], SellCarRequestResponseDTO.prototype, "desiredVehicle", void 0);
481
+ ], SellCarRequestResponseDTO.prototype, "description", void 0);
463
482
  __decorate([
464
483
  (0, class_validator_1.IsString)(),
465
- (0, class_validator_1.IsOptional)(),
466
484
  __metadata("design:type", String)
467
- ], SellCarRequestResponseDTO.prototype, "color", void 0);
485
+ ], SellCarRequestResponseDTO.prototype, "city", void 0);
468
486
  __decorate([
469
487
  (0, class_validator_1.IsString)(),
470
- (0, class_validator_1.IsOptional)(),
471
488
  __metadata("design:type", String)
472
- ], SellCarRequestResponseDTO.prototype, "transmission", void 0);
489
+ ], SellCarRequestResponseDTO.prototype, "emirates", void 0);
490
+ __decorate([
491
+ (0, class_validator_1.IsNumber)(),
492
+ __metadata("design:type", Number)
493
+ ], SellCarRequestResponseDTO.prototype, "engineCylinderCount", void 0);
473
494
  __decorate([
474
495
  (0, class_validator_1.IsString)(),
475
- (0, class_validator_1.IsOptional)(),
476
496
  __metadata("design:type", String)
477
- ], SellCarRequestResponseDTO.prototype, "condition", void 0);
497
+ ], SellCarRequestResponseDTO.prototype, "specification", void 0);
478
498
  __decorate([
479
499
  (0, class_validator_1.IsString)(),
500
+ __metadata("design:type", String)
501
+ ], SellCarRequestResponseDTO.prototype, "specificationName", void 0);
502
+ __decorate([
503
+ (0, class_validator_1.IsEnum)(RequestType),
480
504
  (0, class_validator_1.IsOptional)(),
481
505
  __metadata("design:type", String)
482
- ], SellCarRequestResponseDTO.prototype, "fuelType", void 0);
506
+ ], SellCarRequestResponseDTO.prototype, "requestType", void 0);
507
+ __decorate([
508
+ (0, class_validator_1.IsEnum)(TradeInOption),
509
+ __metadata("design:type", String)
510
+ ], SellCarRequestResponseDTO.prototype, "tradeIn", void 0);
511
+ __decorate([
512
+ (0, class_validator_1.IsEnum)(VehicleOption),
513
+ __metadata("design:type", String)
514
+ ], SellCarRequestResponseDTO.prototype, "vehicleOptions", void 0);
515
+ __decorate([
516
+ (0, class_validator_1.IsNumber)(),
517
+ (0, class_validator_1.IsOptional)(),
518
+ __metadata("design:type", Number)
519
+ ], SellCarRequestResponseDTO.prototype, "dealDriveEstimation", void 0);
483
520
  __decorate([
484
521
  (0, class_validator_1.IsString)(),
485
522
  (0, class_validator_1.IsOptional)(),
486
523
  __metadata("design:type", String)
487
- ], SellCarRequestResponseDTO.prototype, "engineCapacity", void 0);
524
+ ], SellCarRequestResponseDTO.prototype, "additionalDetails", void 0);
525
+ __decorate([
526
+ (0, class_validator_1.IsBoolean)(),
527
+ __metadata("design:type", Boolean)
528
+ ], SellCarRequestResponseDTO.prototype, "isDeleted", void 0);
529
+ __decorate([
530
+ (0, class_validator_1.IsBoolean)(),
531
+ __metadata("design:type", Boolean)
532
+ ], SellCarRequestResponseDTO.prototype, "isActive", void 0);
533
+ __decorate([
534
+ (0, class_validator_1.ValidateNested)({ each: true }),
535
+ (0, class_transformer_2.Type)(() => vehicle_1.VehicleMediaCreateDTO),
536
+ (0, class_validator_1.IsOptional)(),
537
+ __metadata("design:type", Array)
538
+ ], SellCarRequestResponseDTO.prototype, "media", void 0);
488
539
  __decorate([
489
540
  (0, class_validator_1.IsString)(),
490
541
  (0, class_validator_1.IsOptional)(),
491
- __metadata("design:type", String)
492
- ], SellCarRequestResponseDTO.prototype, "description", void 0);
542
+ __metadata("design:type", Object)
543
+ ], SellCarRequestResponseDTO.prototype, "createdById", void 0);
493
544
  __decorate([
494
545
  (0, class_validator_1.IsString)(),
495
- (0, class_validator_1.IsEnum)([
496
- "pending",
497
- "inspection_scheduled",
498
- "inspected",
499
- "valued",
500
- "approved",
501
- "rejected",
502
- "completed",
503
- ]),
504
- __metadata("design:type", String)
505
- ], SellCarRequestResponseDTO.prototype, "status", void 0);
546
+ (0, class_validator_1.IsOptional)(),
547
+ __metadata("design:type", Object)
548
+ ], SellCarRequestResponseDTO.prototype, "updatedById", void 0);
506
549
  __decorate([
550
+ (0, class_validator_1.IsString)(),
507
551
  (0, class_validator_1.IsOptional)(),
508
552
  __metadata("design:type", Object)
509
- ], SellCarRequestResponseDTO.prototype, "additionalDetails", void 0);
553
+ ], SellCarRequestResponseDTO.prototype, "deletedById", void 0);
510
554
  exports.SellCarRequestResponseDTO = SellCarRequestResponseDTO;
511
555
  class SellCarFilterDTO {
512
556
  validate() {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.6.3",
6
+ "version": "1.6.5",
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",
@@ -17,7 +17,8 @@
17
17
  "build": "tsc",
18
18
  "prepare": "npm run build",
19
19
  "dev": "tsc --watch",
20
- "test": "jest"
20
+ "test": "jest",
21
+ "publish": "npm i && npm run build && npm publish"
21
22
  },
22
23
  "keywords": [
23
24
  "DTO",