@alba-cars/common-modules 1.6.8 → 1.7.0
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/network/endpoint-config.d.ts +3 -0
- package/dist/core/network/endpoint-config.js +15 -0
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.js +1 -0
- package/dist/features/models/Vehicle.d.ts +3 -0
- package/dist/features/tickets/data/dto/TicketDto.d.ts +48 -0
- package/dist/features/tickets/data/dto/TicketDto.js +208 -0
- package/dist/features/tickets/data/enums/index.d.ts +12 -0
- package/dist/features/tickets/data/enums/index.js +17 -0
- package/dist/features/tickets/index.d.ts +2 -0
- package/dist/features/tickets/index.js +18 -0
- package/dist/features/vehicle/data/dto/VehicleDTO.d.ts +5 -0
- package/dist/features/vehicle/data/dto/VehicleDTO.js +33 -0
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.d.ts +2 -1
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.js +5 -0
- package/dist/features/vehicle/data/enums/index.d.ts +12 -0
- package/dist/features/vehicle/data/enums/index.js +14 -1
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ interface VehicleEndpoints extends BaseEndpoint {
|
|
|
13
13
|
reserveVehicle: EndpointFunction;
|
|
14
14
|
selfReserveVehicle: EndpointFunction;
|
|
15
15
|
markVehicleSold: EndpointFunction;
|
|
16
|
+
markVehicleDraft: EndpointFunction;
|
|
16
17
|
}
|
|
17
18
|
interface BlogEndpoints extends BaseEndpoint {
|
|
18
19
|
getOneBySlug: EndpointFunction;
|
|
@@ -51,6 +52,8 @@ type APIEndpointType = {
|
|
|
51
52
|
leads: BaseEndpoint;
|
|
52
53
|
leadPreferences: BaseEndpoint;
|
|
53
54
|
googleReview: BaseEndpoint;
|
|
55
|
+
tickets: BaseEndpoint;
|
|
56
|
+
user: BaseEndpoint;
|
|
54
57
|
};
|
|
55
58
|
export declare const API_ENDPOINTS: APIEndpointType;
|
|
56
59
|
export declare const UTIL_ENDPOINTS: {
|
|
@@ -14,6 +14,7 @@ exports.API_ENDPOINTS = {
|
|
|
14
14
|
reserveVehicle: (id) => `/vehicle/reserve/${id}`,
|
|
15
15
|
selfReserveVehicle: (id) => `/vehicle/self-reserve/${id}`,
|
|
16
16
|
markVehicleSold: (id) => `/vehicle/mark-vehicle-sold/${id}`,
|
|
17
|
+
markVehicleDraft: (id) => `/vehicle/mark-vehicle-draft/${id}`,
|
|
17
18
|
},
|
|
18
19
|
vehicleDetails: {
|
|
19
20
|
getAll: `/vehicledetails`,
|
|
@@ -181,6 +182,13 @@ exports.API_ENDPOINTS = {
|
|
|
181
182
|
deleteOne: (id) => `/languages/${id}`,
|
|
182
183
|
updateOne: (id) => `/languages/${id}`,
|
|
183
184
|
},
|
|
185
|
+
user: {
|
|
186
|
+
getAll: `/users`,
|
|
187
|
+
create: `/users`,
|
|
188
|
+
getOne: (id) => `/users/${id}`,
|
|
189
|
+
deleteOne: (id) => `/users/${id}`,
|
|
190
|
+
updateOne: (id) => `/users/${id}`,
|
|
191
|
+
},
|
|
184
192
|
googleReview: {
|
|
185
193
|
getAll: `/google-reviews`,
|
|
186
194
|
create: `/google-reviews`,
|
|
@@ -188,6 +196,13 @@ exports.API_ENDPOINTS = {
|
|
|
188
196
|
deleteOne: (id) => `/google-reviews/${id}`,
|
|
189
197
|
updateOne: (id) => `/google-reviews/${id}`,
|
|
190
198
|
},
|
|
199
|
+
tickets: {
|
|
200
|
+
getAll: `/tickets`,
|
|
201
|
+
create: `/tickets`,
|
|
202
|
+
getOne: (id) => `/tickets/${id}`,
|
|
203
|
+
deleteOne: (id) => `/tickets/${id}`,
|
|
204
|
+
updateOne: (id) => `/tickets/${id}`,
|
|
205
|
+
},
|
|
191
206
|
};
|
|
192
207
|
exports.UTIL_ENDPOINTS = {
|
|
193
208
|
media: {
|
package/dist/features/index.d.ts
CHANGED
package/dist/features/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { VehicleOrder } from "./VehicleOrder";
|
|
|
10
10
|
import { UserFavoriteVehicle } from "./UserFavoriteVehicle";
|
|
11
11
|
import { User } from "./User";
|
|
12
12
|
import { Deposit } from "./Deposit";
|
|
13
|
+
import { VehicleWarrantyType } from "../vehicle";
|
|
13
14
|
export declare class Vehicle extends BaseModel {
|
|
14
15
|
referenceNumber?: string;
|
|
15
16
|
slug: string;
|
|
@@ -21,6 +22,7 @@ export declare class Vehicle extends BaseModel {
|
|
|
21
22
|
bodyTypeId: string;
|
|
22
23
|
vin: string;
|
|
23
24
|
chassisNumber: string;
|
|
25
|
+
trim: string;
|
|
24
26
|
mileage: number;
|
|
25
27
|
fuelType: string;
|
|
26
28
|
color: string;
|
|
@@ -42,6 +44,7 @@ export declare class Vehicle extends BaseModel {
|
|
|
42
44
|
features?: VehicleFeature[];
|
|
43
45
|
metaData?: VehicleMetaData;
|
|
44
46
|
finance?: VehicleFinance;
|
|
47
|
+
warranty: VehicleWarrantyType;
|
|
45
48
|
orders?: VehicleOrder[];
|
|
46
49
|
draft?: VehicleDraft;
|
|
47
50
|
vehicleFavorites?: UserFavoriteVehicle[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { TicketRequestType, TicketStatusType } from '../enums';
|
|
2
|
+
export declare class CreateTicketDto {
|
|
3
|
+
userId: string;
|
|
4
|
+
requestType: TicketRequestType;
|
|
5
|
+
message: string;
|
|
6
|
+
assignedSalesAgentId: string;
|
|
7
|
+
agentName: string;
|
|
8
|
+
agentPhoneNumber: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class UpdateTicketDto {
|
|
11
|
+
requestType?: TicketRequestType;
|
|
12
|
+
message?: string;
|
|
13
|
+
assignedSalesAgentId?: string;
|
|
14
|
+
agentName?: string;
|
|
15
|
+
agentPhoneNumber?: string;
|
|
16
|
+
status?: TicketStatusType;
|
|
17
|
+
}
|
|
18
|
+
export declare class TicketDto {
|
|
19
|
+
id: string;
|
|
20
|
+
userId: string;
|
|
21
|
+
requestType: TicketRequestType;
|
|
22
|
+
message: string;
|
|
23
|
+
assignedSalesAgentId: string;
|
|
24
|
+
agentName: string;
|
|
25
|
+
agentPhoneNumber: string;
|
|
26
|
+
status: TicketStatusType;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
}
|
|
30
|
+
export declare class TicketGetDTO {
|
|
31
|
+
id: string;
|
|
32
|
+
refId: number;
|
|
33
|
+
createdById: string | null;
|
|
34
|
+
updatedById: string | null;
|
|
35
|
+
deletedById: string | null;
|
|
36
|
+
isDeleted: boolean;
|
|
37
|
+
isActive: boolean;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
userId: string;
|
|
41
|
+
requestType: TicketRequestType;
|
|
42
|
+
message: string;
|
|
43
|
+
assignedSalesAgentId: string;
|
|
44
|
+
agentName: string;
|
|
45
|
+
agentPhoneNumber: string;
|
|
46
|
+
status: TicketStatusType;
|
|
47
|
+
constructor();
|
|
48
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
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.TicketGetDTO = exports.TicketDto = exports.UpdateTicketDto = exports.CreateTicketDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const enums_1 = require("../enums");
|
|
16
|
+
class CreateTicketDto {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsUUID)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], CreateTicketDto.prototype, "userId", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsEnum)(enums_1.TicketRequestType),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CreateTicketDto.prototype, "requestType", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], CreateTicketDto.prototype, "message", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsUUID)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CreateTicketDto.prototype, "assignedSalesAgentId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], CreateTicketDto.prototype, "agentName", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], CreateTicketDto.prototype, "agentPhoneNumber", void 0);
|
|
42
|
+
exports.CreateTicketDto = CreateTicketDto;
|
|
43
|
+
class UpdateTicketDto {
|
|
44
|
+
}
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsEnum)(enums_1.TicketRequestType),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], UpdateTicketDto.prototype, "requestType", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsString)(),
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], UpdateTicketDto.prototype, "message", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.IsUUID)(),
|
|
57
|
+
(0, class_validator_1.IsOptional)(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], UpdateTicketDto.prototype, "assignedSalesAgentId", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, class_validator_1.IsString)(),
|
|
62
|
+
(0, class_validator_1.IsOptional)(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], UpdateTicketDto.prototype, "agentName", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_validator_1.IsString)(),
|
|
67
|
+
(0, class_validator_1.IsOptional)(),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], UpdateTicketDto.prototype, "agentPhoneNumber", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_validator_1.IsEnum)(enums_1.TicketStatusType),
|
|
72
|
+
(0, class_validator_1.IsOptional)(),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], UpdateTicketDto.prototype, "status", void 0);
|
|
75
|
+
exports.UpdateTicketDto = UpdateTicketDto;
|
|
76
|
+
class TicketDto {
|
|
77
|
+
}
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsUUID)(),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], TicketDto.prototype, "id", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, class_validator_1.IsUUID)(),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], TicketDto.prototype, "userId", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, class_validator_1.IsEnum)(enums_1.TicketRequestType),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], TicketDto.prototype, "requestType", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, class_validator_1.IsString)(),
|
|
92
|
+
__metadata("design:type", String)
|
|
93
|
+
], TicketDto.prototype, "message", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, class_validator_1.IsUUID)(),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], TicketDto.prototype, "assignedSalesAgentId", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, class_validator_1.IsString)(),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], TicketDto.prototype, "agentName", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, class_validator_1.IsString)(),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], TicketDto.prototype, "agentPhoneNumber", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, class_validator_1.IsEnum)(enums_1.TicketStatusType),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], TicketDto.prototype, "status", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, class_transformer_1.Type)(() => Date),
|
|
112
|
+
(0, class_validator_1.IsDate)(),
|
|
113
|
+
__metadata("design:type", Date)
|
|
114
|
+
], TicketDto.prototype, "createdAt", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, class_transformer_1.Type)(() => Date),
|
|
117
|
+
(0, class_validator_1.IsDate)(),
|
|
118
|
+
__metadata("design:type", Date)
|
|
119
|
+
], TicketDto.prototype, "updatedAt", void 0);
|
|
120
|
+
exports.TicketDto = TicketDto;
|
|
121
|
+
class TicketGetDTO {
|
|
122
|
+
constructor() {
|
|
123
|
+
this.id = '';
|
|
124
|
+
this.refId = 0;
|
|
125
|
+
this.createdById = null;
|
|
126
|
+
this.updatedById = null;
|
|
127
|
+
this.deletedById = null;
|
|
128
|
+
this.isDeleted = false;
|
|
129
|
+
this.isActive = true;
|
|
130
|
+
this.createdAt = new Date().toISOString();
|
|
131
|
+
this.updatedAt = new Date().toISOString();
|
|
132
|
+
this.userId = '';
|
|
133
|
+
this.requestType = enums_1.TicketRequestType.CAR_VIEWING;
|
|
134
|
+
this.message = '';
|
|
135
|
+
this.assignedSalesAgentId = '';
|
|
136
|
+
this.agentName = '';
|
|
137
|
+
this.agentPhoneNumber = '';
|
|
138
|
+
this.status = enums_1.TicketStatusType.OPEN;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, class_validator_1.IsUUID)(),
|
|
143
|
+
__metadata("design:type", String)
|
|
144
|
+
], TicketGetDTO.prototype, "id", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, class_validator_1.IsNumber)(),
|
|
147
|
+
__metadata("design:type", Number)
|
|
148
|
+
], TicketGetDTO.prototype, "refId", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, class_validator_1.IsUUID)(),
|
|
151
|
+
(0, class_validator_1.IsOptional)(),
|
|
152
|
+
__metadata("design:type", Object)
|
|
153
|
+
], TicketGetDTO.prototype, "createdById", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, class_validator_1.IsUUID)(),
|
|
156
|
+
(0, class_validator_1.IsOptional)(),
|
|
157
|
+
__metadata("design:type", Object)
|
|
158
|
+
], TicketGetDTO.prototype, "updatedById", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, class_validator_1.IsUUID)(),
|
|
161
|
+
(0, class_validator_1.IsOptional)(),
|
|
162
|
+
__metadata("design:type", Object)
|
|
163
|
+
], TicketGetDTO.prototype, "deletedById", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, class_validator_1.IsBoolean)(),
|
|
166
|
+
__metadata("design:type", Boolean)
|
|
167
|
+
], TicketGetDTO.prototype, "isDeleted", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, class_validator_1.IsBoolean)(),
|
|
170
|
+
__metadata("design:type", Boolean)
|
|
171
|
+
], TicketGetDTO.prototype, "isActive", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, class_validator_1.IsString)(),
|
|
174
|
+
__metadata("design:type", String)
|
|
175
|
+
], TicketGetDTO.prototype, "createdAt", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
(0, class_validator_1.IsString)(),
|
|
178
|
+
__metadata("design:type", String)
|
|
179
|
+
], TicketGetDTO.prototype, "updatedAt", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, class_validator_1.IsUUID)(),
|
|
182
|
+
__metadata("design:type", String)
|
|
183
|
+
], TicketGetDTO.prototype, "userId", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, class_validator_1.IsEnum)(enums_1.TicketRequestType),
|
|
186
|
+
__metadata("design:type", String)
|
|
187
|
+
], TicketGetDTO.prototype, "requestType", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
(0, class_validator_1.IsString)(),
|
|
190
|
+
__metadata("design:type", String)
|
|
191
|
+
], TicketGetDTO.prototype, "message", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, class_validator_1.IsUUID)(),
|
|
194
|
+
__metadata("design:type", String)
|
|
195
|
+
], TicketGetDTO.prototype, "assignedSalesAgentId", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, class_validator_1.IsString)(),
|
|
198
|
+
__metadata("design:type", String)
|
|
199
|
+
], TicketGetDTO.prototype, "agentName", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
(0, class_validator_1.IsString)(),
|
|
202
|
+
__metadata("design:type", String)
|
|
203
|
+
], TicketGetDTO.prototype, "agentPhoneNumber", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
(0, class_validator_1.IsEnum)(enums_1.TicketStatusType),
|
|
206
|
+
__metadata("design:type", String)
|
|
207
|
+
], TicketGetDTO.prototype, "status", void 0);
|
|
208
|
+
exports.TicketGetDTO = TicketGetDTO;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum TicketRequestType {
|
|
2
|
+
WARRANTY = "Warranty",
|
|
3
|
+
REFUND = "Refund",
|
|
4
|
+
TEST_DRIVE = "Test Drive",
|
|
5
|
+
CAR_VIEWING = "Car Viewing"
|
|
6
|
+
}
|
|
7
|
+
export declare enum TicketStatusType {
|
|
8
|
+
OPEN = "Open",
|
|
9
|
+
IN_PROGRESS = "In Progress",
|
|
10
|
+
RESOLVED = "Resolved",
|
|
11
|
+
CLOSED = "Closed"
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TicketStatusType = exports.TicketRequestType = void 0;
|
|
4
|
+
var TicketRequestType;
|
|
5
|
+
(function (TicketRequestType) {
|
|
6
|
+
TicketRequestType["WARRANTY"] = "Warranty";
|
|
7
|
+
TicketRequestType["REFUND"] = "Refund";
|
|
8
|
+
TicketRequestType["TEST_DRIVE"] = "Test Drive";
|
|
9
|
+
TicketRequestType["CAR_VIEWING"] = "Car Viewing";
|
|
10
|
+
})(TicketRequestType = exports.TicketRequestType || (exports.TicketRequestType = {}));
|
|
11
|
+
var TicketStatusType;
|
|
12
|
+
(function (TicketStatusType) {
|
|
13
|
+
TicketStatusType["OPEN"] = "Open";
|
|
14
|
+
TicketStatusType["IN_PROGRESS"] = "In Progress";
|
|
15
|
+
TicketStatusType["RESOLVED"] = "Resolved";
|
|
16
|
+
TicketStatusType["CLOSED"] = "Closed";
|
|
17
|
+
})(TicketStatusType = exports.TicketStatusType || (exports.TicketStatusType = {}));
|
|
@@ -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/enums"), exports);
|
|
18
|
+
__exportStar(require("./data/dto/TicketDto"), exports);
|
|
@@ -5,6 +5,7 @@ import { DynamicVehicleBodyTypeDTO } from "./VehicleTypeDTO";
|
|
|
5
5
|
import { VehicleMediaCreateDTO, VehicleMediaUpdateDTO } from "./VehicleMedia";
|
|
6
6
|
import { VehicleFilter, VehicleOptions, VehicleUniqueFilter } from "./VehicleFilterDTO";
|
|
7
7
|
import { VehicleFinanceCreateDTO } from "./VehicleFinanceDTO";
|
|
8
|
+
import { VehicleWarrantyType } from "../enums";
|
|
8
9
|
export declare class VehicleGetDTO {
|
|
9
10
|
filter?: VehicleFilter;
|
|
10
11
|
options?: VehicleOptions;
|
|
@@ -38,6 +39,7 @@ export declare class VehicleCreateDTO extends BaseCreateDTO {
|
|
|
38
39
|
vin: string;
|
|
39
40
|
vehicleSpec: string;
|
|
40
41
|
chassisNumber: string;
|
|
42
|
+
trim: string;
|
|
41
43
|
mileage: number;
|
|
42
44
|
odometer: number;
|
|
43
45
|
fuelType: string;
|
|
@@ -53,6 +55,7 @@ export declare class VehicleCreateDTO extends BaseCreateDTO {
|
|
|
53
55
|
transmission: string;
|
|
54
56
|
driveType: string;
|
|
55
57
|
emissions: string;
|
|
58
|
+
warranty: VehicleWarrantyType;
|
|
56
59
|
media?: VehicleMediaCreateDTO[];
|
|
57
60
|
finance?: VehicleFinanceCreateDTO;
|
|
58
61
|
year: number;
|
|
@@ -80,6 +83,7 @@ export declare class VehicleUpdateDTO extends BaseUpdateDTO {
|
|
|
80
83
|
bodyType: DynamicVehicleBodyTypeDTO;
|
|
81
84
|
vin: string;
|
|
82
85
|
chassisNumber: string;
|
|
86
|
+
trim: string;
|
|
83
87
|
mileage: number;
|
|
84
88
|
fuelType: string;
|
|
85
89
|
color: string;
|
|
@@ -95,6 +99,7 @@ export declare class VehicleUpdateDTO extends BaseUpdateDTO {
|
|
|
95
99
|
transmission: string;
|
|
96
100
|
driveType: string;
|
|
97
101
|
emissions: string;
|
|
102
|
+
warranty?: VehicleWarrantyType;
|
|
98
103
|
media: VehicleMediaUpdateDTO;
|
|
99
104
|
year: number;
|
|
100
105
|
price: number;
|
|
@@ -19,6 +19,7 @@ const VehicleModelDTO_1 = require("./VehicleModelDTO");
|
|
|
19
19
|
const VehicleTypeDTO_1 = require("./VehicleTypeDTO");
|
|
20
20
|
const VehicleMedia_1 = require("./VehicleMedia");
|
|
21
21
|
const VehicleFinanceDTO_1 = require("./VehicleFinanceDTO");
|
|
22
|
+
const enums_1 = require("../enums");
|
|
22
23
|
class VehicleGetDTO {
|
|
23
24
|
constructor(shouldIncludeValidate = true) {
|
|
24
25
|
if (shouldIncludeValidate) {
|
|
@@ -144,6 +145,11 @@ __decorate([
|
|
|
144
145
|
(0, class_validator_1.IsString)(),
|
|
145
146
|
__metadata("design:type", String)
|
|
146
147
|
], VehicleCreateDTO.prototype, "chassisNumber", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, class_validator_1.IsOptional)(),
|
|
150
|
+
(0, class_validator_1.IsString)(),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], VehicleCreateDTO.prototype, "trim", void 0);
|
|
147
153
|
__decorate([
|
|
148
154
|
(0, class_validator_1.IsNotEmpty)(),
|
|
149
155
|
(0, class_validator_1.IsNumber)(),
|
|
@@ -219,6 +225,17 @@ __decorate([
|
|
|
219
225
|
(0, class_validator_1.IsString)(),
|
|
220
226
|
__metadata("design:type", String)
|
|
221
227
|
], VehicleCreateDTO.prototype, "emissions", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
230
|
+
(0, class_validator_1.IsString)(),
|
|
231
|
+
(0, class_transformer_1.Transform)(({ value }) => {
|
|
232
|
+
if (Object.values(enums_1.VehicleWarrantyType).includes(value)) {
|
|
233
|
+
return value;
|
|
234
|
+
}
|
|
235
|
+
throw new Error(`Invalid warranty type. Must be one of: ${Object.values(enums_1.VehicleWarrantyType).join(', ')}`);
|
|
236
|
+
}),
|
|
237
|
+
__metadata("design:type", String)
|
|
238
|
+
], VehicleCreateDTO.prototype, "warranty", void 0);
|
|
222
239
|
__decorate([
|
|
223
240
|
(0, class_validator_1.IsArray)(),
|
|
224
241
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -337,6 +354,11 @@ __decorate([
|
|
|
337
354
|
(0, class_validator_1.IsString)(),
|
|
338
355
|
__metadata("design:type", String)
|
|
339
356
|
], VehicleUpdateDTO.prototype, "chassisNumber", void 0);
|
|
357
|
+
__decorate([
|
|
358
|
+
(0, class_validator_1.IsOptional)(),
|
|
359
|
+
(0, class_validator_1.IsString)(),
|
|
360
|
+
__metadata("design:type", String)
|
|
361
|
+
], VehicleUpdateDTO.prototype, "trim", void 0);
|
|
340
362
|
__decorate([
|
|
341
363
|
(0, class_validator_1.IsOptional)(),
|
|
342
364
|
(0, class_validator_1.IsNumber)(),
|
|
@@ -413,6 +435,17 @@ __decorate([
|
|
|
413
435
|
(0, class_validator_1.IsString)(),
|
|
414
436
|
__metadata("design:type", String)
|
|
415
437
|
], VehicleUpdateDTO.prototype, "emissions", void 0);
|
|
438
|
+
__decorate([
|
|
439
|
+
(0, class_validator_1.IsOptional)(),
|
|
440
|
+
(0, class_validator_1.IsString)(),
|
|
441
|
+
(0, class_transformer_1.Transform)(({ value }) => {
|
|
442
|
+
if (!value || Object.values(enums_1.VehicleWarrantyType).includes(value)) {
|
|
443
|
+
return value;
|
|
444
|
+
}
|
|
445
|
+
throw new Error(`Invalid warranty type. Must be one of: ${Object.values(enums_1.VehicleWarrantyType).join(', ')}`);
|
|
446
|
+
}),
|
|
447
|
+
__metadata("design:type", String)
|
|
448
|
+
], VehicleUpdateDTO.prototype, "warranty", void 0);
|
|
416
449
|
__decorate([
|
|
417
450
|
(0, class_validator_1.IsOptional)(),
|
|
418
451
|
(0, class_validator_1.IsArray)(),
|
|
@@ -184,6 +184,7 @@ export declare class VehicleFilter extends BaseFilter {
|
|
|
184
184
|
bodyType?: string | string[];
|
|
185
185
|
vin?: string | string[];
|
|
186
186
|
chassisNumber?: string | string[];
|
|
187
|
+
trim?: string | string[];
|
|
187
188
|
mileage?: NumberRange;
|
|
188
189
|
fuelType?: string | string[];
|
|
189
190
|
color?: string | string[];
|
|
@@ -208,7 +209,7 @@ export declare class VehicleFilter extends BaseFilter {
|
|
|
208
209
|
includeDraft?: boolean;
|
|
209
210
|
features?: string | string[];
|
|
210
211
|
search?: string;
|
|
211
|
-
validate(): string[];
|
|
212
|
+
validate?(): string[];
|
|
212
213
|
static fromPlain(plain: Record<string, unknown>): VehicleFilter;
|
|
213
214
|
static toPlain(entity: any): Record<string, unknown>;
|
|
214
215
|
}
|
|
@@ -557,6 +557,11 @@ __decorate([
|
|
|
557
557
|
(0, class_validator_1.IsString)({ each: true }),
|
|
558
558
|
__metadata("design:type", Object)
|
|
559
559
|
], VehicleFilter.prototype, "chassisNumber", void 0);
|
|
560
|
+
__decorate([
|
|
561
|
+
(0, class_validator_1.IsOptional)(),
|
|
562
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
563
|
+
__metadata("design:type", Object)
|
|
564
|
+
], VehicleFilter.prototype, "trim", void 0);
|
|
560
565
|
__decorate([
|
|
561
566
|
(0, class_validator_1.IsOptional)(),
|
|
562
567
|
(0, class_validator_1.ValidateNested)(),
|
|
@@ -9,3 +9,15 @@ export declare enum VehicleStatusType {
|
|
|
9
9
|
SELF_RESERVED = "Self-Reserved",
|
|
10
10
|
SOLD = "Sold"
|
|
11
11
|
}
|
|
12
|
+
export declare enum VehicleWarrantyType {
|
|
13
|
+
ONE_YEAR = "1 Year",
|
|
14
|
+
TWO_YEARS = "2 Years",
|
|
15
|
+
THREE_YEARS = "3 Years",
|
|
16
|
+
FOUR_YEARS = "4 Years",
|
|
17
|
+
FIVE_YEARS = "5 Years",
|
|
18
|
+
SIX_YEARS = "6 Years",
|
|
19
|
+
SEVEN_YEARS = "7 Years",
|
|
20
|
+
EIGHT_YEARS = "8 Years",
|
|
21
|
+
NINE_YEARS = "9 Years",
|
|
22
|
+
TEN_YEARS = "10 Years"
|
|
23
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VehicleStatusType = exports.VehicleMediaType = void 0;
|
|
3
|
+
exports.VehicleWarrantyType = exports.VehicleStatusType = exports.VehicleMediaType = void 0;
|
|
4
4
|
var VehicleMediaType;
|
|
5
5
|
(function (VehicleMediaType) {
|
|
6
6
|
VehicleMediaType["IMAGE"] = "image";
|
|
@@ -14,3 +14,16 @@ var VehicleStatusType;
|
|
|
14
14
|
VehicleStatusType["SELF_RESERVED"] = "Self-Reserved";
|
|
15
15
|
VehicleStatusType["SOLD"] = "Sold";
|
|
16
16
|
})(VehicleStatusType = exports.VehicleStatusType || (exports.VehicleStatusType = {}));
|
|
17
|
+
var VehicleWarrantyType;
|
|
18
|
+
(function (VehicleWarrantyType) {
|
|
19
|
+
VehicleWarrantyType["ONE_YEAR"] = "1 Year";
|
|
20
|
+
VehicleWarrantyType["TWO_YEARS"] = "2 Years";
|
|
21
|
+
VehicleWarrantyType["THREE_YEARS"] = "3 Years";
|
|
22
|
+
VehicleWarrantyType["FOUR_YEARS"] = "4 Years";
|
|
23
|
+
VehicleWarrantyType["FIVE_YEARS"] = "5 Years";
|
|
24
|
+
VehicleWarrantyType["SIX_YEARS"] = "6 Years";
|
|
25
|
+
VehicleWarrantyType["SEVEN_YEARS"] = "7 Years";
|
|
26
|
+
VehicleWarrantyType["EIGHT_YEARS"] = "8 Years";
|
|
27
|
+
VehicleWarrantyType["NINE_YEARS"] = "9 Years";
|
|
28
|
+
VehicleWarrantyType["TEN_YEARS"] = "10 Years";
|
|
29
|
+
})(VehicleWarrantyType = exports.VehicleWarrantyType || (exports.VehicleWarrantyType = {}));
|
package/package.json
CHANGED