resurgence-data 1.1.43 → 1.1.45

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/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from "./payment";
8
8
  export * from "./invoice";
9
9
  export * from "./integration";
10
10
  export * from "./functions";
11
+ export * from "./support";
package/dist/index.js CHANGED
@@ -24,3 +24,4 @@ __exportStar(require("./payment"), exports);
24
24
  __exportStar(require("./invoice"), exports);
25
25
  __exportStar(require("./integration"), exports);
26
26
  __exportStar(require("./functions"), exports);
27
+ __exportStar(require("./support"), exports);
@@ -0,0 +1 @@
1
+ export * from "./ticket.dto";
@@ -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("./ticket.dto"), exports);
@@ -0,0 +1,55 @@
1
+ import { BaseDTO } from "../types/dto.type";
2
+ declare enum TICKET_TYPE {
3
+ COMPLAINT = 0,
4
+ ENQUIRY = 1
5
+ }
6
+ declare enum TICKET_STATUS {
7
+ PENDING = 0,
8
+ ASSIGNED = 1,
9
+ IN_PROGRESS = 2,
10
+ RESOLVED = 3
11
+ }
12
+ declare enum PRIORITY {
13
+ LOW = 0,
14
+ NORMAL = 1,
15
+ HIGH = 2,
16
+ URGENT = 3
17
+ }
18
+ export declare class CreateTicketDTO extends BaseDTO {
19
+ billerId?: string;
20
+ userId?: string;
21
+ ticketType: TICKET_TYPE;
22
+ transaction: string;
23
+ subject: string;
24
+ body: string;
25
+ }
26
+ export declare class TicketStatusDTO extends BaseDTO {
27
+ status: TICKET_STATUS;
28
+ ticketId: string;
29
+ }
30
+ export declare class AttachmentDTO extends BaseDTO {
31
+ fileUrl: string;
32
+ ticketId?: string;
33
+ responseId?: string;
34
+ }
35
+ export declare class ResponseDTO extends BaseDTO {
36
+ userId: string;
37
+ response: string;
38
+ ticketId: string;
39
+ attachments?: AttachmentDTO[];
40
+ }
41
+ export declare class NoteDTO extends BaseDTO {
42
+ ticketId: string;
43
+ note: string;
44
+ }
45
+ export declare class EscalationDTO extends BaseDTO {
46
+ priority: PRIORITY;
47
+ ticketId: string;
48
+ userId?: string;
49
+ }
50
+ export declare class AssignmentDTO extends BaseDTO {
51
+ ticketId: string;
52
+ userId: string;
53
+ assigner: string;
54
+ }
55
+ export {};
@@ -0,0 +1,180 @@
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.AssignmentDTO = exports.EscalationDTO = exports.NoteDTO = exports.ResponseDTO = exports.AttachmentDTO = exports.TicketStatusDTO = exports.CreateTicketDTO = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const dto_type_1 = require("../types/dto.type");
16
+ var TICKET_TYPE;
17
+ (function (TICKET_TYPE) {
18
+ TICKET_TYPE[TICKET_TYPE["COMPLAINT"] = 0] = "COMPLAINT";
19
+ TICKET_TYPE[TICKET_TYPE["ENQUIRY"] = 1] = "ENQUIRY";
20
+ })(TICKET_TYPE || (TICKET_TYPE = {}));
21
+ var TICKET_STATUS;
22
+ (function (TICKET_STATUS) {
23
+ TICKET_STATUS[TICKET_STATUS["PENDING"] = 0] = "PENDING";
24
+ TICKET_STATUS[TICKET_STATUS["ASSIGNED"] = 1] = "ASSIGNED";
25
+ TICKET_STATUS[TICKET_STATUS["IN_PROGRESS"] = 2] = "IN_PROGRESS";
26
+ TICKET_STATUS[TICKET_STATUS["RESOLVED"] = 3] = "RESOLVED";
27
+ })(TICKET_STATUS || (TICKET_STATUS = {}));
28
+ var PRIORITY;
29
+ (function (PRIORITY) {
30
+ PRIORITY[PRIORITY["LOW"] = 0] = "LOW";
31
+ PRIORITY[PRIORITY["NORMAL"] = 1] = "NORMAL";
32
+ PRIORITY[PRIORITY["HIGH"] = 2] = "HIGH";
33
+ PRIORITY[PRIORITY["URGENT"] = 3] = "URGENT";
34
+ })(PRIORITY || (PRIORITY = {}));
35
+ class CreateTicketDTO extends dto_type_1.BaseDTO {
36
+ }
37
+ exports.CreateTicketDTO = CreateTicketDTO;
38
+ __decorate([
39
+ (0, swagger_1.ApiProperty)({ description: "ID of the biller", required: false }),
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.IsUUID)(),
42
+ __metadata("design:type", String)
43
+ ], CreateTicketDTO.prototype, "billerId", void 0);
44
+ __decorate([
45
+ (0, swagger_1.ApiProperty)({ description: "ID of the user", required: false }),
46
+ (0, class_validator_1.IsOptional)(),
47
+ (0, class_validator_1.IsUUID)(),
48
+ __metadata("design:type", String)
49
+ ], CreateTicketDTO.prototype, "userId", void 0);
50
+ __decorate([
51
+ (0, swagger_1.ApiProperty)({ description: "Type of the ticket", enum: TICKET_TYPE, default: TICKET_TYPE.ENQUIRY }),
52
+ (0, class_validator_1.IsEnum)(TICKET_TYPE),
53
+ __metadata("design:type", Number)
54
+ ], CreateTicketDTO.prototype, "ticketType", void 0);
55
+ __decorate([
56
+ (0, swagger_1.ApiProperty)({ description: "Transaction details", maxLength: 100 }),
57
+ (0, class_validator_1.IsString)(),
58
+ (0, class_validator_1.Length)(0, 100),
59
+ __metadata("design:type", String)
60
+ ], CreateTicketDTO.prototype, "transaction", void 0);
61
+ __decorate([
62
+ (0, swagger_1.ApiProperty)({ description: "Subject of the ticket" }),
63
+ (0, class_validator_1.IsString)(),
64
+ __metadata("design:type", String)
65
+ ], CreateTicketDTO.prototype, "subject", void 0);
66
+ __decorate([
67
+ (0, swagger_1.ApiProperty)({ description: "Body of the ticket" }),
68
+ (0, class_validator_1.IsString)(),
69
+ __metadata("design:type", String)
70
+ ], CreateTicketDTO.prototype, "body", void 0);
71
+ class TicketStatusDTO extends dto_type_1.BaseDTO {
72
+ }
73
+ exports.TicketStatusDTO = TicketStatusDTO;
74
+ __decorate([
75
+ (0, swagger_1.ApiProperty)({ description: "Status of the ticket", enum: TICKET_STATUS, default: TICKET_STATUS.PENDING }),
76
+ (0, class_validator_1.IsEnum)(TICKET_STATUS, { message: "Invalid status value" }),
77
+ __metadata("design:type", Number)
78
+ ], TicketStatusDTO.prototype, "status", void 0);
79
+ __decorate([
80
+ (0, swagger_1.ApiProperty)({ description: "ID of the ticket", required: true }),
81
+ (0, class_validator_1.IsUUID)(4, { message: "Invalid UUID format for ticket ID" }),
82
+ __metadata("design:type", String)
83
+ ], TicketStatusDTO.prototype, "ticketId", void 0);
84
+ class AttachmentDTO extends dto_type_1.BaseDTO {
85
+ }
86
+ exports.AttachmentDTO = AttachmentDTO;
87
+ __decorate([
88
+ (0, swagger_1.ApiProperty)({ description: "URL of the file", required: true }),
89
+ (0, class_validator_1.IsString)(),
90
+ __metadata("design:type", String)
91
+ ], AttachmentDTO.prototype, "fileUrl", void 0);
92
+ __decorate([
93
+ (0, swagger_1.ApiProperty)({ description: "ID of the ticket", required: false }),
94
+ (0, class_validator_1.IsOptional)(),
95
+ (0, class_validator_1.IsUUID)(),
96
+ __metadata("design:type", String)
97
+ ], AttachmentDTO.prototype, "ticketId", void 0);
98
+ __decorate([
99
+ (0, swagger_1.ApiProperty)({ description: "ID of the response", required: false }),
100
+ (0, class_validator_1.IsOptional)(),
101
+ (0, class_validator_1.IsUUID)(),
102
+ __metadata("design:type", String)
103
+ ], AttachmentDTO.prototype, "responseId", void 0);
104
+ class ResponseDTO extends dto_type_1.BaseDTO {
105
+ }
106
+ exports.ResponseDTO = ResponseDTO;
107
+ __decorate([
108
+ (0, swagger_1.ApiProperty)({ description: "ID of the user", required: true }),
109
+ (0, class_validator_1.IsUUID)(),
110
+ __metadata("design:type", String)
111
+ ], ResponseDTO.prototype, "userId", void 0);
112
+ __decorate([
113
+ (0, swagger_1.ApiProperty)({ description: "Response text" }),
114
+ (0, class_validator_1.IsString)(),
115
+ __metadata("design:type", String)
116
+ ], ResponseDTO.prototype, "response", void 0);
117
+ __decorate([
118
+ (0, swagger_1.ApiProperty)({ description: "ID of the ticket", required: true }),
119
+ (0, class_validator_1.IsUUID)(),
120
+ __metadata("design:type", String)
121
+ ], ResponseDTO.prototype, "ticketId", void 0);
122
+ __decorate([
123
+ (0, swagger_1.ApiProperty)({ description: "Attachments related to the response", type: [String], required: false }),
124
+ (0, class_validator_1.IsOptional)(),
125
+ __metadata("design:type", Array)
126
+ ], ResponseDTO.prototype, "attachments", void 0);
127
+ class NoteDTO extends dto_type_1.BaseDTO {
128
+ }
129
+ exports.NoteDTO = NoteDTO;
130
+ __decorate([
131
+ (0, swagger_1.ApiProperty)({ description: "ID of the ticket", required: true }),
132
+ (0, class_validator_1.IsUUID)(4, { message: "Invalid UUID format for ticket ID" }),
133
+ __metadata("design:type", String)
134
+ ], NoteDTO.prototype, "ticketId", void 0);
135
+ __decorate([
136
+ (0, swagger_1.ApiProperty)({ description: "Content of the note" }),
137
+ (0, class_validator_1.IsString)({ message: "Note must be a string" }),
138
+ __metadata("design:type", String)
139
+ ], NoteDTO.prototype, "note", void 0);
140
+ class EscalationDTO extends dto_type_1.BaseDTO {
141
+ }
142
+ exports.EscalationDTO = EscalationDTO;
143
+ __decorate([
144
+ (0, swagger_1.ApiProperty)({ description: "Priority of the escalation", enum: PRIORITY, default: PRIORITY.NORMAL }),
145
+ (0, class_validator_1.IsEnum)(PRIORITY, { message: "Invalid priority value" }),
146
+ __metadata("design:type", Number)
147
+ ], EscalationDTO.prototype, "priority", void 0);
148
+ __decorate([
149
+ (0, swagger_1.ApiProperty)({ description: "ID of the ticket", required: true }),
150
+ (0, class_validator_1.IsUUID)(4, { message: "Invalid UUID format for ticket ID" }),
151
+ (0, class_validator_1.IsNotEmpty)({ message: "Ticket ID should not be empty" }),
152
+ __metadata("design:type", String)
153
+ ], EscalationDTO.prototype, "ticketId", void 0);
154
+ __decorate([
155
+ (0, swagger_1.ApiProperty)({ description: "ID of the user", required: false }),
156
+ (0, class_validator_1.IsOptional)(),
157
+ (0, class_validator_1.IsUUID)(4, { message: "Invalid UUID format for user ID" }),
158
+ __metadata("design:type", String)
159
+ ], EscalationDTO.prototype, "userId", void 0);
160
+ class AssignmentDTO extends dto_type_1.BaseDTO {
161
+ }
162
+ exports.AssignmentDTO = AssignmentDTO;
163
+ __decorate([
164
+ (0, swagger_1.ApiProperty)({ description: "ID of the ticket", required: true }),
165
+ (0, class_validator_1.IsUUID)(4, { message: "Invalid UUID format for ticket ID" }),
166
+ (0, class_validator_1.IsNotEmpty)({ message: "Ticket ID should not be empty" }),
167
+ __metadata("design:type", String)
168
+ ], AssignmentDTO.prototype, "ticketId", void 0);
169
+ __decorate([
170
+ (0, swagger_1.ApiProperty)({ description: "ID of the user", required: true }),
171
+ (0, class_validator_1.IsUUID)(4, { message: "Invalid UUID format for user ID" }),
172
+ (0, class_validator_1.IsNotEmpty)({ message: "User ID should not be empty" }),
173
+ __metadata("design:type", String)
174
+ ], AssignmentDTO.prototype, "userId", void 0);
175
+ __decorate([
176
+ (0, swagger_1.ApiProperty)({ description: "ID of the assigner", required: true }),
177
+ (0, class_validator_1.IsUUID)(4, { message: "Invalid UUID format for assigner ID" }),
178
+ (0, class_validator_1.IsNotEmpty)({ message: "Assigner ID should not be empty" }),
179
+ __metadata("design:type", String)
180
+ ], AssignmentDTO.prototype, "assigner", void 0);
@@ -17,6 +17,12 @@ export declare class CreateSupportUserDTO {
17
17
  avatarUrl?: string;
18
18
  role: string;
19
19
  }
