@alba-cars/common-modules 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { User } from "../../../models";
|
|
2
2
|
export declare class RegisterDTO {
|
|
3
|
-
email
|
|
4
|
-
password
|
|
3
|
+
email?: string;
|
|
4
|
+
password?: string;
|
|
5
5
|
name?: string;
|
|
6
6
|
phone?: string;
|
|
7
7
|
savedFavoriteVehicles?: string[];
|
|
8
8
|
static fromPlain(entity: any): RegisterDTO;
|
|
9
9
|
toPlain(): Record<string, unknown>;
|
|
10
|
-
validate(): string[];
|
|
10
|
+
validate?(): string[];
|
|
11
11
|
}
|
|
12
12
|
export declare class LoginDTO {
|
|
13
13
|
email: string;
|
|
@@ -15,7 +15,14 @@ export declare class LoginDTO {
|
|
|
15
15
|
savedFavoriteVehicles?: string[];
|
|
16
16
|
static fromPlain(entity: any): LoginDTO;
|
|
17
17
|
toPlain(): Record<string, unknown>;
|
|
18
|
-
validate(): string[];
|
|
18
|
+
validate?(): string[];
|
|
19
|
+
}
|
|
20
|
+
export declare class OtpLoginDTO {
|
|
21
|
+
phone: string;
|
|
22
|
+
otp: string;
|
|
23
|
+
static fromPlain(entity: any): OtpLoginDTO;
|
|
24
|
+
toPlain(): Record<string, unknown>;
|
|
25
|
+
validate?(): string[];
|
|
19
26
|
}
|
|
20
27
|
export declare class AuthResponseDTO {
|
|
21
28
|
user: User;
|
|
@@ -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.AuthResponseDTO = exports.LoginDTO = exports.RegisterDTO = void 0;
|
|
12
|
+
exports.AuthResponseDTO = exports.OtpLoginDTO = exports.LoginDTO = exports.RegisterDTO = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
class RegisterDTO {
|
|
@@ -26,11 +26,13 @@ class RegisterDTO {
|
|
|
26
26
|
}
|
|
27
27
|
__decorate([
|
|
28
28
|
(0, class_validator_1.IsEmail)(),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
30
|
__metadata("design:type", String)
|
|
30
31
|
], RegisterDTO.prototype, "email", void 0);
|
|
31
32
|
__decorate([
|
|
32
33
|
(0, class_validator_1.IsString)(),
|
|
33
34
|
(0, class_validator_1.MinLength)(8),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
36
|
__metadata("design:type", String)
|
|
35
37
|
], RegisterDTO.prototype, "password", void 0);
|
|
36
38
|
__decorate([
|
|
@@ -39,6 +41,7 @@ __decorate([
|
|
|
39
41
|
], RegisterDTO.prototype, "name", void 0);
|
|
40
42
|
__decorate([
|
|
41
43
|
(0, class_validator_1.IsString)(),
|
|
44
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
45
|
__metadata("design:type", String)
|
|
43
46
|
], RegisterDTO.prototype, "phone", void 0);
|
|
44
47
|
__decorate([
|
|
@@ -75,6 +78,29 @@ __decorate([
|
|
|
75
78
|
__metadata("design:type", Array)
|
|
76
79
|
], LoginDTO.prototype, "savedFavoriteVehicles", void 0);
|
|
77
80
|
exports.LoginDTO = LoginDTO;
|
|
81
|
+
class OtpLoginDTO {
|
|
82
|
+
static fromPlain(entity) {
|
|
83
|
+
return (0, class_transformer_1.plainToClass)(OtpLoginDTO, entity);
|
|
84
|
+
}
|
|
85
|
+
toPlain() {
|
|
86
|
+
return (0, class_transformer_1.classToPlain)(this);
|
|
87
|
+
}
|
|
88
|
+
validate() {
|
|
89
|
+
const errors = (0, class_validator_1.validateSync)(this);
|
|
90
|
+
return errors.map((error) => { var _a; return Object.values((_a = error.constraints) !== null && _a !== void 0 ? _a : {}); }).flat();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, class_validator_1.IsString)(),
|
|
95
|
+
(0, class_validator_1.IsPhoneNumber)(),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], OtpLoginDTO.prototype, "phone", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, class_validator_1.IsString)(),
|
|
100
|
+
(0, class_validator_1.MinLength)(6),
|
|
101
|
+
__metadata("design:type", String)
|
|
102
|
+
], OtpLoginDTO.prototype, "otp", void 0);
|
|
103
|
+
exports.OtpLoginDTO = OtpLoginDTO;
|
|
78
104
|
class AuthResponseDTO {
|
|
79
105
|
}
|
|
80
106
|
exports.AuthResponseDTO = AuthResponseDTO;
|
|
@@ -3,7 +3,7 @@ export declare class CreateTicketDto {
|
|
|
3
3
|
userId: string;
|
|
4
4
|
requestType: TicketRequestType;
|
|
5
5
|
message: string;
|
|
6
|
-
assignedSalesAgentId
|
|
6
|
+
assignedSalesAgentId?: string;
|
|
7
7
|
agentName: string;
|
|
8
8
|
agentPhoneNumber: string;
|
|
9
9
|
}
|
|
@@ -20,9 +20,9 @@ export declare class TicketDto {
|
|
|
20
20
|
userId: string;
|
|
21
21
|
requestType: TicketRequestType;
|
|
22
22
|
message: string;
|
|
23
|
-
assignedSalesAgentId
|
|
24
|
-
agentName
|
|
25
|
-
agentPhoneNumber
|
|
23
|
+
assignedSalesAgentId?: string;
|
|
24
|
+
agentName?: string;
|
|
25
|
+
agentPhoneNumber?: string;
|
|
26
26
|
status: TicketStatusType;
|
|
27
27
|
createdAt: Date;
|
|
28
28
|
updatedAt: Date;
|
|
@@ -40,9 +40,9 @@ export declare class TicketGetDTO {
|
|
|
40
40
|
userId: string;
|
|
41
41
|
requestType: TicketRequestType;
|
|
42
42
|
message: string;
|
|
43
|
-
assignedSalesAgentId
|
|
43
|
+
assignedSalesAgentId?: string;
|
|
44
44
|
agentName: string;
|
|
45
|
-
agentPhoneNumber
|
|
45
|
+
agentPhoneNumber?: string;
|
|
46
46
|
status: TicketStatusType;
|
|
47
47
|
constructor();
|
|
48
48
|
}
|
|
@@ -29,6 +29,7 @@ __decorate([
|
|
|
29
29
|
], CreateTicketDto.prototype, "message", void 0);
|
|
30
30
|
__decorate([
|
|
31
31
|
(0, class_validator_1.IsUUID)(),
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
33
|
__metadata("design:type", String)
|
|
33
34
|
], CreateTicketDto.prototype, "assignedSalesAgentId", void 0);
|
|
34
35
|
__decorate([
|
|
@@ -93,14 +94,17 @@ __decorate([
|
|
|
93
94
|
], TicketDto.prototype, "message", void 0);
|
|
94
95
|
__decorate([
|
|
95
96
|
(0, class_validator_1.IsUUID)(),
|
|
97
|
+
(0, class_validator_1.IsOptional)(),
|
|
96
98
|
__metadata("design:type", String)
|
|
97
99
|
], TicketDto.prototype, "assignedSalesAgentId", void 0);
|
|
98
100
|
__decorate([
|
|
99
101
|
(0, class_validator_1.IsString)(),
|
|
102
|
+
(0, class_validator_1.IsOptional)(),
|
|
100
103
|
__metadata("design:type", String)
|
|
101
104
|
], TicketDto.prototype, "agentName", void 0);
|
|
102
105
|
__decorate([
|
|
103
106
|
(0, class_validator_1.IsString)(),
|
|
107
|
+
(0, class_validator_1.IsOptional)(),
|
|
104
108
|
__metadata("design:type", String)
|
|
105
109
|
], TicketDto.prototype, "agentPhoneNumber", void 0);
|
|
106
110
|
__decorate([
|
|
@@ -132,7 +136,7 @@ class TicketGetDTO {
|
|
|
132
136
|
this.userId = '';
|
|
133
137
|
this.requestType = enums_1.TicketRequestType.CAR_VIEWING;
|
|
134
138
|
this.message = '';
|
|
135
|
-
this.assignedSalesAgentId
|
|
139
|
+
this.assignedSalesAgentId;
|
|
136
140
|
this.agentName = '';
|
|
137
141
|
this.agentPhoneNumber = '';
|
|
138
142
|
this.status = enums_1.TicketStatusType.OPEN;
|
|
@@ -191,6 +195,7 @@ __decorate([
|
|
|
191
195
|
], TicketGetDTO.prototype, "message", void 0);
|
|
192
196
|
__decorate([
|
|
193
197
|
(0, class_validator_1.IsUUID)(),
|
|
198
|
+
(0, class_validator_1.IsOptional)(),
|
|
194
199
|
__metadata("design:type", String)
|
|
195
200
|
], TicketGetDTO.prototype, "assignedSalesAgentId", void 0);
|
|
196
201
|
__decorate([
|
|
@@ -199,6 +204,7 @@ __decorate([
|
|
|
199
204
|
], TicketGetDTO.prototype, "agentName", void 0);
|
|
200
205
|
__decorate([
|
|
201
206
|
(0, class_validator_1.IsString)(),
|
|
207
|
+
(0, class_validator_1.IsOptional)(),
|
|
202
208
|
__metadata("design:type", String)
|
|
203
209
|
], TicketGetDTO.prototype, "agentPhoneNumber", void 0);
|
|
204
210
|
__decorate([
|
package/package.json
CHANGED