@alba-cars/common-modules 1.3.1 → 1.3.2

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.
@@ -2,6 +2,7 @@ import { LeadStatus } from "../enum/lead_status_type";
2
2
  import { LeadSource } from "../enum/lead_source_status_types";
3
3
  import { LeadPreferencesDTO } from "./lead_prefernce_dto";
4
4
  export declare class LeadDTO {
5
+ id?: string;
5
6
  firstName: string;
6
7
  lastName: string;
7
8
  email?: string;
@@ -17,8 +18,9 @@ export declare class LeadDTO {
17
18
  isTestDriveScheduled: boolean;
18
19
  testDriveDate?: Date;
19
20
  isActive: boolean;
20
- createdAt: Date;
21
- updatedAt: Date;
22
21
  lastContactedAt?: Date;
23
- preference: LeadPreferencesDTO;
22
+ preference?: LeadPreferencesDTO;
23
+ validate(): string[];
24
+ static fromPlain(plain: Record<string, unknown>): LeadDTO;
25
+ toPlain(): Record<string, unknown>;
24
26
  }
@@ -11,8 +11,24 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.LeadDTO = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const lead_prefernce_dto_1 = require("./lead_prefernce_dto");
15
+ const class_transformer_1 = require("class-transformer");
14
16
  class LeadDTO {
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)(LeadDTO, plain);
23
+ }
24
+ toPlain() {
25
+ return (0, class_transformer_1.classToPlain)(this);
26
+ }
15
27
  }
28
+ __decorate([
29
+ (0, class_validator_1.IsUUID)(),
30
+ __metadata("design:type", String)
31
+ ], LeadDTO.prototype, "id", void 0);
16
32
  __decorate([
17
33
  (0, class_validator_1.IsString)(),
18
34
  __metadata("design:type", String)
@@ -75,17 +91,13 @@ __decorate([
75
91
  (0, class_validator_1.IsOptional)(),
76
92
  __metadata("design:type", Boolean)
77
93
  ], LeadDTO.prototype, "isActive", void 0);
78
- __decorate([
79
- (0, class_validator_1.IsDate)(),
80
- __metadata("design:type", Date)
81
- ], LeadDTO.prototype, "createdAt", void 0);
82
- __decorate([
83
- (0, class_validator_1.IsDate)(),
84
- __metadata("design:type", Date)
85
- ], LeadDTO.prototype, "updatedAt", void 0);
86
94
  __decorate([
87
95
  (0, class_validator_1.IsDate)(),
88
96
  (0, class_validator_1.IsOptional)(),
89
97
  __metadata("design:type", Date)
90
98
  ], LeadDTO.prototype, "lastContactedAt", void 0);
99
+ __decorate([
100
+ (0, class_validator_1.IsOptional)(),
101
+ __metadata("design:type", lead_prefernce_dto_1.LeadPreferencesDTO)
102
+ ], LeadDTO.prototype, "preference", void 0);
91
103
  exports.LeadDTO = LeadDTO;
@@ -224,6 +224,7 @@ export declare class VehicleOptions extends PaginationOptions {
224
224
  withBodyType?: boolean;
225
225
  withFeatures?: boolean;
226
226
  withMetaData?: boolean;
227
+ withFinance?: boolean;
227
228
  validate(): string[];
228
229
  static fromPlain(plain: Record<string, unknown>): VehicleOptions;
229
230
  static toPlain(entity: any): Record<string, unknown>;
@@ -1,6 +1,7 @@
1
1
  import { VehicleMediaType } from "../enums";
2
2
  import { FileInput } from "../../../../core";
3
3
  export declare class VehicleMediaCreateDTO {
4
+ vehicleId: string;
4
5
  mediaType: VehicleMediaType;
5
6
  mediaUrl: string;
6
7
  placeholder: string;
@@ -25,6 +25,10 @@ class VehicleMediaCreateDTO {
25
25
  return (0, class_transformer_1.instanceToPlain)(entity);
26
26
  }
27
27
  }
28
+ __decorate([
29
+ (0, class_validator_1.IsString)({ each: true }),
30
+ __metadata("design:type", String)
31
+ ], VehicleMediaCreateDTO.prototype, "vehicleId", void 0);
28
32
  __decorate([
29
33
  (0, class_validator_1.IsEnum)(enums_1.VehicleMediaType),
30
34
  __metadata("design:type", String)