@alba-cars/common-modules 1.5.4 → 1.5.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.
- package/dist/core/models/index.d.ts +1 -0
- package/dist/core/models/index.js +1 -0
- package/dist/core/models/range.d.ts +4 -0
- package/dist/core/models/range.js +26 -0
- package/dist/core/network/endpoint-config.d.ts +2 -0
- package/dist/core/network/endpoint-config.js +14 -0
- package/dist/features/deposits/data/dto/DepositDTOs.d.ts +36 -0
- package/dist/features/deposits/data/dto/DepositDTOs.js +121 -0
- package/dist/features/deposits/data/index.d.ts +1 -0
- package/dist/features/deposits/data/index.js +17 -0
- package/dist/features/deposits/index.d.ts +1 -0
- package/dist/features/deposits/index.js +17 -0
- package/dist/features/index.d.ts +2 -0
- package/dist/features/index.js +2 -0
- package/dist/features/lead/data/dto/index.d.ts +3 -0
- package/dist/features/lead/data/dto/index.js +19 -0
- package/dist/features/lead/data/dto/lead_dto.d.ts +39 -2
- package/dist/features/lead/data/dto/lead_dto.js +157 -3
- package/dist/features/lead/data/dto/lead_preference_history_dto.d.ts +84 -0
- package/dist/features/lead/data/dto/lead_preference_history_dto.js +321 -0
- package/dist/features/lead/data/dto/lead_prefernce_dto.d.ts +36 -0
- package/dist/features/lead/data/dto/lead_prefernce_dto.js +154 -1
- package/dist/features/lead/data/enum/index.d.ts +2 -0
- package/dist/features/lead/data/enum/index.js +18 -0
- package/dist/features/lead/index.d.ts +2 -0
- package/dist/features/lead/index.js +18 -0
- package/dist/features/models/Deposit.d.ts +18 -0
- package/dist/features/models/Deposit.js +6 -0
- package/dist/features/models/Lead.d.ts +25 -0
- package/dist/features/models/Lead.js +6 -0
- package/dist/features/models/User.d.ts +2 -0
- package/dist/features/models/Vehicle.d.ts +2 -0
- package/dist/features/models/index.d.ts +3 -1
- package/dist/features/models/index.js +5 -1
- package/package.json +1 -1
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./pagination"), exports);
|
|
18
18
|
__exportStar(require("./media"), exports);
|
|
19
|
+
__exportStar(require("./range"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
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.Range = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class Range {
|
|
15
|
+
}
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, class_validator_1.IsOptional)(),
|
|
18
|
+
(0, class_validator_1.IsNumber)(),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], Range.prototype, "min", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsOptional)(),
|
|
23
|
+
(0, class_validator_1.IsNumber)(),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], Range.prototype, "max", void 0);
|
|
26
|
+
exports.Range = Range;
|
|
@@ -44,6 +44,8 @@ type APIEndpointType = {
|
|
|
44
44
|
financeEligibilityRequest: BaseEndpoint;
|
|
45
45
|
vehicleReservations: BaseEndpoint;
|
|
46
46
|
languages: BaseEndpoint;
|
|
47
|
+
leads: BaseEndpoint;
|
|
48
|
+
leadPreferences: BaseEndpoint;
|
|
47
49
|
};
|
|
48
50
|
export declare const API_ENDPOINTS: APIEndpointType;
|
|
49
51
|
export declare const UTIL_ENDPOINTS: {
|
|
@@ -109,6 +109,20 @@ exports.API_ENDPOINTS = {
|
|
|
109
109
|
deleteOne: (id) => `/payment/${id}`,
|
|
110
110
|
updateOne: (id) => `/payment/${id}`,
|
|
111
111
|
},
|
|
112
|
+
leads: {
|
|
113
|
+
getAll: `/leads`,
|
|
114
|
+
create: `/leads`,
|
|
115
|
+
getOne: (id) => `/leads/${id}`,
|
|
116
|
+
deleteOne: (id) => `/leads/${id}`,
|
|
117
|
+
updateOne: (id) => `/leads/${id}`,
|
|
118
|
+
},
|
|
119
|
+
leadPreferences: {
|
|
120
|
+
getAll: `/leads-preferences`,
|
|
121
|
+
create: `/leads-preferences`,
|
|
122
|
+
getOne: (id) => `/leads-preferences/${id}`,
|
|
123
|
+
deleteOne: (id) => `/leads-preferences/${id}`,
|
|
124
|
+
updateOne: (id) => `/leads-preferences/${id}`,
|
|
125
|
+
},
|
|
112
126
|
agents: {
|
|
113
127
|
getAll: `/salesagent`,
|
|
114
128
|
create: `/salesagent`,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Deposit, Lead, User } from "../../../models";
|
|
2
|
+
import { VehicleSelectFields } from "../../../vehicle";
|
|
3
|
+
export declare class DepositGetFilter {
|
|
4
|
+
stripePaymentIntentIds?: string | string[];
|
|
5
|
+
amount?: number;
|
|
6
|
+
status?: "pending" | "completed" | "failed";
|
|
7
|
+
phoneNumbers?: string | string[];
|
|
8
|
+
emails?: string | string[];
|
|
9
|
+
userIds?: string | string[];
|
|
10
|
+
vehicleIds?: string | string[];
|
|
11
|
+
createdAtStart?: Date;
|
|
12
|
+
createdAtEnd?: Date;
|
|
13
|
+
}
|
|
14
|
+
export declare class DepositGetOptions {
|
|
15
|
+
sort?: Record<keyof Deposit, "asc" | "desc">;
|
|
16
|
+
select?: (keyof Deposit | `vehicle.${VehicleSelectFields}` | `user.${keyof User}` | `lead.${keyof Lead}`)[];
|
|
17
|
+
}
|
|
18
|
+
export declare class DepositGetDTO {
|
|
19
|
+
filter?: DepositGetFilter;
|
|
20
|
+
options?: DepositGetOptions;
|
|
21
|
+
static fromPlain(plain: Record<string, unknown>): DepositGetDTO;
|
|
22
|
+
static toPlain(instance: DepositGetDTO): Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export declare class DepositCreateDTO {
|
|
25
|
+
stripePaymentIntentId: string;
|
|
26
|
+
amount: number;
|
|
27
|
+
currency: string;
|
|
28
|
+
status: "pending" | "completed" | "failed";
|
|
29
|
+
isRefundable: boolean;
|
|
30
|
+
isRefunded: boolean;
|
|
31
|
+
leadId?: string;
|
|
32
|
+
userId?: string;
|
|
33
|
+
vehicleId: string;
|
|
34
|
+
static fromPlain(plain: Record<string, unknown>): DepositCreateDTO;
|
|
35
|
+
static toPlain(instance: DepositCreateDTO): Record<string, unknown>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
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.DepositCreateDTO = exports.DepositGetDTO = exports.DepositGetOptions = exports.DepositGetFilter = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
class DepositGetFilter {
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsOptional)(),
|
|
19
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
20
|
+
__metadata("design:type", Object)
|
|
21
|
+
], DepositGetFilter.prototype, "stripePaymentIntentIds", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsOptional)(),
|
|
24
|
+
(0, class_validator_1.IsNumber)(),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], DepositGetFilter.prototype, "amount", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
(0, class_validator_1.IsEnum)(["pending", "completed", "failed"]),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], DepositGetFilter.prototype, "status", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], DepositGetFilter.prototype, "phoneNumbers", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsEmail)({}, { each: true }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], DepositGetFilter.prototype, "emails", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsUUID)("4", { each: true }),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], DepositGetFilter.prototype, "userIds", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, class_validator_1.IsUUID)("4", { each: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], DepositGetFilter.prototype, "vehicleIds", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
(0, class_validator_1.IsDateString)(),
|
|
55
|
+
__metadata("design:type", Date)
|
|
56
|
+
], DepositGetFilter.prototype, "createdAtStart", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
(0, class_validator_1.IsDateString)(),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], DepositGetFilter.prototype, "createdAtEnd", void 0);
|
|
62
|
+
exports.DepositGetFilter = DepositGetFilter;
|
|
63
|
+
class DepositGetOptions {
|
|
64
|
+
}
|
|
65
|
+
exports.DepositGetOptions = DepositGetOptions;
|
|
66
|
+
class DepositGetDTO {
|
|
67
|
+
static fromPlain(plain) {
|
|
68
|
+
return (0, class_transformer_1.plainToClass)(DepositGetDTO, plain);
|
|
69
|
+
}
|
|
70
|
+
static toPlain(instance) {
|
|
71
|
+
return (0, class_transformer_1.instanceToPlain)(instance);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.DepositGetDTO = DepositGetDTO;
|
|
75
|
+
class DepositCreateDTO {
|
|
76
|
+
static fromPlain(plain) {
|
|
77
|
+
return (0, class_transformer_1.plainToClass)(DepositCreateDTO, plain);
|
|
78
|
+
}
|
|
79
|
+
static toPlain(instance) {
|
|
80
|
+
return (0, class_transformer_1.instanceToPlain)(instance);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, class_validator_1.IsString)(),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], DepositCreateDTO.prototype, "stripePaymentIntentId", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, class_validator_1.IsNumber)(),
|
|
89
|
+
__metadata("design:type", Number)
|
|
90
|
+
], DepositCreateDTO.prototype, "amount", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, class_validator_1.IsString)(),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], DepositCreateDTO.prototype, "currency", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, class_validator_1.IsEnum)(["pending", "completed", "failed"]),
|
|
97
|
+
__metadata("design:type", String)
|
|
98
|
+
], DepositCreateDTO.prototype, "status", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, class_validator_1.IsBoolean)(),
|
|
101
|
+
__metadata("design:type", Boolean)
|
|
102
|
+
], DepositCreateDTO.prototype, "isRefundable", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, class_validator_1.IsBoolean)(),
|
|
105
|
+
__metadata("design:type", Boolean)
|
|
106
|
+
], DepositCreateDTO.prototype, "isRefunded", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, class_validator_1.IsOptional)(),
|
|
109
|
+
(0, class_validator_1.IsUUID)("4"),
|
|
110
|
+
__metadata("design:type", String)
|
|
111
|
+
], DepositCreateDTO.prototype, "leadId", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, class_validator_1.IsOptional)(),
|
|
114
|
+
(0, class_validator_1.IsUUID)("4"),
|
|
115
|
+
__metadata("design:type", String)
|
|
116
|
+
], DepositCreateDTO.prototype, "userId", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, class_validator_1.IsUUID)("4"),
|
|
119
|
+
__metadata("design:type", String)
|
|
120
|
+
], DepositCreateDTO.prototype, "vehicleId", void 0);
|
|
121
|
+
exports.DepositCreateDTO = DepositCreateDTO;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dto/DepositDTOs";
|
|
@@ -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("./dto/DepositDTOs"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./data";
|
|
@@ -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("./data"), exports);
|
package/dist/features/index.d.ts
CHANGED
package/dist/features/index.js
CHANGED
|
@@ -25,3 +25,5 @@ __exportStar(require("./finance-eligibilty-request"), exports);
|
|
|
25
25
|
__exportStar(require("./vehicle-reservations"), exports);
|
|
26
26
|
__exportStar(require("./auth"), exports);
|
|
27
27
|
__exportStar(require("./google-review"), exports);
|
|
28
|
+
__exportStar(require("./deposits"), exports);
|
|
29
|
+
__exportStar(require("./lead"), exports);
|
|
@@ -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("./lead_dto"), exports);
|
|
18
|
+
__exportStar(require("./lead_preference_history_dto"), exports);
|
|
19
|
+
__exportStar(require("./lead_prefernce_dto"), exports);
|
|
@@ -3,8 +3,9 @@ import { LeadSource } from "../enum/lead_source_status_types";
|
|
|
3
3
|
import { LeadPreferencesDTO } from "./lead_prefernce_dto";
|
|
4
4
|
import { TypedFilter, TypedOptions } from "../../../../global/utilities";
|
|
5
5
|
import { BaseGetDTO } from "../../../../global";
|
|
6
|
+
import { Deposit } from "../../../models/Deposit";
|
|
6
7
|
export declare class LeadDTO {
|
|
7
|
-
id
|
|
8
|
+
id: string;
|
|
8
9
|
firstName: string;
|
|
9
10
|
lastName: string;
|
|
10
11
|
email?: string;
|
|
@@ -22,6 +23,7 @@ export declare class LeadDTO {
|
|
|
22
23
|
isActive: boolean;
|
|
23
24
|
lastContactedAt?: Date;
|
|
24
25
|
preference?: LeadPreferencesDTO;
|
|
26
|
+
deposits?: Deposit[];
|
|
25
27
|
validate(): string[];
|
|
26
28
|
static fromPlain(plain: Record<string, unknown>): LeadDTO;
|
|
27
29
|
toPlain(): Record<string, unknown>;
|
|
@@ -47,6 +49,34 @@ export declare class LeadUpdateDTO {
|
|
|
47
49
|
static fromPlain(plain: Record<string, unknown>): LeadUpdateDTO;
|
|
48
50
|
toPlain(): Record<string, unknown>;
|
|
49
51
|
}
|
|
52
|
+
export declare class LeadCreateDTO {
|
|
53
|
+
firstName: string;
|
|
54
|
+
lastName: string;
|
|
55
|
+
email: string;
|
|
56
|
+
phone: string;
|
|
57
|
+
alternatePhone?: string;
|
|
58
|
+
address?: string;
|
|
59
|
+
city?: string;
|
|
60
|
+
state?: string;
|
|
61
|
+
country?: string;
|
|
62
|
+
zipCode?: string;
|
|
63
|
+
company?: string;
|
|
64
|
+
jobTitle?: string;
|
|
65
|
+
notes?: string;
|
|
66
|
+
source?: string;
|
|
67
|
+
status?: string;
|
|
68
|
+
assignedTo?: string;
|
|
69
|
+
leadType?: string;
|
|
70
|
+
leadStage?: string;
|
|
71
|
+
rating?: number;
|
|
72
|
+
isQualified?: boolean;
|
|
73
|
+
lastContactDate?: Date;
|
|
74
|
+
lastContactType?: string;
|
|
75
|
+
totalInteractions?: number;
|
|
76
|
+
validate(): string[];
|
|
77
|
+
static fromPlain(plain: Record<string, unknown>): LeadCreateDTO;
|
|
78
|
+
toPlain(): Record<string, unknown>;
|
|
79
|
+
}
|
|
50
80
|
export declare class LeadFilter extends TypedFilter {
|
|
51
81
|
id?: string | string[];
|
|
52
82
|
firstName?: string | string[];
|
|
@@ -57,9 +87,16 @@ export declare class LeadFilter extends TypedFilter {
|
|
|
57
87
|
leadSource?: LeadSource | LeadSource[];
|
|
58
88
|
isTestDriveScheduled?: boolean;
|
|
59
89
|
isActive?: boolean;
|
|
90
|
+
search?: string;
|
|
60
91
|
lastContactedAt?: Date;
|
|
92
|
+
fromDate?: Date;
|
|
93
|
+
toDate?: Date;
|
|
94
|
+
}
|
|
95
|
+
export declare class LeadOptions extends TypedOptions<LeadDTO> {
|
|
61
96
|
}
|
|
62
97
|
export declare class LeadGetDTO extends BaseGetDTO<LeadDTO, LeadFilter> {
|
|
63
98
|
filters?: LeadFilter;
|
|
64
|
-
options?:
|
|
99
|
+
options?: LeadOptions;
|
|
100
|
+
static fromPlain<T extends BaseGetDTO<LeadDTO, LeadFilter>>(this: new () => T, plain: Record<string, unknown>): T;
|
|
101
|
+
toPlain(): Record<string, unknown>;
|
|
65
102
|
}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LeadGetDTO = exports.LeadFilter = exports.LeadUpdateDTO = exports.LeadDTO = void 0;
|
|
12
|
+
exports.LeadGetDTO = exports.LeadOptions = exports.LeadFilter = exports.LeadCreateDTO = exports.LeadUpdateDTO = exports.LeadDTO = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const lead_status_type_1 = require("../enum/lead_status_type");
|
|
15
15
|
const lead_source_status_types_1 = require("../enum/lead_source_status_types");
|
|
@@ -104,6 +104,10 @@ __decorate([
|
|
|
104
104
|
(0, class_validator_1.IsOptional)(),
|
|
105
105
|
__metadata("design:type", lead_prefernce_dto_1.LeadPreferencesDTO)
|
|
106
106
|
], LeadDTO.prototype, "preference", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, class_validator_1.IsOptional)(),
|
|
109
|
+
__metadata("design:type", Array)
|
|
110
|
+
], LeadDTO.prototype, "deposits", void 0);
|
|
107
111
|
exports.LeadDTO = LeadDTO;
|
|
108
112
|
class LeadUpdateDTO {
|
|
109
113
|
validate() {
|
|
@@ -202,6 +206,132 @@ __decorate([
|
|
|
202
206
|
__metadata("design:type", lead_prefernce_dto_1.LeadPreferencesDTO)
|
|
203
207
|
], LeadUpdateDTO.prototype, "preference", void 0);
|
|
204
208
|
exports.LeadUpdateDTO = LeadUpdateDTO;
|
|
209
|
+
class LeadCreateDTO {
|
|
210
|
+
validate() {
|
|
211
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
212
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
213
|
+
}
|
|
214
|
+
static fromPlain(plain) {
|
|
215
|
+
return (0, class_transformer_1.plainToClass)(LeadCreateDTO, plain);
|
|
216
|
+
}
|
|
217
|
+
toPlain() {
|
|
218
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
__decorate([
|
|
222
|
+
(0, class_validator_1.IsString)(),
|
|
223
|
+
__metadata("design:type", String)
|
|
224
|
+
], LeadCreateDTO.prototype, "firstName", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
(0, class_validator_1.IsString)(),
|
|
227
|
+
__metadata("design:type", String)
|
|
228
|
+
], LeadCreateDTO.prototype, "lastName", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
(0, class_validator_1.IsString)(),
|
|
231
|
+
(0, class_validator_1.IsEmail)(),
|
|
232
|
+
__metadata("design:type", String)
|
|
233
|
+
], LeadCreateDTO.prototype, "email", void 0);
|
|
234
|
+
__decorate([
|
|
235
|
+
(0, class_validator_1.IsString)(),
|
|
236
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
237
|
+
__metadata("design:type", String)
|
|
238
|
+
], LeadCreateDTO.prototype, "phone", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
(0, class_validator_1.IsString)(),
|
|
241
|
+
(0, class_validator_1.IsOptional)(),
|
|
242
|
+
__metadata("design:type", String)
|
|
243
|
+
], LeadCreateDTO.prototype, "alternatePhone", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
(0, class_validator_1.IsString)(),
|
|
246
|
+
(0, class_validator_1.IsOptional)(),
|
|
247
|
+
__metadata("design:type", String)
|
|
248
|
+
], LeadCreateDTO.prototype, "address", void 0);
|
|
249
|
+
__decorate([
|
|
250
|
+
(0, class_validator_1.IsString)(),
|
|
251
|
+
(0, class_validator_1.IsOptional)(),
|
|
252
|
+
__metadata("design:type", String)
|
|
253
|
+
], LeadCreateDTO.prototype, "city", void 0);
|
|
254
|
+
__decorate([
|
|
255
|
+
(0, class_validator_1.IsString)(),
|
|
256
|
+
(0, class_validator_1.IsOptional)(),
|
|
257
|
+
__metadata("design:type", String)
|
|
258
|
+
], LeadCreateDTO.prototype, "state", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
(0, class_validator_1.IsString)(),
|
|
261
|
+
(0, class_validator_1.IsOptional)(),
|
|
262
|
+
__metadata("design:type", String)
|
|
263
|
+
], LeadCreateDTO.prototype, "country", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
(0, class_validator_1.IsString)(),
|
|
266
|
+
(0, class_validator_1.IsOptional)(),
|
|
267
|
+
__metadata("design:type", String)
|
|
268
|
+
], LeadCreateDTO.prototype, "zipCode", void 0);
|
|
269
|
+
__decorate([
|
|
270
|
+
(0, class_validator_1.IsString)(),
|
|
271
|
+
(0, class_validator_1.IsOptional)(),
|
|
272
|
+
__metadata("design:type", String)
|
|
273
|
+
], LeadCreateDTO.prototype, "company", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
(0, class_validator_1.IsString)(),
|
|
276
|
+
(0, class_validator_1.IsOptional)(),
|
|
277
|
+
__metadata("design:type", String)
|
|
278
|
+
], LeadCreateDTO.prototype, "jobTitle", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
(0, class_validator_1.IsString)(),
|
|
281
|
+
(0, class_validator_1.IsOptional)(),
|
|
282
|
+
__metadata("design:type", String)
|
|
283
|
+
], LeadCreateDTO.prototype, "notes", void 0);
|
|
284
|
+
__decorate([
|
|
285
|
+
(0, class_validator_1.IsString)(),
|
|
286
|
+
(0, class_validator_1.IsOptional)(),
|
|
287
|
+
__metadata("design:type", String)
|
|
288
|
+
], LeadCreateDTO.prototype, "source", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
(0, class_validator_1.IsString)(),
|
|
291
|
+
(0, class_validator_1.IsOptional)(),
|
|
292
|
+
__metadata("design:type", String)
|
|
293
|
+
], LeadCreateDTO.prototype, "status", void 0);
|
|
294
|
+
__decorate([
|
|
295
|
+
(0, class_validator_1.IsString)(),
|
|
296
|
+
(0, class_validator_1.IsOptional)(),
|
|
297
|
+
__metadata("design:type", String)
|
|
298
|
+
], LeadCreateDTO.prototype, "assignedTo", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
(0, class_validator_1.IsString)(),
|
|
301
|
+
(0, class_validator_1.IsOptional)(),
|
|
302
|
+
__metadata("design:type", String)
|
|
303
|
+
], LeadCreateDTO.prototype, "leadType", void 0);
|
|
304
|
+
__decorate([
|
|
305
|
+
(0, class_validator_1.IsString)(),
|
|
306
|
+
(0, class_validator_1.IsOptional)(),
|
|
307
|
+
__metadata("design:type", String)
|
|
308
|
+
], LeadCreateDTO.prototype, "leadStage", void 0);
|
|
309
|
+
__decorate([
|
|
310
|
+
(0, class_validator_1.IsNumber)(),
|
|
311
|
+
(0, class_validator_1.IsOptional)(),
|
|
312
|
+
__metadata("design:type", Number)
|
|
313
|
+
], LeadCreateDTO.prototype, "rating", void 0);
|
|
314
|
+
__decorate([
|
|
315
|
+
(0, class_validator_1.IsBoolean)(),
|
|
316
|
+
(0, class_validator_1.IsOptional)(),
|
|
317
|
+
__metadata("design:type", Boolean)
|
|
318
|
+
], LeadCreateDTO.prototype, "isQualified", void 0);
|
|
319
|
+
__decorate([
|
|
320
|
+
(0, class_validator_1.IsDate)(),
|
|
321
|
+
(0, class_validator_1.IsOptional)(),
|
|
322
|
+
__metadata("design:type", Date)
|
|
323
|
+
], LeadCreateDTO.prototype, "lastContactDate", void 0);
|
|
324
|
+
__decorate([
|
|
325
|
+
(0, class_validator_1.IsString)(),
|
|
326
|
+
(0, class_validator_1.IsOptional)(),
|
|
327
|
+
__metadata("design:type", String)
|
|
328
|
+
], LeadCreateDTO.prototype, "lastContactType", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
(0, class_validator_1.IsNumber)(),
|
|
331
|
+
(0, class_validator_1.IsOptional)(),
|
|
332
|
+
__metadata("design:type", Number)
|
|
333
|
+
], LeadCreateDTO.prototype, "totalInteractions", void 0);
|
|
334
|
+
exports.LeadCreateDTO = LeadCreateDTO;
|
|
205
335
|
class LeadFilter extends utilities_1.TypedFilter {
|
|
206
336
|
}
|
|
207
337
|
__decorate([
|
|
@@ -249,14 +379,38 @@ __decorate([
|
|
|
249
379
|
(0, class_validator_1.IsBoolean)(),
|
|
250
380
|
__metadata("design:type", Boolean)
|
|
251
381
|
], LeadFilter.prototype, "isActive", void 0);
|
|
382
|
+
__decorate([
|
|
383
|
+
(0, class_validator_1.IsOptional)(),
|
|
384
|
+
(0, class_validator_1.IsString)(),
|
|
385
|
+
__metadata("design:type", String)
|
|
386
|
+
], LeadFilter.prototype, "search", void 0);
|
|
252
387
|
__decorate([
|
|
253
388
|
(0, class_validator_1.IsOptional)(),
|
|
254
389
|
(0, class_transformer_1.Type)(() => Date),
|
|
255
390
|
(0, class_validator_1.ValidateNested)(),
|
|
256
391
|
__metadata("design:type", Date)
|
|
257
392
|
], LeadFilter.prototype, "lastContactedAt", void 0);
|
|
393
|
+
__decorate([
|
|
394
|
+
(0, class_validator_1.IsOptional)(),
|
|
395
|
+
(0, class_transformer_1.Type)(() => Date),
|
|
396
|
+
__metadata("design:type", Date)
|
|
397
|
+
], LeadFilter.prototype, "fromDate", void 0);
|
|
398
|
+
__decorate([
|
|
399
|
+
(0, class_validator_1.IsOptional)(),
|
|
400
|
+
(0, class_transformer_1.Type)(() => Date),
|
|
401
|
+
__metadata("design:type", Date)
|
|
402
|
+
], LeadFilter.prototype, "toDate", void 0);
|
|
258
403
|
exports.LeadFilter = LeadFilter;
|
|
404
|
+
class LeadOptions extends utilities_1.TypedOptions {
|
|
405
|
+
}
|
|
406
|
+
exports.LeadOptions = LeadOptions;
|
|
259
407
|
class LeadGetDTO extends global_1.BaseGetDTO {
|
|
408
|
+
static fromPlain(plain) {
|
|
409
|
+
return (0, class_transformer_1.plainToClass)(this, plain);
|
|
410
|
+
}
|
|
411
|
+
toPlain() {
|
|
412
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
413
|
+
}
|
|
260
414
|
}
|
|
261
415
|
__decorate([
|
|
262
416
|
(0, class_validator_1.ValidateNested)(),
|
|
@@ -266,8 +420,8 @@ __decorate([
|
|
|
266
420
|
], LeadGetDTO.prototype, "filters", void 0);
|
|
267
421
|
__decorate([
|
|
268
422
|
(0, class_validator_1.ValidateNested)(),
|
|
269
|
-
(0, class_transformer_1.Type)(() =>
|
|
423
|
+
(0, class_transformer_1.Type)(() => LeadOptions),
|
|
270
424
|
(0, class_validator_1.IsOptional)(),
|
|
271
|
-
__metadata("design:type",
|
|
425
|
+
__metadata("design:type", LeadOptions)
|
|
272
426
|
], LeadGetDTO.prototype, "options", void 0);
|
|
273
427
|
exports.LeadGetDTO = LeadGetDTO;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { BaseGetDTO, TypedFilter, TypedOptions } from "../../../../global";
|
|
2
|
+
import { LeadDTO } from "./lead_dto";
|
|
3
|
+
import { Range } from "../../../../core";
|
|
4
|
+
export declare enum CarCondition {
|
|
5
|
+
NEW = "NEW",
|
|
6
|
+
USED = "USED",
|
|
7
|
+
BOTH = "BOTH"
|
|
8
|
+
}
|
|
9
|
+
export declare enum TransmissionType {
|
|
10
|
+
AUTOMATIC = "AUTOMATIC",
|
|
11
|
+
MANUAL = "MANUAL",
|
|
12
|
+
BOTH = "BOTH"
|
|
13
|
+
}
|
|
14
|
+
export declare enum FuelType {
|
|
15
|
+
PETROL = "PETROL",
|
|
16
|
+
DIESEL = "DIESEL",
|
|
17
|
+
ELECTRIC = "ELECTRIC",
|
|
18
|
+
HYBRID = "HYBRID",
|
|
19
|
+
ANY = "ANY"
|
|
20
|
+
}
|
|
21
|
+
export declare class LeadPreferenceHistoryDTO {
|
|
22
|
+
id: string;
|
|
23
|
+
lead: LeadDTO;
|
|
24
|
+
budgetMin?: number;
|
|
25
|
+
budgetMax?: number;
|
|
26
|
+
preferredMake?: string;
|
|
27
|
+
preferredModel?: string;
|
|
28
|
+
preferredYearMin?: number;
|
|
29
|
+
preferredYearMax?: number;
|
|
30
|
+
preferredColors?: string[];
|
|
31
|
+
preferredFeatures?: string[];
|
|
32
|
+
carCondition: CarCondition;
|
|
33
|
+
transmissionType: TransmissionType;
|
|
34
|
+
fuelType: FuelType;
|
|
35
|
+
additionalPreferences?: string;
|
|
36
|
+
changeReason?: string;
|
|
37
|
+
changedByUserId: string;
|
|
38
|
+
createdAt: Date;
|
|
39
|
+
updatedAt: Date;
|
|
40
|
+
validate(): string[];
|
|
41
|
+
static fromPlain(plain: Record<string, unknown>): LeadPreferenceHistoryDTO;
|
|
42
|
+
toPlain(): Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
export declare class LeadPreferenceHistoryCreateDTO {
|
|
45
|
+
leadId: string;
|
|
46
|
+
budgetMin?: number;
|
|
47
|
+
budgetMax?: number;
|
|
48
|
+
preferredMake?: string;
|
|
49
|
+
preferredModel?: string;
|
|
50
|
+
preferredYearMin?: number;
|
|
51
|
+
preferredYearMax?: number;
|
|
52
|
+
preferredColors?: string[];
|
|
53
|
+
preferredFeatures?: string[];
|
|
54
|
+
carCondition: CarCondition;
|
|
55
|
+
transmissionType: TransmissionType;
|
|
56
|
+
fuelType: FuelType;
|
|
57
|
+
additionalPreferences?: string;
|
|
58
|
+
changeReason: string;
|
|
59
|
+
changedByUserId: string;
|
|
60
|
+
validate(): string[];
|
|
61
|
+
static fromPlain(plain: Record<string, unknown>): LeadPreferenceHistoryCreateDTO;
|
|
62
|
+
toPlain(): Record<string, unknown>;
|
|
63
|
+
}
|
|
64
|
+
export declare class LeadPreferenceHistoryFilter extends TypedFilter {
|
|
65
|
+
id?: string | string[];
|
|
66
|
+
leadId?: string | string[];
|
|
67
|
+
budgetRange?: Range;
|
|
68
|
+
make?: string;
|
|
69
|
+
model?: string;
|
|
70
|
+
yearRange?: Range;
|
|
71
|
+
colors?: string[];
|
|
72
|
+
features?: string[];
|
|
73
|
+
carCondition?: CarCondition | CarCondition[];
|
|
74
|
+
transmissionType?: TransmissionType | TransmissionType[];
|
|
75
|
+
fuelType?: FuelType | FuelType[];
|
|
76
|
+
changedByUserId?: string | string[];
|
|
77
|
+
search?: string;
|
|
78
|
+
fromDate?: Date;
|
|
79
|
+
toDate?: Date;
|
|
80
|
+
}
|
|
81
|
+
export declare class LeadPreferenceHistoryGetDTO extends BaseGetDTO<LeadPreferenceHistoryDTO, LeadPreferenceHistoryFilter> {
|
|
82
|
+
filters?: LeadPreferenceHistoryFilter;
|
|
83
|
+
options?: TypedOptions<LeadPreferenceHistoryDTO>;
|
|
84
|
+
}
|