@alba-cars/common-modules 1.2.9 → 1.3.1
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/index.d.ts +0 -1
- package/dist/core/error-handling/index.js +0 -1
- package/dist/core/network/endpoint-config.d.ts +26 -5
- package/dist/core/network/endpoint-config.js +9 -0
- package/dist/features/blog/data/dto/BlogDTO.d.ts +5 -2
- package/dist/features/blog/data/dto/BlogDTO.js +15 -7
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.js +1 -0
- package/dist/features/lead/data/dto/lead_dto.d.ts +24 -0
- package/dist/features/lead/data/dto/lead_dto.js +91 -0
- package/dist/features/lead/data/dto/lead_prefernce_dto.d.ts +11 -0
- package/dist/features/lead/data/dto/lead_prefernce_dto.js +59 -0
- package/dist/features/lead/data/enum/lead_source_status_types.d.ts +8 -0
- package/dist/features/lead/data/enum/lead_source_status_types.js +12 -0
- package/dist/features/lead/data/enum/lead_status_type.d.ts +8 -0
- package/dist/features/lead/data/enum/lead_status_type.js +12 -0
- package/dist/features/vehicle/data/dto/SimilarVehicleDTO.d.ts +8 -0
- package/dist/features/vehicle/data/dto/SimilarVehicleDTO.js +28 -0
- package/dist/features/vehicle/data/dto/index.d.ts +1 -0
- package/dist/features/vehicle/data/dto/index.js +1 -0
- package/dist/features/vehicle/data/models/Vehicle.d.ts +1 -0
- package/dist/features/vehicle/data/utilities.d.ts +1 -0
- package/dist/features/vehicle-reservations/data/dto/VehicleReservationDTO.d.ts +91 -0
- package/dist/features/vehicle-reservations/data/dto/VehicleReservationDTO.js +311 -0
- package/dist/features/vehicle-reservations/data/dto/index.d.ts +1 -0
- package/dist/features/vehicle-reservations/data/dto/index.js +17 -0
- package/dist/features/vehicle-reservations/data/enums/finance-type.d.ts +5 -0
- package/dist/features/vehicle-reservations/data/enums/finance-type.js +9 -0
- package/dist/features/vehicle-reservations/data/enums/index.d.ts +3 -0
- package/dist/features/vehicle-reservations/data/enums/index.js +19 -0
- package/dist/features/vehicle-reservations/data/enums/reservation-type.d.ts +9 -0
- package/dist/features/vehicle-reservations/data/enums/reservation-type.js +13 -0
- package/dist/features/vehicle-reservations/data/enums/vehicle-reservation-type.d.ts +4 -0
- package/dist/features/vehicle-reservations/data/enums/vehicle-reservation-type.js +8 -0
- package/dist/features/vehicle-reservations/index.d.ts +2 -0
- package/dist/features/vehicle-reservations/index.js +18 -0
- package/package.json +1 -1
|
@@ -3,15 +3,36 @@ interface BaseEndpoint {
|
|
|
3
3
|
getAll: string | EndpointFunction;
|
|
4
4
|
create: string | EndpointFunction;
|
|
5
5
|
getOne: EndpointFunction;
|
|
6
|
-
getOneBySlug?: EndpointFunction;
|
|
7
6
|
deleteOne: EndpointFunction;
|
|
8
7
|
updateOne: EndpointFunction;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
interface VehicleEndpoints extends BaseEndpoint {
|
|
10
|
+
getSimilar: EndpointFunction;
|
|
11
|
+
getOneBySlug: EndpointFunction;
|
|
12
|
+
}
|
|
13
|
+
interface BlogEndpoints extends BaseEndpoint {
|
|
14
|
+
getOneBySlug: EndpointFunction;
|
|
15
|
+
}
|
|
16
|
+
type APIEndpointType = {
|
|
17
|
+
vehicle: VehicleEndpoints;
|
|
18
|
+
blogs: BlogEndpoints;
|
|
19
|
+
vehicleDetails: BaseEndpoint;
|
|
20
|
+
vehicleFinance: BaseEndpoint;
|
|
21
|
+
TestDrive: BaseEndpoint;
|
|
22
|
+
vehicleMake: BaseEndpoint;
|
|
23
|
+
vehicleModel: BaseEndpoint;
|
|
24
|
+
vehicleMeta: BaseEndpoint;
|
|
25
|
+
vehicleInspection: BaseEndpoint;
|
|
26
|
+
vehicleOrder: BaseEndpoint;
|
|
27
|
+
vehicleType: BaseEndpoint;
|
|
28
|
+
carOptions: BaseEndpoint;
|
|
29
|
+
payment: BaseEndpoint;
|
|
30
|
+
agents: BaseEndpoint;
|
|
31
|
+
showroomVisit: BaseEndpoint;
|
|
32
|
+
sellCarRequest: BaseEndpoint;
|
|
33
|
+
financeEligibilityRequest: BaseEndpoint;
|
|
34
|
+
vehicleReservations: BaseEndpoint;
|
|
12
35
|
};
|
|
13
|
-
type APIEndpointKeys = "vehicle" | "vehicleDetails" | "vehicleFinance" | "TestDrive" | "vehicleMake" | "vehicleModel" | "vehicleMeta" | "vehicleInspection" | "vehicleOrder" | "vehicleType" | "carOptions" | "payment" | "agents" | "blogs" | "showroomVisit" | "sellCarRequest" | "financeEligibilityRequest";
|
|
14
|
-
type APIEndpointType = Record<APIEndpointKeys, ExtendedEndpoint>;
|
|
15
36
|
export declare const API_ENDPOINTS: APIEndpointType;
|
|
16
37
|
export declare const UTIL_ENDPOINTS: {
|
|
17
38
|
media: {
|
|
@@ -6,6 +6,8 @@ exports.API_ENDPOINTS = {
|
|
|
6
6
|
getAll: `/vehicle`,
|
|
7
7
|
create: `/vehicle`,
|
|
8
8
|
getOne: (id) => `/vehicle/${id}`,
|
|
9
|
+
getOneBySlug: (slug) => `/vehicle/slug/${slug}`,
|
|
10
|
+
getSimilar: (id) => `/vehicle/similar/${id}`,
|
|
9
11
|
deleteOne: (id) => `/vehicle/${id}`,
|
|
10
12
|
updateOne: (id) => `/vehicle/${id}`,
|
|
11
13
|
},
|
|
@@ -122,6 +124,13 @@ exports.API_ENDPOINTS = {
|
|
|
122
124
|
deleteOne: (id) => `/finance-eligibility-request/${id}`,
|
|
123
125
|
updateOne: (id) => `/finance-eligibility-request/${id}`,
|
|
124
126
|
},
|
|
127
|
+
vehicleReservations: {
|
|
128
|
+
getAll: `/vehicle-reservation`,
|
|
129
|
+
create: `/vehicle-reservation`,
|
|
130
|
+
getOne: (id) => `/vehicle-reservation/${id}`,
|
|
131
|
+
deleteOne: (id) => `/vehicle-reservation/${id}`,
|
|
132
|
+
updateOne: (id) => `/vehicle-reservation/${id}`,
|
|
133
|
+
}
|
|
125
134
|
};
|
|
126
135
|
exports.UTIL_ENDPOINTS = {
|
|
127
136
|
media: {
|
|
@@ -2,6 +2,7 @@ export declare class BlogGetDTO {
|
|
|
2
2
|
id: string;
|
|
3
3
|
title: string;
|
|
4
4
|
description: string;
|
|
5
|
+
content: string;
|
|
5
6
|
date: Date;
|
|
6
7
|
imageLink: string;
|
|
7
8
|
imageAlt: string;
|
|
@@ -16,7 +17,8 @@ export declare class BlogGetDTO {
|
|
|
16
17
|
export declare class BlogCreateDTO {
|
|
17
18
|
title: string;
|
|
18
19
|
description: string;
|
|
19
|
-
|
|
20
|
+
content: string;
|
|
21
|
+
date: string;
|
|
20
22
|
imageLink: string;
|
|
21
23
|
imageAlt: string;
|
|
22
24
|
metaDescription: string;
|
|
@@ -29,7 +31,8 @@ export declare class BlogCreateDTO {
|
|
|
29
31
|
export declare class BlogUpdateDTO {
|
|
30
32
|
title?: string;
|
|
31
33
|
description?: string;
|
|
32
|
-
|
|
34
|
+
content?: string;
|
|
35
|
+
date?: string;
|
|
33
36
|
imageLink?: string;
|
|
34
37
|
imageAlt?: string;
|
|
35
38
|
metaDescription?: string;
|
|
@@ -23,11 +23,11 @@ class BlogGetDTO {
|
|
|
23
23
|
exports.BlogGetDTO = BlogGetDTO;
|
|
24
24
|
class BlogCreateDTO {
|
|
25
25
|
constructor() {
|
|
26
|
-
this.status =
|
|
26
|
+
this.status = "draft";
|
|
27
27
|
}
|
|
28
28
|
validate() {
|
|
29
29
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
30
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
30
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
31
31
|
}
|
|
32
32
|
static fromPlain(plain) {
|
|
33
33
|
return (0, class_transformer_1.plainToClass)(BlogCreateDTO, plain);
|
|
@@ -42,8 +42,12 @@ __decorate([
|
|
|
42
42
|
__metadata("design:type", String)
|
|
43
43
|
], BlogCreateDTO.prototype, "description", void 0);
|
|
44
44
|
__decorate([
|
|
45
|
-
(0, class_validator_1.
|
|
46
|
-
__metadata("design:type",
|
|
45
|
+
(0, class_validator_1.IsString)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], BlogCreateDTO.prototype, "content", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsDateString)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
47
51
|
], BlogCreateDTO.prototype, "date", void 0);
|
|
48
52
|
__decorate([
|
|
49
53
|
(0, class_validator_1.IsString)(),
|
|
@@ -74,7 +78,7 @@ exports.BlogCreateDTO = BlogCreateDTO;
|
|
|
74
78
|
class BlogUpdateDTO {
|
|
75
79
|
validate() {
|
|
76
80
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
77
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
81
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
78
82
|
}
|
|
79
83
|
static fromPlain(plain) {
|
|
80
84
|
return (0, class_transformer_1.plainToClass)(BlogUpdateDTO, plain);
|
|
@@ -90,10 +94,14 @@ __decorate([
|
|
|
90
94
|
(0, class_validator_1.IsString)(),
|
|
91
95
|
__metadata("design:type", String)
|
|
92
96
|
], BlogUpdateDTO.prototype, "description", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, class_validator_1.IsString)(),
|
|
99
|
+
__metadata("design:type", String)
|
|
100
|
+
], BlogUpdateDTO.prototype, "content", void 0);
|
|
93
101
|
__decorate([
|
|
94
102
|
(0, class_validator_1.IsOptional)(),
|
|
95
|
-
(0, class_validator_1.
|
|
96
|
-
__metadata("design:type",
|
|
103
|
+
(0, class_validator_1.IsDateString)(),
|
|
104
|
+
__metadata("design:type", String)
|
|
97
105
|
], BlogUpdateDTO.prototype, "date", void 0);
|
|
98
106
|
__decorate([
|
|
99
107
|
(0, class_validator_1.IsOptional)(),
|
package/dist/features/index.d.ts
CHANGED
package/dist/features/index.js
CHANGED
|
@@ -22,3 +22,4 @@ __exportStar(require("./test-drive-request"), exports);
|
|
|
22
22
|
__exportStar(require("./vehicle"), exports);
|
|
23
23
|
__exportStar(require("./sell-call-request"), exports);
|
|
24
24
|
__exportStar(require("./finance-eligibilty-request"), exports);
|
|
25
|
+
__exportStar(require("./vehicle-reservations"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LeadStatus } from "../enum/lead_status_type";
|
|
2
|
+
import { LeadSource } from "../enum/lead_source_status_types";
|
|
3
|
+
import { LeadPreferencesDTO } from "./lead_prefernce_dto";
|
|
4
|
+
export declare class LeadDTO {
|
|
5
|
+
firstName: string;
|
|
6
|
+
lastName: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
phone: string;
|
|
9
|
+
alternatePhone?: string;
|
|
10
|
+
address?: string;
|
|
11
|
+
city?: string;
|
|
12
|
+
state?: string;
|
|
13
|
+
zipCode?: string;
|
|
14
|
+
status: LeadStatus;
|
|
15
|
+
notes?: string;
|
|
16
|
+
leadSource: LeadSource;
|
|
17
|
+
isTestDriveScheduled: boolean;
|
|
18
|
+
testDriveDate?: Date;
|
|
19
|
+
isActive: boolean;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
lastContactedAt?: Date;
|
|
23
|
+
preference: LeadPreferencesDTO;
|
|
24
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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.LeadDTO = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class LeadDTO {
|
|
15
|
+
}
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, class_validator_1.IsString)(),
|
|
18
|
+
__metadata("design:type", String)
|
|
19
|
+
], LeadDTO.prototype, "firstName", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], LeadDTO.prototype, "lastName", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsOptional)(),
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], LeadDTO.prototype, "email", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], LeadDTO.prototype, "phone", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], LeadDTO.prototype, "alternatePhone", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], LeadDTO.prototype, "address", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_validator_1.IsString)(),
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], LeadDTO.prototype, "city", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
(0, class_validator_1.IsOptional)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], LeadDTO.prototype, "state", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsString)(),
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], LeadDTO.prototype, "zipCode", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsString)(),
|
|
60
|
+
(0, class_validator_1.IsOptional)(),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], LeadDTO.prototype, "notes", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsBoolean)(),
|
|
65
|
+
(0, class_validator_1.IsOptional)(),
|
|
66
|
+
__metadata("design:type", Boolean)
|
|
67
|
+
], LeadDTO.prototype, "isTestDriveScheduled", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, class_validator_1.IsString)(),
|
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], LeadDTO.prototype, "testDriveDate", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_validator_1.IsBoolean)(),
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
__metadata("design:type", Boolean)
|
|
77
|
+
], 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
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.IsDate)(),
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
__metadata("design:type", Date)
|
|
90
|
+
], LeadDTO.prototype, "lastContactedAt", void 0);
|
|
91
|
+
exports.LeadDTO = LeadDTO;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class LeadPreferencesDTO {
|
|
2
|
+
budgetMin?: number;
|
|
3
|
+
budgetMax?: number;
|
|
4
|
+
preferredMake?: string;
|
|
5
|
+
preferredModel?: string;
|
|
6
|
+
preferredYearMin?: number;
|
|
7
|
+
preferredYearMax?: number;
|
|
8
|
+
preferredColors?: string[];
|
|
9
|
+
preferredFeatures?: string[];
|
|
10
|
+
additionalPreferences?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.LeadPreferencesDTO = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class LeadPreferencesDTO {
|
|
15
|
+
}
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, class_validator_1.IsOptional)(),
|
|
18
|
+
(0, class_validator_1.IsNumber)(),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], LeadPreferencesDTO.prototype, "budgetMin", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsOptional)(),
|
|
23
|
+
(0, class_validator_1.IsNumber)(),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], LeadPreferencesDTO.prototype, "budgetMax", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], LeadPreferencesDTO.prototype, "preferredMake", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], LeadPreferencesDTO.prototype, "preferredModel", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.IsNumber)(),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], LeadPreferencesDTO.prototype, "preferredYearMin", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
(0, class_validator_1.IsNumber)(),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], LeadPreferencesDTO.prototype, "preferredYearMax", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
__metadata("design:type", Array)
|
|
49
|
+
], LeadPreferencesDTO.prototype, "preferredColors", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], LeadPreferencesDTO.prototype, "preferredFeatures", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
(0, class_validator_1.IsString)(),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], LeadPreferencesDTO.prototype, "additionalPreferences", void 0);
|
|
59
|
+
exports.LeadPreferencesDTO = LeadPreferencesDTO;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LeadSource = void 0;
|
|
4
|
+
var LeadSource;
|
|
5
|
+
(function (LeadSource) {
|
|
6
|
+
LeadSource["WEBSITE"] = "WEBSITE";
|
|
7
|
+
LeadSource["PHONE"] = "PHONE";
|
|
8
|
+
LeadSource["WALK_IN"] = "WALK_IN";
|
|
9
|
+
LeadSource["REFERRAL"] = "REFERRAL";
|
|
10
|
+
LeadSource["SOCIAL_MEDIA"] = "SOCIAL_MEDIA";
|
|
11
|
+
LeadSource["OTHER"] = "OTHER";
|
|
12
|
+
})(LeadSource = exports.LeadSource || (exports.LeadSource = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LeadStatus = void 0;
|
|
4
|
+
var LeadStatus;
|
|
5
|
+
(function (LeadStatus) {
|
|
6
|
+
LeadStatus["NEW"] = "NEW";
|
|
7
|
+
LeadStatus["CONTACTED"] = "CONTACTED";
|
|
8
|
+
LeadStatus["QUALIFIED"] = "QUALIFIED";
|
|
9
|
+
LeadStatus["NEGOTIATING"] = "NEGOTIATING";
|
|
10
|
+
LeadStatus["CLOSED_WON"] = "CLOSED_WON";
|
|
11
|
+
LeadStatus["CLOSED_LOST"] = "CLOSED_LOST";
|
|
12
|
+
})(LeadStatus = exports.LeadStatus || (exports.LeadStatus = {}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetSimilarVehiclesDTO = void 0;
|
|
4
|
+
class GetSimilarVehiclesDTO {
|
|
5
|
+
static fromPlain(data) {
|
|
6
|
+
const dto = new GetSimilarVehiclesDTO();
|
|
7
|
+
dto.vehicleId = data.vehicleId;
|
|
8
|
+
dto.priceRange = data.priceRange;
|
|
9
|
+
dto.limit = data.limit;
|
|
10
|
+
dto.options = data.options;
|
|
11
|
+
return dto;
|
|
12
|
+
}
|
|
13
|
+
validate() {
|
|
14
|
+
const errors = [];
|
|
15
|
+
if (!this.vehicleId) {
|
|
16
|
+
errors.push("Vehicle ID is required");
|
|
17
|
+
}
|
|
18
|
+
if (this.priceRange !== undefined &&
|
|
19
|
+
(isNaN(this.priceRange) || this.priceRange < 0)) {
|
|
20
|
+
errors.push("Price range must be a positive number");
|
|
21
|
+
}
|
|
22
|
+
if (this.limit !== undefined && (isNaN(this.limit) || this.limit < 1)) {
|
|
23
|
+
errors.push("Limit must be a positive number");
|
|
24
|
+
}
|
|
25
|
+
return errors;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.GetSimilarVehiclesDTO = GetSimilarVehiclesDTO;
|
|
@@ -31,3 +31,4 @@ __exportStar(require("./VehicleCategoryDTO"), exports);
|
|
|
31
31
|
__exportStar(require("./MediaDTO"), exports);
|
|
32
32
|
__exportStar(require("./VehicleInspectionDTO"), exports);
|
|
33
33
|
__exportStar(require("./VehicleFilterDTO"), exports);
|
|
34
|
+
__exportStar(require("./SimilarVehicleDTO"), exports);
|
|
@@ -205,6 +205,7 @@ export declare class VehicleOptions extends PaginationOptions {
|
|
|
205
205
|
withBodyType?: boolean;
|
|
206
206
|
withFeatures?: boolean;
|
|
207
207
|
withMetaData?: boolean;
|
|
208
|
+
withFinance?: boolean;
|
|
208
209
|
validate?: (shouldValidate?: boolean) => string[];
|
|
209
210
|
constructor(shouldIncludeValidate?: boolean);
|
|
210
211
|
static fromPlain(plain: Record<string, unknown>): VehicleOptions;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { FinanceType } from "../enums/finance-type";
|
|
2
|
+
import { ReservationStatus } from "../enums/reservation-type";
|
|
3
|
+
import { Vehicle } from "../../../vehicle/data";
|
|
4
|
+
import { PaginationOptions } from "../../../../global";
|
|
5
|
+
export declare class CreateVehicleReservationDto {
|
|
6
|
+
leadId: string;
|
|
7
|
+
vehicleId: string;
|
|
8
|
+
financeType: FinanceType;
|
|
9
|
+
depositAmount?: number;
|
|
10
|
+
depositPaymentMethod?: string;
|
|
11
|
+
totalAmount?: number;
|
|
12
|
+
notes?: string;
|
|
13
|
+
assignedSalesRepId?: string;
|
|
14
|
+
bankName?: string;
|
|
15
|
+
loanAmount?: number;
|
|
16
|
+
loanTenureMonths?: number;
|
|
17
|
+
interestRate?: number;
|
|
18
|
+
validate(): string[];
|
|
19
|
+
static fromPlain(plain: Record<string, unknown>): CreateVehicleReservationDto;
|
|
20
|
+
toPlain(): Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
export declare class VehicleReservationDto {
|
|
23
|
+
leadId: string;
|
|
24
|
+
vehicleId: string;
|
|
25
|
+
financeType: FinanceType;
|
|
26
|
+
depositAmount?: number;
|
|
27
|
+
depositPaymentMethod?: string;
|
|
28
|
+
totalAmount?: number;
|
|
29
|
+
notes?: string;
|
|
30
|
+
assignedSalesRepId?: string;
|
|
31
|
+
bankName?: string;
|
|
32
|
+
loanAmount?: number;
|
|
33
|
+
loanTenureMonths?: number;
|
|
34
|
+
interestRate?: number;
|
|
35
|
+
validate(): string[];
|
|
36
|
+
static fromPlain(plain: Record<string, unknown>): CreateVehicleReservationDto;
|
|
37
|
+
toPlain(): Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
export declare class VehicleReservationResponseDto {
|
|
40
|
+
id: string;
|
|
41
|
+
leadId: string;
|
|
42
|
+
vehicle: Vehicle;
|
|
43
|
+
status: ReservationStatus;
|
|
44
|
+
financeType: FinanceType;
|
|
45
|
+
depositAmount: number;
|
|
46
|
+
isDepositPaid: boolean;
|
|
47
|
+
totalAmount?: number;
|
|
48
|
+
createdAt: Date;
|
|
49
|
+
updatedAt: Date;
|
|
50
|
+
}
|
|
51
|
+
export declare class UpdateVehicleReservationDto {
|
|
52
|
+
status?: ReservationStatus;
|
|
53
|
+
depositAmount?: number;
|
|
54
|
+
depositPaymentMethod?: string;
|
|
55
|
+
isDepositPaid?: boolean;
|
|
56
|
+
totalAmount?: number;
|
|
57
|
+
bankName?: string;
|
|
58
|
+
loanAmount?: number;
|
|
59
|
+
loanTenureMonths?: number;
|
|
60
|
+
notes?: string;
|
|
61
|
+
cancellationReason?: string;
|
|
62
|
+
assignedSalesRepId?: string;
|
|
63
|
+
financeRejectionReason?: string;
|
|
64
|
+
financeApprovedAt?: Date;
|
|
65
|
+
financeRejectedAt?: Date;
|
|
66
|
+
cancelledAt?: Date;
|
|
67
|
+
isActive?: boolean;
|
|
68
|
+
validate(): string[];
|
|
69
|
+
static fromPlain(plain: Record<string, unknown>): UpdateVehicleReservationDto;
|
|
70
|
+
toPlain(): Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
export declare class VehicleReservationsOptions extends PaginationOptions {
|
|
73
|
+
static fromPlain(plain: Record<string, unknown>): GetVehicleReservationsFilterDto;
|
|
74
|
+
toPlain(): Record<string, unknown>;
|
|
75
|
+
}
|
|
76
|
+
export declare class GetVehicleReservationsDTO {
|
|
77
|
+
filter: GetVehicleReservationsFilterDto;
|
|
78
|
+
options: VehicleReservationsOptions;
|
|
79
|
+
static fromPlain(plain: Record<string, unknown>): GetVehicleReservationsFilterDto;
|
|
80
|
+
toPlain(): Record<string, unknown>;
|
|
81
|
+
}
|
|
82
|
+
export declare class GetVehicleReservationsFilterDto {
|
|
83
|
+
status?: ReservationStatus;
|
|
84
|
+
financeType?: FinanceType;
|
|
85
|
+
vehicleId?: string;
|
|
86
|
+
leadId?: string;
|
|
87
|
+
isActive?: boolean;
|
|
88
|
+
validate(): string[];
|
|
89
|
+
static fromPlain(plain: Record<string, unknown>): GetVehicleReservationsFilterDto;
|
|
90
|
+
toPlain(): Record<string, unknown>;
|
|
91
|
+
}
|
|
@@ -0,0 +1,311 @@
|
|
|
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.GetVehicleReservationsFilterDto = exports.GetVehicleReservationsDTO = exports.VehicleReservationsOptions = exports.UpdateVehicleReservationDto = exports.VehicleReservationResponseDto = exports.VehicleReservationDto = exports.CreateVehicleReservationDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const finance_type_1 = require("../enums/finance-type");
|
|
15
|
+
const reservation_type_1 = require("../enums/reservation-type");
|
|
16
|
+
const class_transformer_1 = require("class-transformer");
|
|
17
|
+
const global_1 = require("../../../../global");
|
|
18
|
+
class CreateVehicleReservationDto {
|
|
19
|
+
validate() {
|
|
20
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
21
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
22
|
+
}
|
|
23
|
+
static fromPlain(plain) {
|
|
24
|
+
return (0, class_transformer_1.plainToClass)(CreateVehicleReservationDto, plain);
|
|
25
|
+
}
|
|
26
|
+
toPlain() {
|
|
27
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsUUID)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CreateVehicleReservationDto.prototype, "leadId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsUUID)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], CreateVehicleReservationDto.prototype, "vehicleId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsEnum)(finance_type_1.FinanceType),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], CreateVehicleReservationDto.prototype, "financeType", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsNumber)(),
|
|
44
|
+
(0, class_validator_1.Min)(0),
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], CreateVehicleReservationDto.prototype, "depositAmount", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
(0, class_validator_1.IsOptional)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], CreateVehicleReservationDto.prototype, "depositPaymentMethod", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsNumber)(),
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
__metadata("design:type", Number)
|
|
57
|
+
], CreateVehicleReservationDto.prototype, "totalAmount", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsString)(),
|
|
60
|
+
(0, class_validator_1.IsOptional)(),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], CreateVehicleReservationDto.prototype, "notes", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsUUID)(),
|
|
65
|
+
(0, class_validator_1.IsOptional)(),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], CreateVehicleReservationDto.prototype, "assignedSalesRepId", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, class_validator_1.IsString)(),
|
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], CreateVehicleReservationDto.prototype, "bankName", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_validator_1.IsNumber)(),
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
__metadata("design:type", Number)
|
|
77
|
+
], CreateVehicleReservationDto.prototype, "loanAmount", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsNumber)(),
|
|
80
|
+
(0, class_validator_1.IsOptional)(),
|
|
81
|
+
__metadata("design:type", Number)
|
|
82
|
+
], CreateVehicleReservationDto.prototype, "loanTenureMonths", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, class_validator_1.IsNumber)(),
|
|
85
|
+
(0, class_validator_1.IsOptional)(),
|
|
86
|
+
__metadata("design:type", Number)
|
|
87
|
+
], CreateVehicleReservationDto.prototype, "interestRate", void 0);
|
|
88
|
+
exports.CreateVehicleReservationDto = CreateVehicleReservationDto;
|
|
89
|
+
class VehicleReservationDto {
|
|
90
|
+
validate() {
|
|
91
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
92
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
93
|
+
}
|
|
94
|
+
static fromPlain(plain) {
|
|
95
|
+
return (0, class_transformer_1.plainToClass)(CreateVehicleReservationDto, plain);
|
|
96
|
+
}
|
|
97
|
+
toPlain() {
|
|
98
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, class_validator_1.IsUUID)(),
|
|
103
|
+
__metadata("design:type", String)
|
|
104
|
+
], VehicleReservationDto.prototype, "leadId", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, class_validator_1.IsUUID)(),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], VehicleReservationDto.prototype, "vehicleId", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, class_validator_1.IsEnum)(finance_type_1.FinanceType),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], VehicleReservationDto.prototype, "financeType", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, class_validator_1.IsNumber)(),
|
|
115
|
+
(0, class_validator_1.Min)(0),
|
|
116
|
+
(0, class_validator_1.IsOptional)(),
|
|
117
|
+
__metadata("design:type", Number)
|
|
118
|
+
], VehicleReservationDto.prototype, "depositAmount", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, class_validator_1.IsString)(),
|
|
121
|
+
(0, class_validator_1.IsOptional)(),
|
|
122
|
+
__metadata("design:type", String)
|
|
123
|
+
], VehicleReservationDto.prototype, "depositPaymentMethod", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, class_validator_1.IsNumber)(),
|
|
126
|
+
(0, class_validator_1.IsOptional)(),
|
|
127
|
+
__metadata("design:type", Number)
|
|
128
|
+
], VehicleReservationDto.prototype, "totalAmount", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, class_validator_1.IsString)(),
|
|
131
|
+
(0, class_validator_1.IsOptional)(),
|
|
132
|
+
__metadata("design:type", String)
|
|
133
|
+
], VehicleReservationDto.prototype, "notes", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, class_validator_1.IsUUID)(),
|
|
136
|
+
(0, class_validator_1.IsOptional)(),
|
|
137
|
+
__metadata("design:type", String)
|
|
138
|
+
], VehicleReservationDto.prototype, "assignedSalesRepId", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, class_validator_1.IsString)(),
|
|
141
|
+
(0, class_validator_1.IsOptional)(),
|
|
142
|
+
__metadata("design:type", String)
|
|
143
|
+
], VehicleReservationDto.prototype, "bankName", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, class_validator_1.IsNumber)(),
|
|
146
|
+
(0, class_validator_1.IsOptional)(),
|
|
147
|
+
__metadata("design:type", Number)
|
|
148
|
+
], VehicleReservationDto.prototype, "loanAmount", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, class_validator_1.IsNumber)(),
|
|
151
|
+
(0, class_validator_1.IsOptional)(),
|
|
152
|
+
__metadata("design:type", Number)
|
|
153
|
+
], VehicleReservationDto.prototype, "loanTenureMonths", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, class_validator_1.IsNumber)(),
|
|
156
|
+
(0, class_validator_1.IsOptional)(),
|
|
157
|
+
__metadata("design:type", Number)
|
|
158
|
+
], VehicleReservationDto.prototype, "interestRate", void 0);
|
|
159
|
+
exports.VehicleReservationDto = VehicleReservationDto;
|
|
160
|
+
class VehicleReservationResponseDto {
|
|
161
|
+
}
|
|
162
|
+
exports.VehicleReservationResponseDto = VehicleReservationResponseDto;
|
|
163
|
+
class UpdateVehicleReservationDto {
|
|
164
|
+
validate() {
|
|
165
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
166
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
167
|
+
}
|
|
168
|
+
static fromPlain(plain) {
|
|
169
|
+
return (0, class_transformer_1.plainToClass)(UpdateVehicleReservationDto, plain);
|
|
170
|
+
}
|
|
171
|
+
toPlain() {
|
|
172
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
__decorate([
|
|
176
|
+
(0, class_validator_1.IsEnum)(reservation_type_1.ReservationStatus),
|
|
177
|
+
(0, class_validator_1.IsOptional)(),
|
|
178
|
+
__metadata("design:type", String)
|
|
179
|
+
], UpdateVehicleReservationDto.prototype, "status", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, class_validator_1.IsNumber)(),
|
|
182
|
+
(0, class_validator_1.IsOptional)(),
|
|
183
|
+
__metadata("design:type", Number)
|
|
184
|
+
], UpdateVehicleReservationDto.prototype, "depositAmount", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, class_validator_1.IsString)(),
|
|
187
|
+
(0, class_validator_1.IsOptional)(),
|
|
188
|
+
__metadata("design:type", String)
|
|
189
|
+
], UpdateVehicleReservationDto.prototype, "depositPaymentMethod", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, class_validator_1.IsBoolean)(),
|
|
192
|
+
(0, class_validator_1.IsOptional)(),
|
|
193
|
+
__metadata("design:type", Boolean)
|
|
194
|
+
], UpdateVehicleReservationDto.prototype, "isDepositPaid", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
(0, class_validator_1.IsNumber)(),
|
|
197
|
+
(0, class_validator_1.IsOptional)(),
|
|
198
|
+
__metadata("design:type", Number)
|
|
199
|
+
], UpdateVehicleReservationDto.prototype, "totalAmount", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
(0, class_validator_1.IsString)(),
|
|
202
|
+
(0, class_validator_1.IsOptional)(),
|
|
203
|
+
__metadata("design:type", String)
|
|
204
|
+
], UpdateVehicleReservationDto.prototype, "bankName", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
(0, class_validator_1.IsNumber)(),
|
|
207
|
+
(0, class_validator_1.IsOptional)(),
|
|
208
|
+
__metadata("design:type", Number)
|
|
209
|
+
], UpdateVehicleReservationDto.prototype, "loanAmount", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
(0, class_validator_1.IsNumber)(),
|
|
212
|
+
(0, class_validator_1.IsOptional)(),
|
|
213
|
+
__metadata("design:type", Number)
|
|
214
|
+
], UpdateVehicleReservationDto.prototype, "loanTenureMonths", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
(0, class_validator_1.IsString)(),
|
|
217
|
+
(0, class_validator_1.IsOptional)(),
|
|
218
|
+
__metadata("design:type", String)
|
|
219
|
+
], UpdateVehicleReservationDto.prototype, "notes", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, class_validator_1.IsString)(),
|
|
222
|
+
(0, class_validator_1.IsOptional)(),
|
|
223
|
+
__metadata("design:type", String)
|
|
224
|
+
], UpdateVehicleReservationDto.prototype, "cancellationReason", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
(0, class_validator_1.IsUUID)(),
|
|
227
|
+
(0, class_validator_1.IsOptional)(),
|
|
228
|
+
__metadata("design:type", String)
|
|
229
|
+
], UpdateVehicleReservationDto.prototype, "assignedSalesRepId", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
(0, class_validator_1.IsString)(),
|
|
232
|
+
(0, class_validator_1.IsOptional)(),
|
|
233
|
+
__metadata("design:type", String)
|
|
234
|
+
], UpdateVehicleReservationDto.prototype, "financeRejectionReason", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
(0, class_validator_1.IsDate)(),
|
|
237
|
+
(0, class_validator_1.IsOptional)(),
|
|
238
|
+
__metadata("design:type", Date)
|
|
239
|
+
], UpdateVehicleReservationDto.prototype, "financeApprovedAt", void 0);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, class_validator_1.IsDate)(),
|
|
242
|
+
(0, class_validator_1.IsOptional)(),
|
|
243
|
+
__metadata("design:type", Date)
|
|
244
|
+
], UpdateVehicleReservationDto.prototype, "financeRejectedAt", void 0);
|
|
245
|
+
__decorate([
|
|
246
|
+
(0, class_validator_1.IsDate)(),
|
|
247
|
+
(0, class_validator_1.IsOptional)(),
|
|
248
|
+
__metadata("design:type", Date)
|
|
249
|
+
], UpdateVehicleReservationDto.prototype, "cancelledAt", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
(0, class_validator_1.IsBoolean)(),
|
|
252
|
+
(0, class_validator_1.IsOptional)(),
|
|
253
|
+
__metadata("design:type", Boolean)
|
|
254
|
+
], UpdateVehicleReservationDto.prototype, "isActive", void 0);
|
|
255
|
+
exports.UpdateVehicleReservationDto = UpdateVehicleReservationDto;
|
|
256
|
+
class VehicleReservationsOptions extends global_1.PaginationOptions {
|
|
257
|
+
static fromPlain(plain) {
|
|
258
|
+
return (0, class_transformer_1.plainToClass)(GetVehicleReservationsFilterDto, plain);
|
|
259
|
+
}
|
|
260
|
+
toPlain() {
|
|
261
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exports.VehicleReservationsOptions = VehicleReservationsOptions;
|
|
265
|
+
class GetVehicleReservationsDTO {
|
|
266
|
+
static fromPlain(plain) {
|
|
267
|
+
return (0, class_transformer_1.plainToClass)(GetVehicleReservationsFilterDto, plain);
|
|
268
|
+
}
|
|
269
|
+
toPlain() {
|
|
270
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
exports.GetVehicleReservationsDTO = GetVehicleReservationsDTO;
|
|
274
|
+
class GetVehicleReservationsFilterDto {
|
|
275
|
+
validate() {
|
|
276
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
277
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
278
|
+
}
|
|
279
|
+
static fromPlain(plain) {
|
|
280
|
+
return (0, class_transformer_1.plainToClass)(GetVehicleReservationsFilterDto, plain);
|
|
281
|
+
}
|
|
282
|
+
toPlain() {
|
|
283
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
__decorate([
|
|
287
|
+
(0, class_validator_1.IsEnum)(reservation_type_1.ReservationStatus),
|
|
288
|
+
(0, class_validator_1.IsOptional)(),
|
|
289
|
+
__metadata("design:type", String)
|
|
290
|
+
], GetVehicleReservationsFilterDto.prototype, "status", void 0);
|
|
291
|
+
__decorate([
|
|
292
|
+
(0, class_validator_1.IsEnum)(finance_type_1.FinanceType),
|
|
293
|
+
(0, class_validator_1.IsOptional)(),
|
|
294
|
+
__metadata("design:type", String)
|
|
295
|
+
], GetVehicleReservationsFilterDto.prototype, "financeType", void 0);
|
|
296
|
+
__decorate([
|
|
297
|
+
(0, class_validator_1.IsUUID)(),
|
|
298
|
+
(0, class_validator_1.IsOptional)(),
|
|
299
|
+
__metadata("design:type", String)
|
|
300
|
+
], GetVehicleReservationsFilterDto.prototype, "vehicleId", void 0);
|
|
301
|
+
__decorate([
|
|
302
|
+
(0, class_validator_1.IsUUID)(),
|
|
303
|
+
(0, class_validator_1.IsOptional)(),
|
|
304
|
+
__metadata("design:type", String)
|
|
305
|
+
], GetVehicleReservationsFilterDto.prototype, "leadId", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
(0, class_validator_1.IsBoolean)(),
|
|
308
|
+
(0, class_validator_1.IsOptional)(),
|
|
309
|
+
__metadata("design:type", Boolean)
|
|
310
|
+
], GetVehicleReservationsFilterDto.prototype, "isActive", void 0);
|
|
311
|
+
exports.GetVehicleReservationsFilterDto = GetVehicleReservationsFilterDto;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./VehicleReservationDTO";
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./VehicleReservationDTO"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinanceType = void 0;
|
|
4
|
+
var FinanceType;
|
|
5
|
+
(function (FinanceType) {
|
|
6
|
+
FinanceType["READY_CASH"] = "READY_CASH";
|
|
7
|
+
FinanceType["BANK_FINANCE_WITH_RESERVATION"] = "BANK_FINANCE_WITH_RESERVATION";
|
|
8
|
+
FinanceType["BANK_FINANCE_ELIGIBILITY"] = "BANK_FINANCE_ELIGIBILITY";
|
|
9
|
+
})(FinanceType = exports.FinanceType || (exports.FinanceType = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./finance-type"), exports);
|
|
18
|
+
__exportStar(require("./reservation-type"), exports);
|
|
19
|
+
__exportStar(require("./vehicle-reservation-type"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum ReservationStatus {
|
|
2
|
+
PENDING = "PENDING",
|
|
3
|
+
CONFIRMED = "CONFIRMED",
|
|
4
|
+
CANCELLED = "CANCELLED",
|
|
5
|
+
COMPLETED = "COMPLETED",
|
|
6
|
+
AWAITING_FINANCE = "AWAITING_FINANCE",
|
|
7
|
+
FINANCE_APPROVED = "FINANCE_APPROVED",
|
|
8
|
+
FINANCE_REJECTED = "FINANCE_REJECTED"
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReservationStatus = void 0;
|
|
4
|
+
var ReservationStatus;
|
|
5
|
+
(function (ReservationStatus) {
|
|
6
|
+
ReservationStatus["PENDING"] = "PENDING";
|
|
7
|
+
ReservationStatus["CONFIRMED"] = "CONFIRMED";
|
|
8
|
+
ReservationStatus["CANCELLED"] = "CANCELLED";
|
|
9
|
+
ReservationStatus["COMPLETED"] = "COMPLETED";
|
|
10
|
+
ReservationStatus["AWAITING_FINANCE"] = "AWAITING_FINANCE";
|
|
11
|
+
ReservationStatus["FINANCE_APPROVED"] = "FINANCE_APPROVED";
|
|
12
|
+
ReservationStatus["FINANCE_REJECTED"] = "FINANCE_REJECTED";
|
|
13
|
+
})(ReservationStatus = exports.ReservationStatus || (exports.ReservationStatus = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VehicleReservationType = void 0;
|
|
4
|
+
var VehicleReservationType;
|
|
5
|
+
(function (VehicleReservationType) {
|
|
6
|
+
VehicleReservationType["RESERVED"] = "RESERVED";
|
|
7
|
+
VehicleReservationType["PARTIAL_REQUEST"] = "PARTIAL_REQUEST"; // Multiple leads can request same vehicle
|
|
8
|
+
})(VehicleReservationType = exports.VehicleReservationType || (exports.VehicleReservationType = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
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/dto/index"), exports);
|
|
18
|
+
__exportStar(require("./data/enums/index"), exports);
|
package/package.json
CHANGED