20
- export declare class UpdateUserDTO extends CreateUserDTO {
20
+ export declare class UpdateUserDTO {
21
21
  id: string;
22
+ firstName?: string;
23
+ lastName?: string;
24
+ phoneNumber?: string;
25
+ avatarUrl?: string;
26
+ corporate?: boolean;
27
+ role?: string;
22
28
  }
package/dist/user/user.js CHANGED
@@ -112,10 +112,50 @@ __decorate([
112
112
  (0, swagger_1.ApiProperty)({ description: "users role", enumName: "ROLE", enum: ROLE }),
113
113
  __metadata("design:type", String)
114
114
  ], CreateSupportUserDTO.prototype, "role", void 0);
115
- class UpdateUserDTO extends CreateUserDTO {
115
+ class UpdateUserDTO {
116
116
  }
117
117
  exports.UpdateUserDTO = UpdateUserDTO;
118
118
  __decorate([
119
119
  (0, class_validator_1.IsUUID)(4, { message: "Please enter a valid user id format" }),
120
120
  __metadata("design:type", String)
121
121
  ], UpdateUserDTO.prototype, "id", void 0);
122
+ __decorate([
123
+ (0, class_validator_1.IsString)({ message: "First name is required. Please provide it." }),
124
+ (0, swagger_1.ApiProperty)({ description: "User's first name", required: false }),
125
+ (0, class_validator_1.IsOptional)(),
126
+ __metadata("design:type", String)
127
+ ], UpdateUserDTO.prototype, "firstName", void 0);
128
+ __decorate([
129
+ (0, class_validator_1.IsString)({ message: "Last name is required. Please provide it." }),
130
+ (0, swagger_1.ApiProperty)({ description: "User's last name", required: false }),
131
+ (0, class_validator_1.IsOptional)(),
132
+ __metadata("design:type", String)
133
+ ], UpdateUserDTO.prototype, "lastName", void 0);
134
+ __decorate([
135
+ (0, class_validator_1.IsString)({ message: "Phone number is required. Please enter it." }),
136
+ (0, swagger_1.ApiProperty)({ description: "User's phone number", required: false }),
137
+ (0, class_validator_1.IsOptional)(),
138
+ __metadata("design:type", String)
139
+ ], UpdateUserDTO.prototype, "phoneNumber", void 0);
140
+ __decorate([
141
+ (0, class_validator_1.IsOptional)() // Allows the property to be optional
142
+ ,
143
+ (0, class_validator_1.IsString)({ message: "Please provide a valid link for the avatar (optional)." }),
144
+ (0, swagger_1.ApiProperty)({ description: "User's profile link", required: false }),
145
+ (0, class_validator_1.IsOptional)(),
146
+ __metadata("design:type", String)
147
+ ], UpdateUserDTO.prototype, "avatarUrl", void 0);
148
+ __decorate([
149
+ (0, class_validator_1.IsOptional)(),
150
+ (0, class_validator_1.IsBoolean)({ message: "Corporate should be true or false (optional)." }),
151
+ (0, swagger_1.ApiProperty)({ description: "Corporate or private user", required: false }),
152
+ (0, class_validator_1.IsOptional)(),
153
+ __metadata("design:type", Boolean)
154
+ ], UpdateUserDTO.prototype, "corporate", void 0);
155
+ __decorate([
156
+ (0, class_validator_1.IsString)({ message: "Account type is required. Please specify it." }),
157
+ (0, class_validator_1.IsIn)(account_type_1.accountTypes, { message: "Please select a valid account type" }),
158
+ (0, swagger_1.ApiProperty)({ description: "users role", enumName: "ROLE", enum: ROLE, required: false }),
159
+ (0, class_validator_1.IsOptional)(),
160
+ __metadata("design:type", String)
161
+ ], UpdateUserDTO.prototype, "role", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.43",
3
+ "version": "1.1.45",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -8,3 +8,4 @@ export * from "./payment";
8
8
  export * from "./invoice";
9
9
  export * from "./integration";
10
10
  export * from "./functions";
11
+ export * from "./support";
@@ -0,0 +1 @@
1
+ export * from "./ticket.dto";
@@ -0,0 +1,138 @@
1
+ import { ApiProperty } from "@nestjs/swagger";
2
+ import { IsOptional, IsUUID, IsString, IsEnum, Length, IsNotEmpty } from "class-validator";
3
+ import { BaseDTO } from "../types/dto.type";
4
+
5
+ enum TICKET_TYPE {
6
+ COMPLAINT,
7
+ ENQUIRY,
8
+ }
9
+
10
+ enum TICKET_STATUS {
11
+ PENDING,
12
+ ASSIGNED,
13
+ IN_PROGRESS,
14
+ RESOLVED,
15
+ }
16
+
17
+ enum PRIORITY {
18
+ LOW,
19
+ NORMAL,
20
+ HIGH,
21
+ URGENT,
22
+ }
23
+
24
+ export class CreateTicketDTO extends BaseDTO {
25
+ @ApiProperty({ description: "ID of the biller", required: false })
26
+ @IsOptional()
27
+ @IsUUID()
28
+ billerId?: string;
29
+
30
+ @ApiProperty({ description: "ID of the user", required: false })
31
+ @IsOptional()
32
+ @IsUUID()
33
+ userId?: string;
34
+
35
+ @ApiProperty({ description: "Type of the ticket", enum: TICKET_TYPE, default: TICKET_TYPE.ENQUIRY })
36
+ @IsEnum(TICKET_TYPE)
37
+ ticketType: TICKET_TYPE;
38
+
39
+ @ApiProperty({ description: "Transaction details", maxLength: 100 })
40
+ @IsString()
41
+ @Length(0, 100)
42
+ transaction: string;
43
+
44
+ @ApiProperty({ description: "Subject of the ticket" })
45
+ @IsString()
46
+ subject: string;
47
+
48
+ @ApiProperty({ description: "Body of the ticket" })
49
+ @IsString()
50
+ body: string;
51
+ }
52
+
53
+ export class TicketStatusDTO extends BaseDTO {
54
+ @ApiProperty({ description: "Status of the ticket", enum: TICKET_STATUS, default: TICKET_STATUS.PENDING })
55
+ @IsEnum(TICKET_STATUS, { message: "Invalid status value" })
56
+ status: TICKET_STATUS;
57
+
58
+ @ApiProperty({ description: "ID of the ticket", required: true })
59
+ @IsUUID(4, { message: "Invalid UUID format for ticket ID" })
60
+ ticketId: string;
61
+ }
62
+
63
+ export class AttachmentDTO extends BaseDTO {
64
+ @ApiProperty({ description: "URL of the file", required: true })
65
+ @IsString()
66
+ fileUrl: string;
67
+
68
+ @ApiProperty({ description: "ID of the ticket", required: false })
69
+ @IsOptional()
70
+ @IsUUID()
71
+ ticketId?: string;
72
+
73
+ @ApiProperty({ description: "ID of the response", required: false })
74
+ @IsOptional()
75
+ @IsUUID()
76
+ responseId?: string;
77
+ }
78
+
79
+ export class ResponseDTO extends BaseDTO {
80
+ @ApiProperty({ description: "ID of the user", required: true })
81
+ @IsUUID()
82
+ userId: string;
83
+
84
+ @ApiProperty({ description: "Response text" })
85
+ @IsString()
86
+ response: string;
87
+
88
+ @ApiProperty({ description: "ID of the ticket", required: true })
89
+ @IsUUID()
90
+ ticketId: string;
91
+
92
+ @ApiProperty({ description: "Attachments related to the response", type: [String], required: false })
93
+ @IsOptional()
94
+ attachments?: AttachmentDTO[];
95
+ }
96
+
97
+ export class NoteDTO extends BaseDTO {
98
+ @ApiProperty({ description: "ID of the ticket", required: true })
99
+ @IsUUID(4, { message: "Invalid UUID format for ticket ID" })
100
+ ticketId: string;
101
+
102
+ @ApiProperty({ description: "Content of the note" })
103
+ @IsString({ message: "Note must be a string" })
104
+ note: string;
105
+ }
106
+
107
+ export class EscalationDTO extends BaseDTO {
108
+ @ApiProperty({ description: "Priority of the escalation", enum: PRIORITY, default: PRIORITY.NORMAL })
109
+ @IsEnum(PRIORITY, { message: "Invalid priority value" })
110
+ priority: PRIORITY;
111
+
112
+ @ApiProperty({ description: "ID of the ticket", required: true })
113
+ @IsUUID(4, { message: "Invalid UUID format for ticket ID" })
114
+ @IsNotEmpty({ message: "Ticket ID should not be empty" })
115
+ ticketId: string;
116
+
117
+ @ApiProperty({ description: "ID of the user", required: false })
118
+ @IsOptional()
119
+ @IsUUID(4, { message: "Invalid UUID format for user ID" })
120
+ userId?: string;
121
+ }
122
+
123
+ export class AssignmentDTO extends BaseDTO {
124
+ @ApiProperty({ description: "ID of the ticket", required: true })
125
+ @IsUUID(4, { message: "Invalid UUID format for ticket ID" })
126
+ @IsNotEmpty({ message: "Ticket ID should not be empty" })
127
+ ticketId: string;
128
+
129
+ @ApiProperty({ description: "ID of the user", required: true })
130
+ @IsUUID(4, { message: "Invalid UUID format for user ID" })
131
+ @IsNotEmpty({ message: "User ID should not be empty" })
132
+ userId: string;
133
+
134
+ @ApiProperty({ description: "ID of the assigner", required: true })
135
+ @IsUUID(4, { message: "Invalid UUID format for assigner ID" })
136
+ @IsNotEmpty({ message: "Assigner ID should not be empty" })
137
+ assigner: string;
138
+ }
package/src/user/user.ts CHANGED
@@ -81,7 +81,40 @@ export class CreateSupportUserDTO {
81
81
  role: string;
82
82
  }
83
83
 
84
- export class UpdateUserDTO extends CreateUserDTO {
84
+ export class UpdateUserDTO {
85
85
  @IsUUID(4, { message: "Please enter a valid user id format" })
86
86
  id: string;
87
+
88
+ @IsString({ message: "First name is required. Please provide it." })
89
+ @ApiProperty({ description: "User's first name", required: false })
90
+ @IsOptional()
91
+ firstName?: string;
92
+
93
+ @IsString({ message: "Last name is required. Please provide it." })
94
+ @ApiProperty({ description: "User's last name", required: false })
95
+ @IsOptional()
96
+ lastName?: string;
97
+
98
+ @IsString({ message: "Phone number is required. Please enter it." })
99
+ @ApiProperty({ description: "User's phone number", required: false })
100
+ @IsOptional()
101
+ phoneNumber?: string;
102
+
103
+ @IsOptional() // Allows the property to be optional
104
+ @IsString({ message: "Please provide a valid link for the avatar (optional)." })
105
+ @ApiProperty({ description: "User's profile link", required: false })
106
+ @IsOptional()
107
+ avatarUrl?: string;
108
+
109
+ @IsOptional()
110
+ @IsBoolean({ message: "Corporate should be true or false (optional)." })
111
+ @ApiProperty({ description: "Corporate or private user", required: false })
112
+ @IsOptional()
113
+ corporate?: boolean;
114
+
115
+ @IsString({ message: "Account type is required. Please specify it." })
116
+ @IsIn(accountTypes, { message: "Please select a valid account type" })
117
+ @ApiProperty({ description: "users role", enumName: "ROLE", enum: ROLE, required: false })
118
+ @IsOptional()
119
+ role?: string;
87
120
  }