@alba-cars/common-modules 1.3.3 → 1.3.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/network/endpoint-config.d.ts +5 -0
- package/dist/core/network/endpoint-config.js +11 -0
- package/dist/core/network/fetch-api.d.ts +8 -0
- package/dist/core/network/fetch-api.js +130 -30
- package/dist/features/auth/data/dto/AuthDTO.d.ts +8 -7
- package/dist/features/auth/data/dto/AuthDTO.js +21 -0
- package/dist/features/auth/data/dto/RoleDTO.d.ts +37 -0
- package/dist/features/auth/data/dto/RoleDTO.js +119 -0
- package/dist/features/auth/data/dto/UserDTO.d.ts +40 -0
- package/dist/features/auth/data/dto/UserDTO.js +120 -0
- package/dist/features/auth/data/index.d.ts +2 -0
- package/dist/features/auth/data/index.js +2 -0
- package/dist/features/models/Roles.d.ts +7 -0
- package/dist/features/models/Roles.js +2 -0
- package/dist/features/models/User.d.ts +14 -0
- package/dist/features/{vehicle/data/models → models}/User.js +0 -4
- package/dist/features/{vehicle/data/models → models}/Vehicle.d.ts +8 -0
- package/dist/features/models/Vehicle.js +17 -0
- package/dist/features/{vehicle/data/models → models}/VehicleMedia.d.ts +1 -1
- package/dist/features/{vehicle/data/models → models}/index.js +1 -3
- package/dist/features/sales-team/data/dto/LanguageDTO.d.ts +20 -0
- package/dist/features/sales-team/data/dto/LanguageDTO.js +89 -0
- package/dist/features/sales-team/data/dto/SalesAgentDTO.d.ts +17 -22
- package/dist/features/sales-team/data/dto/SalesAgentDTO.js +69 -45
- package/dist/features/sales-team/data/index.d.ts +1 -0
- package/dist/features/sales-team/data/index.js +1 -0
- package/dist/features/showroom-visit/data/dto/ShowroomVisit.d.ts +19 -0
- package/dist/features/showroom-visit/data/dto/ShowroomVisit.js +46 -1
- package/dist/features/test-drive-request/data/dto/TestDriveRequestDTO.d.ts +3 -2
- package/dist/features/test-drive-request/data/dto/TestDriveRequestDTO.js +7 -4
- package/dist/features/test-drive-request/data/models/TestDriveRequest.d.ts +2 -2
- package/dist/features/test-drive-request/data/models/TestDriveRequest.js +1 -1
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.d.ts +6 -2
- package/dist/features/vehicle/data/dto/VehicleFilterDTO.js +21 -0
- package/dist/features/vehicle/data/dto/VehicleMakeDTO.d.ts +5 -5
- package/dist/features/vehicle/data/dto/VehicleMakeDTO.js +7 -7
- package/dist/features/vehicle/data/dto/VehicleModelDTO.d.ts +2 -2
- package/dist/features/vehicle/data/dto/VehicleModelDTO.js +2 -2
- package/dist/features/vehicle/data/dto/index.d.ts +0 -1
- package/dist/features/vehicle/data/dto/index.js +0 -1
- package/dist/features/vehicle/data/enums/index.d.ts +7 -0
- package/dist/features/vehicle/data/enums/index.js +9 -1
- package/dist/features/vehicle/data/index.d.ts +1 -1
- package/dist/features/vehicle/data/index.js +1 -1
- package/dist/features/vehicle/data/utilities.d.ts +11 -7
- package/dist/features/vehicle/data/utilities.js +20 -0
- package/dist/global/utilities.d.ts +1 -0
- package/dist/global/utilities.js +35 -2
- package/package.json +1 -1
- package/dist/core/error-handling/errorHandler.d.ts +0 -5
- package/dist/core/error-handling/errorHandler.js +0 -69
- package/dist/core/network/react-query.d.ts +0 -6
- package/dist/core/network/react-query.js +0 -15
- package/dist/features/sales-team/api/AddAgent.d.ts +0 -2
- package/dist/features/sales-team/api/AddAgent.js +0 -20
- package/dist/features/sales-team/api/EditAgent.d.ts +0 -2
- package/dist/features/sales-team/api/EditAgent.js +0 -21
- package/dist/features/sales-team/api/GetAgent.d.ts +0 -3
- package/dist/features/sales-team/api/GetAgent.js +0 -19
- package/dist/features/sales-team/api/RemoveAgent.d.ts +0 -1
- package/dist/features/sales-team/api/RemoveAgent.js +0 -15
- package/dist/features/sales-team/api/index.d.ts +0 -4
- package/dist/features/sales-team/api/index.js +0 -20
- package/dist/features/vehicle/api/make/CreateMake.d.ts +0 -2
- package/dist/features/vehicle/api/make/CreateMake.js +0 -22
- package/dist/features/vehicle/api/make/DeleteMake.d.ts +0 -2
- package/dist/features/vehicle/api/make/DeleteMake.js +0 -17
- package/dist/features/vehicle/api/make/GetAllMakes.d.ts +0 -3
- package/dist/features/vehicle/api/make/GetAllMakes.js +0 -26
- package/dist/features/vehicle/api/make/UpdateMake.d.ts +0 -2
- package/dist/features/vehicle/api/make/UpdateMake.js +0 -22
- package/dist/features/vehicle/api/models/CreateModel.d.ts +0 -2
- package/dist/features/vehicle/api/models/CreateModel.js +0 -22
- package/dist/features/vehicle/api/models/DeleteModel.d.ts +0 -2
- package/dist/features/vehicle/api/models/DeleteModel.js +0 -17
- package/dist/features/vehicle/api/models/GetAllModels.d.ts +0 -3
- package/dist/features/vehicle/api/models/GetAllModels.js +0 -37
- package/dist/features/vehicle/api/models/UpdateModel.d.ts +0 -2
- package/dist/features/vehicle/api/models/UpdateModel.js +0 -22
- package/dist/features/vehicle/data/dto/UserDTO.d.ts +0 -16
- package/dist/features/vehicle/data/dto/UserDTO.js +0 -53
- package/dist/features/vehicle/data/models/User.d.ts +0 -15
- package/dist/features/vehicle/data/models/Vehicle.js +0 -7
- /package/dist/features/{vehicle/data/models → models}/Base.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/Base.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/Payment.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/Payment.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleBodyType.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleBodyType.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleCategory.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleCategory.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleFeature.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleFeature.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleFeatureCategory.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleFeatureCategory.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleFinance.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleFinance.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleMake.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleMake.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleMedia.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleMetaData.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleMetaData.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleModel.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleModel.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleOrder.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/VehicleOrder.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/_index.d.ts +0 -0
- /package/dist/features/{vehicle/data/models → models}/_index.js +0 -0
- /package/dist/features/{vehicle/data/models → models}/index.d.ts +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Role } from "./Roles";
|
|
2
|
+
export interface User {
|
|
3
|
+
id: string;
|
|
4
|
+
refId: number;
|
|
5
|
+
email: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
phone?: string;
|
|
8
|
+
photo?: string;
|
|
9
|
+
roles: Role[];
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
lastLogin?: Date;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
}
|
|
@@ -40,4 +40,12 @@ export declare class Vehicle extends BaseModel {
|
|
|
40
40
|
metaData?: VehicleMetaData;
|
|
41
41
|
finance?: VehicleFinance;
|
|
42
42
|
orders?: VehicleOrder[];
|
|
43
|
+
draft?: VehicleDraft;
|
|
44
|
+
static fromPlain(plain: Record<string, unknown>): Vehicle;
|
|
45
|
+
toPlain(): Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
export declare class VehicleDraft {
|
|
48
|
+
page: number;
|
|
49
|
+
isDraft: boolean;
|
|
50
|
+
lastUpdated: string;
|
|
43
51
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VehicleDraft = exports.Vehicle = void 0;
|
|
4
|
+
const class_transformer_1 = require("class-transformer");
|
|
5
|
+
const Base_1 = require("./Base");
|
|
6
|
+
class Vehicle extends Base_1.BaseModel {
|
|
7
|
+
static fromPlain(plain) {
|
|
8
|
+
return (0, class_transformer_1.plainToClass)(Vehicle, plain);
|
|
9
|
+
}
|
|
10
|
+
toPlain() {
|
|
11
|
+
return (0, class_transformer_1.instanceToPlain)(this);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.Vehicle = Vehicle;
|
|
15
|
+
class VehicleDraft {
|
|
16
|
+
}
|
|
17
|
+
exports.VehicleDraft = VehicleDraft;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VehicleMetaData = exports.VehicleMedia = exports.VehicleModel = exports.VehicleMake = exports.VehicleFinance = exports.
|
|
3
|
+
exports.VehicleMetaData = exports.VehicleMedia = exports.VehicleModel = exports.VehicleMake = exports.VehicleFinance = exports.Payment = exports.VehicleBodyType = exports.VehicleFeatureCategory = exports.VehicleFeature = exports.VehicleOrder = exports.Vehicle = exports.BaseModel = void 0;
|
|
4
4
|
const Base_1 = require("./Base");
|
|
5
5
|
Object.defineProperty(exports, "BaseModel", { enumerable: true, get: function () { return Base_1.BaseModel; } });
|
|
6
6
|
const Vehicle_1 = require("./Vehicle");
|
|
@@ -15,8 +15,6 @@ const VehicleBodyType_1 = require("./VehicleBodyType");
|
|
|
15
15
|
Object.defineProperty(exports, "VehicleBodyType", { enumerable: true, get: function () { return VehicleBodyType_1.VehicleBodyType; } });
|
|
16
16
|
const Payment_1 = require("./Payment");
|
|
17
17
|
Object.defineProperty(exports, "Payment", { enumerable: true, get: function () { return Payment_1.Payment; } });
|
|
18
|
-
const User_1 = require("./User");
|
|
19
|
-
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
|
|
20
18
|
const VehicleFinance_1 = require("./VehicleFinance");
|
|
21
19
|
Object.defineProperty(exports, "VehicleFinance", { enumerable: true, get: function () { return VehicleFinance_1.VehicleFinance; } });
|
|
22
20
|
const VehicleMake_1 = require("./VehicleMake");
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class LanguageDTO {
|
|
2
|
+
id: string;
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
static fromEntity(entity: any): LanguageDTO;
|
|
6
|
+
}
|
|
7
|
+
export declare class LanguageCreateDTO {
|
|
8
|
+
code: string;
|
|
9
|
+
name: string;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
validate(): string[];
|
|
12
|
+
static fromPlain(plain: Record<string, unknown>): LanguageCreateDTO;
|
|
13
|
+
}
|
|
14
|
+
export declare class LanguageUpdateDTO {
|
|
15
|
+
code?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
isActive?: boolean;
|
|
18
|
+
validate(): string[];
|
|
19
|
+
static fromPlain(plain: Record<string, unknown>): LanguageUpdateDTO;
|
|
20
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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.LanguageUpdateDTO = exports.LanguageCreateDTO = exports.LanguageDTO = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class LanguageDTO {
|
|
16
|
+
static fromEntity(entity) {
|
|
17
|
+
const dto = new LanguageDTO();
|
|
18
|
+
dto.id = entity.id;
|
|
19
|
+
dto.code = entity.code;
|
|
20
|
+
dto.name = entity.name;
|
|
21
|
+
return dto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsUUID)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], LanguageDTO.prototype, "id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], LanguageDTO.prototype, "code", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], LanguageDTO.prototype, "name", void 0);
|
|
36
|
+
exports.LanguageDTO = LanguageDTO;
|
|
37
|
+
class LanguageCreateDTO {
|
|
38
|
+
constructor() {
|
|
39
|
+
this.isActive = true;
|
|
40
|
+
}
|
|
41
|
+
validate() {
|
|
42
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
43
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
44
|
+
}
|
|
45
|
+
static fromPlain(plain) {
|
|
46
|
+
return (0, class_transformer_1.plainToClass)(LanguageCreateDTO, plain);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsString)(),
|
|
51
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], LanguageCreateDTO.prototype, "code", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, class_validator_1.IsString)(),
|
|
56
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], LanguageCreateDTO.prototype, "name", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, class_validator_1.IsOptional)(),
|
|
61
|
+
(0, class_validator_1.IsBoolean)(),
|
|
62
|
+
__metadata("design:type", Boolean)
|
|
63
|
+
], LanguageCreateDTO.prototype, "isActive", void 0);
|
|
64
|
+
exports.LanguageCreateDTO = LanguageCreateDTO;
|
|
65
|
+
class LanguageUpdateDTO {
|
|
66
|
+
validate() {
|
|
67
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
68
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
69
|
+
}
|
|
70
|
+
static fromPlain(plain) {
|
|
71
|
+
return (0, class_transformer_1.plainToClass)(LanguageUpdateDTO, plain);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
(0, class_validator_1.IsString)(),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], LanguageUpdateDTO.prototype, "code", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, class_validator_1.IsOptional)(),
|
|
81
|
+
(0, class_validator_1.IsString)(),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], LanguageUpdateDTO.prototype, "name", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, class_validator_1.IsOptional)(),
|
|
86
|
+
(0, class_validator_1.IsBoolean)(),
|
|
87
|
+
__metadata("design:type", Boolean)
|
|
88
|
+
], LanguageUpdateDTO.prototype, "isActive", void 0);
|
|
89
|
+
exports.LanguageUpdateDTO = LanguageUpdateDTO;
|
|
@@ -1,49 +1,44 @@
|
|
|
1
|
+
import { UserCreateDTO, UserGetDTO, UserUpdateDTO } from "../../../auth/data/dto/UserDTO";
|
|
2
|
+
import { LanguageDTO } from "./LanguageDTO";
|
|
1
3
|
export declare enum Designation {
|
|
2
4
|
MANAGER = "sales-manager",
|
|
3
5
|
EXECUTIVE = "sales-executive"
|
|
4
6
|
}
|
|
5
|
-
export declare enum Gender {
|
|
6
|
-
MALE = "male",
|
|
7
|
-
FEMALE = "female"
|
|
8
|
-
}
|
|
9
7
|
export declare class SalesAgentGetDTO {
|
|
10
8
|
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
email?: string;
|
|
13
9
|
status: number;
|
|
14
10
|
designation: Designation;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
photo?: string;
|
|
20
|
-
static fromEntity(entity: any): SalesAgentGetDTO;
|
|
11
|
+
user: UserGetDTO;
|
|
12
|
+
languages: LanguageDTO[];
|
|
13
|
+
agentIntro?: string;
|
|
14
|
+
static fromPlain(plain: Record<string, unknown>): SalesAgentGetDTO;
|
|
21
15
|
toPlain(): Record<string, unknown>;
|
|
22
16
|
}
|
|
23
17
|
export declare class SalesAgentCreateDTO {
|
|
18
|
+
status?: number;
|
|
19
|
+
designation?: Designation;
|
|
24
20
|
name: string;
|
|
25
21
|
email?: string;
|
|
26
|
-
status: number;
|
|
27
|
-
designation?: Designation;
|
|
28
|
-
dob?: Date;
|
|
29
|
-
gender: Gender;
|
|
30
|
-
address?: string;
|
|
31
22
|
phone: string;
|
|
23
|
+
agentIntro?: string;
|
|
24
|
+
languageIds?: string[];
|
|
32
25
|
photo?: string;
|
|
33
26
|
validate(): string[];
|
|
34
27
|
static fromPlain(plain: Record<string, unknown>): SalesAgentCreateDTO;
|
|
28
|
+
toUserDTO(): UserCreateDTO;
|
|
29
|
+
toSalesAgentData(): Partial<any>;
|
|
35
30
|
}
|
|
36
31
|
export declare class SalesAgentUpdateDTO {
|
|
37
32
|
id?: string;
|
|
38
|
-
name?: string;
|
|
39
|
-
email?: string;
|
|
40
33
|
status?: number;
|
|
41
34
|
designation?: Designation;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
agentIntro?: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
email?: string;
|
|
45
38
|
phone?: string;
|
|
46
39
|
photo?: string;
|
|
47
40
|
validate(): string[];
|
|
48
41
|
static fromPlain(plain: Record<string, unknown>): SalesAgentUpdateDTO;
|
|
42
|
+
toUserDTO(): UserUpdateDTO;
|
|
43
|
+
toSalesAgentData(): Partial<any>;
|
|
49
44
|
}
|
|
@@ -9,22 +9,18 @@ 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.SalesAgentUpdateDTO = exports.SalesAgentCreateDTO = exports.SalesAgentGetDTO = exports.
|
|
12
|
+
exports.SalesAgentUpdateDTO = exports.SalesAgentCreateDTO = exports.SalesAgentGetDTO = exports.Designation = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const UserDTO_1 = require("../../../auth/data/dto/UserDTO");
|
|
15
16
|
var Designation;
|
|
16
17
|
(function (Designation) {
|
|
17
18
|
Designation["MANAGER"] = "sales-manager";
|
|
18
19
|
Designation["EXECUTIVE"] = "sales-executive";
|
|
19
20
|
})(Designation = exports.Designation || (exports.Designation = {}));
|
|
20
|
-
var Gender;
|
|
21
|
-
(function (Gender) {
|
|
22
|
-
Gender["MALE"] = "male";
|
|
23
|
-
Gender["FEMALE"] = "female";
|
|
24
|
-
})(Gender = exports.Gender || (exports.Gender = {}));
|
|
25
21
|
class SalesAgentGetDTO {
|
|
26
|
-
static
|
|
27
|
-
return (0, class_transformer_1.plainToClass)(SalesAgentGetDTO,
|
|
22
|
+
static fromPlain(plain) {
|
|
23
|
+
return (0, class_transformer_1.plainToClass)(SalesAgentGetDTO, plain);
|
|
28
24
|
}
|
|
29
25
|
toPlain() {
|
|
30
26
|
return (0, class_transformer_1.classToPlain)(this);
|
|
@@ -32,23 +28,34 @@ class SalesAgentGetDTO {
|
|
|
32
28
|
}
|
|
33
29
|
exports.SalesAgentGetDTO = SalesAgentGetDTO;
|
|
34
30
|
class SalesAgentCreateDTO {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.status = 1;
|
|
33
|
+
this.designation = Designation.EXECUTIVE;
|
|
34
|
+
}
|
|
35
35
|
validate() {
|
|
36
36
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
37
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
37
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
38
38
|
}
|
|
39
39
|
static fromPlain(plain) {
|
|
40
40
|
return (0, class_transformer_1.plainToClass)(SalesAgentCreateDTO, plain);
|
|
41
41
|
}
|
|
42
|
+
toUserDTO() {
|
|
43
|
+
const userDto = new UserDTO_1.UserCreateDTO();
|
|
44
|
+
userDto.name = this.name;
|
|
45
|
+
userDto.email = this.email;
|
|
46
|
+
userDto.phone = this.phone;
|
|
47
|
+
userDto.photo = this.photo;
|
|
48
|
+
return userDto;
|
|
49
|
+
}
|
|
50
|
+
toSalesAgentData() {
|
|
51
|
+
return {
|
|
52
|
+
status: this.status,
|
|
53
|
+
designation: this.designation,
|
|
54
|
+
languages: this.languageIds,
|
|
55
|
+
agentIntro: this.agentIntro,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
42
58
|
}
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, class_validator_1.IsString)(),
|
|
45
|
-
__metadata("design:type", String)
|
|
46
|
-
], SalesAgentCreateDTO.prototype, "name", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, class_validator_1.IsOptional)(),
|
|
49
|
-
(0, class_validator_1.IsEmail)(),
|
|
50
|
-
__metadata("design:type", String)
|
|
51
|
-
], SalesAgentCreateDTO.prototype, "email", void 0);
|
|
52
59
|
__decorate([
|
|
53
60
|
(0, class_validator_1.IsOptional)(),
|
|
54
61
|
(0, class_validator_1.IsNumber)(),
|
|
@@ -60,23 +67,29 @@ __decorate([
|
|
|
60
67
|
__metadata("design:type", String)
|
|
61
68
|
], SalesAgentCreateDTO.prototype, "designation", void 0);
|
|
62
69
|
__decorate([
|
|
63
|
-
(0, class_validator_1.
|
|
64
|
-
(0, class_validator_1.IsDate)(),
|
|
65
|
-
__metadata("design:type", Date)
|
|
66
|
-
], SalesAgentCreateDTO.prototype, "dob", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
(0, class_validator_1.IsEnum)(Gender),
|
|
70
|
+
(0, class_validator_1.IsString)(),
|
|
69
71
|
__metadata("design:type", String)
|
|
70
|
-
], SalesAgentCreateDTO.prototype, "
|
|
72
|
+
], SalesAgentCreateDTO.prototype, "name", void 0);
|
|
71
73
|
__decorate([
|
|
72
74
|
(0, class_validator_1.IsOptional)(),
|
|
73
|
-
(0, class_validator_1.
|
|
75
|
+
(0, class_validator_1.IsEmail)(),
|
|
74
76
|
__metadata("design:type", String)
|
|
75
|
-
], SalesAgentCreateDTO.prototype, "
|
|
77
|
+
], SalesAgentCreateDTO.prototype, "email", void 0);
|
|
76
78
|
__decorate([
|
|
77
79
|
(0, class_validator_1.IsString)(),
|
|
78
80
|
__metadata("design:type", String)
|
|
79
81
|
], SalesAgentCreateDTO.prototype, "phone", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, class_validator_1.IsOptional)(),
|
|
84
|
+
(0, class_validator_1.IsString)(),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], SalesAgentCreateDTO.prototype, "agentIntro", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
(0, class_validator_1.IsArray)(),
|
|
90
|
+
(0, class_validator_1.IsUUID)("4", { each: true }),
|
|
91
|
+
__metadata("design:type", Array)
|
|
92
|
+
], SalesAgentCreateDTO.prototype, "languageIds", void 0);
|
|
80
93
|
__decorate([
|
|
81
94
|
(0, class_validator_1.IsOptional)(),
|
|
82
95
|
(0, class_validator_1.IsString)(),
|
|
@@ -86,26 +99,37 @@ exports.SalesAgentCreateDTO = SalesAgentCreateDTO;
|
|
|
86
99
|
class SalesAgentUpdateDTO {
|
|
87
100
|
validate() {
|
|
88
101
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
89
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
102
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
90
103
|
}
|
|
91
104
|
static fromPlain(plain) {
|
|
92
105
|
return (0, class_transformer_1.plainToClass)(SalesAgentUpdateDTO, plain);
|
|
93
106
|
}
|
|
107
|
+
toUserDTO() {
|
|
108
|
+
const userDto = new UserDTO_1.UserUpdateDTO();
|
|
109
|
+
if (this.name)
|
|
110
|
+
userDto.name = this.name;
|
|
111
|
+
if (this.email)
|
|
112
|
+
userDto.email = this.email;
|
|
113
|
+
if (this.phone)
|
|
114
|
+
userDto.phone = this.phone;
|
|
115
|
+
if (this.photo)
|
|
116
|
+
userDto.photo = this.photo;
|
|
117
|
+
return userDto;
|
|
118
|
+
}
|
|
119
|
+
toSalesAgentData() {
|
|
120
|
+
const salesAgentData = {};
|
|
121
|
+
if (this.status !== undefined)
|
|
122
|
+
salesAgentData.status = this.status;
|
|
123
|
+
if (this.designation)
|
|
124
|
+
salesAgentData.designation = this.designation;
|
|
125
|
+
return salesAgentData;
|
|
126
|
+
}
|
|
94
127
|
}
|
|
95
128
|
__decorate([
|
|
96
129
|
(0, class_validator_1.IsOptional)(),
|
|
130
|
+
(0, class_validator_1.IsUUID)(),
|
|
97
131
|
__metadata("design:type", String)
|
|
98
132
|
], SalesAgentUpdateDTO.prototype, "id", void 0);
|
|
99
|
-
__decorate([
|
|
100
|
-
(0, class_validator_1.IsOptional)(),
|
|
101
|
-
(0, class_validator_1.IsString)(),
|
|
102
|
-
__metadata("design:type", String)
|
|
103
|
-
], SalesAgentUpdateDTO.prototype, "name", void 0);
|
|
104
|
-
__decorate([
|
|
105
|
-
(0, class_validator_1.IsOptional)(),
|
|
106
|
-
(0, class_validator_1.IsEmail)(),
|
|
107
|
-
__metadata("design:type", String)
|
|
108
|
-
], SalesAgentUpdateDTO.prototype, "email", void 0);
|
|
109
133
|
__decorate([
|
|
110
134
|
(0, class_validator_1.IsOptional)(),
|
|
111
135
|
(0, class_validator_1.IsNumber)(),
|
|
@@ -118,19 +142,19 @@ __decorate([
|
|
|
118
142
|
], SalesAgentUpdateDTO.prototype, "designation", void 0);
|
|
119
143
|
__decorate([
|
|
120
144
|
(0, class_validator_1.IsOptional)(),
|
|
121
|
-
(0, class_validator_1.
|
|
122
|
-
__metadata("design:type",
|
|
123
|
-
], SalesAgentUpdateDTO.prototype, "
|
|
145
|
+
(0, class_validator_1.IsString)(),
|
|
146
|
+
__metadata("design:type", String)
|
|
147
|
+
], SalesAgentUpdateDTO.prototype, "agentIntro", void 0);
|
|
124
148
|
__decorate([
|
|
125
149
|
(0, class_validator_1.IsOptional)(),
|
|
126
|
-
(0, class_validator_1.
|
|
150
|
+
(0, class_validator_1.IsString)(),
|
|
127
151
|
__metadata("design:type", String)
|
|
128
|
-
], SalesAgentUpdateDTO.prototype, "
|
|
152
|
+
], SalesAgentUpdateDTO.prototype, "name", void 0);
|
|
129
153
|
__decorate([
|
|
130
154
|
(0, class_validator_1.IsOptional)(),
|
|
131
|
-
(0, class_validator_1.
|
|
155
|
+
(0, class_validator_1.IsEmail)(),
|
|
132
156
|
__metadata("design:type", String)
|
|
133
|
-
], SalesAgentUpdateDTO.prototype, "
|
|
157
|
+
], SalesAgentUpdateDTO.prototype, "email", void 0);
|
|
134
158
|
__decorate([
|
|
135
159
|
(0, class_validator_1.IsOptional)(),
|
|
136
160
|
(0, class_validator_1.IsString)(),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ValidatorConstraintInterface, ValidationArguments } from "class-validator";
|
|
2
|
+
import { PaginationOptions } from "../../../../global";
|
|
2
3
|
export declare class IsTimeConstraint implements ValidatorConstraintInterface {
|
|
3
4
|
validate(time: string, args: ValidationArguments): boolean;
|
|
4
5
|
defaultMessage(args: ValidationArguments): string;
|
|
@@ -44,6 +45,24 @@ export declare class ShowroomVisitResponseDTO {
|
|
|
44
45
|
static fromPlain(plain: Record<string, unknown>): ShowroomVisitResponseDTO;
|
|
45
46
|
toPlain(): Record<string, unknown>;
|
|
46
47
|
}
|
|
48
|
+
export declare class ShowRoomVisitOptionsDTO extends PaginationOptions {
|
|
49
|
+
static fromPlain(plain: Record<string, unknown>): ShowRoomVisitOptionsDTO;
|
|
50
|
+
toPlain(): Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
export declare class ShowRoomVisitFilterDTO {
|
|
53
|
+
search?: string;
|
|
54
|
+
leadId?: string;
|
|
55
|
+
validate(): string[];
|
|
56
|
+
static fromPlain(plain: Record<string, unknown>): ShowRoomVisitFilterDTO;
|
|
57
|
+
toPlain(): Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
export declare class ShowRoomVisitFetchDTO {
|
|
60
|
+
filter: ShowRoomVisitFilterDTO;
|
|
61
|
+
options: ShowRoomVisitOptionsDTO;
|
|
62
|
+
validate(): string[];
|
|
63
|
+
static fromPlain(plain: Record<string, unknown>): ShowRoomVisitFetchDTO;
|
|
64
|
+
toPlain(): Record<string, unknown>;
|
|
65
|
+
}
|
|
47
66
|
export declare enum VisitStatus {
|
|
48
67
|
SCHEDULED = "SCHEDULED",
|
|
49
68
|
IN_PROGRESS = "IN_PROGRESS",
|
|
@@ -9,9 +9,10 @@ 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.VisitStatus = exports.ShowroomVisitResponseDTO = exports.ShowroomVisitUpdateDTO = exports.ShowroomVisitCreateDTO = exports.IsTimeConstraint = void 0;
|
|
12
|
+
exports.VisitStatus = exports.ShowRoomVisitFetchDTO = exports.ShowRoomVisitFilterDTO = exports.ShowRoomVisitOptionsDTO = exports.ShowroomVisitResponseDTO = exports.ShowroomVisitUpdateDTO = exports.ShowroomVisitCreateDTO = exports.IsTimeConstraint = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const global_1 = require("../../../../global");
|
|
15
16
|
// Custom time format validator
|
|
16
17
|
let IsTimeConstraint = class IsTimeConstraint {
|
|
17
18
|
validate(time, args) {
|
|
@@ -189,6 +190,50 @@ __decorate([
|
|
|
189
190
|
__metadata("design:type", String)
|
|
190
191
|
], ShowroomVisitResponseDTO.prototype, "UpdatedAt", void 0);
|
|
191
192
|
exports.ShowroomVisitResponseDTO = ShowroomVisitResponseDTO;
|
|
193
|
+
class ShowRoomVisitOptionsDTO extends global_1.PaginationOptions {
|
|
194
|
+
static fromPlain(plain) {
|
|
195
|
+
return (0, class_transformer_1.plainToClass)(ShowRoomVisitOptionsDTO, plain);
|
|
196
|
+
}
|
|
197
|
+
toPlain() {
|
|
198
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
exports.ShowRoomVisitOptionsDTO = ShowRoomVisitOptionsDTO;
|
|
202
|
+
class ShowRoomVisitFilterDTO {
|
|
203
|
+
validate() {
|
|
204
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
205
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
206
|
+
}
|
|
207
|
+
static fromPlain(plain) {
|
|
208
|
+
return (0, class_transformer_1.plainToClass)(ShowRoomVisitFilterDTO, plain);
|
|
209
|
+
}
|
|
210
|
+
toPlain() {
|
|
211
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
__decorate([
|
|
215
|
+
(0, class_validator_1.IsOptional)(),
|
|
216
|
+
__metadata("design:type", String)
|
|
217
|
+
], ShowRoomVisitFilterDTO.prototype, "search", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
(0, class_validator_1.IsUUID)(),
|
|
220
|
+
(0, class_validator_1.IsOptional)(),
|
|
221
|
+
__metadata("design:type", String)
|
|
222
|
+
], ShowRoomVisitFilterDTO.prototype, "leadId", void 0);
|
|
223
|
+
exports.ShowRoomVisitFilterDTO = ShowRoomVisitFilterDTO;
|
|
224
|
+
class ShowRoomVisitFetchDTO {
|
|
225
|
+
validate() {
|
|
226
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
227
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
228
|
+
}
|
|
229
|
+
static fromPlain(plain) {
|
|
230
|
+
return (0, class_transformer_1.plainToClass)(ShowRoomVisitFetchDTO, plain);
|
|
231
|
+
}
|
|
232
|
+
toPlain() {
|
|
233
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
exports.ShowRoomVisitFetchDTO = ShowRoomVisitFetchDTO;
|
|
192
237
|
// Optional: Create an enum for visit status if needed
|
|
193
238
|
var VisitStatus;
|
|
194
239
|
(function (VisitStatus) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TestDriveRequestFilter, TestDriveRequestSelectFields } from "../utilities";
|
|
2
|
-
import {
|
|
2
|
+
import { BaseUpdateDTO } from "../../../vehicle/data/dto/BaseDTO";
|
|
3
3
|
import { DynamicVehicleDTO } from "../../../vehicle/data/dto/VehicleDTO";
|
|
4
4
|
import { LeadThrough, TestDriveRequestStatus } from "../enums";
|
|
5
5
|
import { VehicleSelectFields } from "../../../vehicle/data/utilities";
|
|
@@ -17,7 +17,7 @@ export declare class TestDriveRequestGetDTO {
|
|
|
17
17
|
static fromPlain(plain: Record<string, unknown>): TestDriveRequestGetDTO;
|
|
18
18
|
toPlain(): Record<string, any>;
|
|
19
19
|
}
|
|
20
|
-
export declare class TestDriveRequestCreateDTO
|
|
20
|
+
export declare class TestDriveRequestCreateDTO {
|
|
21
21
|
vehicle: DynamicVehicleDTO;
|
|
22
22
|
testerName: string;
|
|
23
23
|
testerMobile: string;
|
|
@@ -27,6 +27,7 @@ export declare class TestDriveRequestCreateDTO extends BaseCreateDTO {
|
|
|
27
27
|
status?: TestDriveRequestStatus;
|
|
28
28
|
leadThrough?: LeadThrough;
|
|
29
29
|
comments?: string;
|
|
30
|
+
createdById?: string;
|
|
30
31
|
validate(): string[];
|
|
31
32
|
constructor(data?: Partial<TestDriveRequestCreateDTO>);
|
|
32
33
|
static fromPlain(plain: Record<string, unknown>): TestDriveRequestCreateDTO;
|
|
@@ -19,11 +19,10 @@ const enums_1 = require("../enums");
|
|
|
19
19
|
class TestDriveRequestGetDTOOptions {
|
|
20
20
|
}
|
|
21
21
|
exports.TestDriveRequestGetDTOOptions = TestDriveRequestGetDTOOptions;
|
|
22
|
-
;
|
|
23
22
|
class TestDriveRequestGetDTO {
|
|
24
23
|
validate() {
|
|
25
24
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
26
|
-
return errors.map(error => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
25
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
27
26
|
}
|
|
28
27
|
static fromPlain(plain) {
|
|
29
28
|
return (0, class_transformer_1.plainToClass)(TestDriveRequestGetDTO, plain);
|
|
@@ -33,13 +32,12 @@ class TestDriveRequestGetDTO {
|
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
exports.TestDriveRequestGetDTO = TestDriveRequestGetDTO;
|
|
36
|
-
class TestDriveRequestCreateDTO
|
|
35
|
+
class TestDriveRequestCreateDTO {
|
|
37
36
|
validate() {
|
|
38
37
|
const errors = (0, class_validator_1.validateSync)(this);
|
|
39
38
|
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
40
39
|
}
|
|
41
40
|
constructor(data) {
|
|
42
|
-
super();
|
|
43
41
|
Object.assign(this, data);
|
|
44
42
|
if (!this.status)
|
|
45
43
|
this.status = enums_1.TestDriveRequestStatus.NOT_CONTACTED;
|
|
@@ -109,6 +107,11 @@ __decorate([
|
|
|
109
107
|
(0, class_validator_1.IsString)(),
|
|
110
108
|
__metadata("design:type", String)
|
|
111
109
|
], TestDriveRequestCreateDTO.prototype, "comments", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, class_validator_1.IsOptional)(),
|
|
112
|
+
(0, class_validator_1.IsString)(),
|
|
113
|
+
__metadata("design:type", String)
|
|
114
|
+
], TestDriveRequestCreateDTO.prototype, "createdById", void 0);
|
|
112
115
|
exports.TestDriveRequestCreateDTO = TestDriveRequestCreateDTO;
|
|
113
116
|
class TestDriveRequestUpdateDTO extends BaseDTO_1.BaseUpdateDTO {
|
|
114
117
|
validate() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseModel } from "../../../
|
|
2
|
-
import { Vehicle } from "../../../
|
|
1
|
+
import { BaseModel } from "../../../models/Base";
|
|
2
|
+
import { Vehicle } from "../../../models/Vehicle";
|
|
3
3
|
import { LeadThrough, TestDriveRequestStatus } from "../enums";
|
|
4
4
|
export declare class TestDriveRequest extends BaseModel {
|
|
5
5
|
vehicle: Vehicle;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TestDriveRequest = void 0;
|
|
4
|
-
const Base_1 = require("../../../
|
|
4
|
+
const Base_1 = require("../../../models/Base");
|
|
5
5
|
class TestDriveRequest extends Base_1.BaseModel {
|
|
6
6
|
}
|
|
7
7
|
exports.TestDriveRequest = TestDriveRequest;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseFilter, PaginationOptions, NumberRange } from "../../../../global";
|
|
2
|
-
import { VehicleMake, VehicleModel, Vehicle, VehicleBodyType, VehicleFeature, VehicleFeatureCategory, VehicleMetaData } from "
|
|
3
|
-
import { VehicleCategory } from "
|
|
2
|
+
import { VehicleMake, VehicleModel, Vehicle, VehicleBodyType, VehicleFeature, VehicleFeatureCategory, VehicleMetaData } from "../../../models";
|
|
3
|
+
import { VehicleCategory } from "../../../models/VehicleCategory";
|
|
4
4
|
export type VehicleMakeSelectFields = keyof VehicleMake;
|
|
5
5
|
export type VehicleModelSelectFields = keyof VehicleModel;
|
|
6
6
|
export type VehicleSelectFields = keyof Vehicle;
|
|
@@ -199,7 +199,11 @@ export declare class VehicleFilter extends BaseFilter {
|
|
|
199
199
|
emissions?: string | string[];
|
|
200
200
|
year?: NumberRange;
|
|
201
201
|
price?: NumberRange;
|
|
202
|
+
emi?: NumberRange;
|
|
202
203
|
status?: string | string[];
|
|
204
|
+
includeReserved?: boolean;
|
|
205
|
+
includeSold?: boolean;
|
|
206
|
+
includeDraft?: boolean;
|
|
203
207
|
features?: string | string[];
|
|
204
208
|
search?: string;
|
|
205
209
|
validate(): string[];
|