@flusys/nestjs-task-manager 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +245 -0
- package/cjs/config/index.js +19 -0
- package/cjs/config/message-keys.js +92 -0
- package/cjs/config/task-manager.constants.js +11 -0
- package/cjs/controllers/index.js +22 -0
- package/cjs/controllers/task-board.controller.js +219 -0
- package/cjs/controllers/task-comment.controller.js +103 -0
- package/cjs/controllers/task-label.controller.js +112 -0
- package/cjs/controllers/task-list.controller.js +158 -0
- package/cjs/controllers/task.controller.js +199 -0
- package/cjs/docs/index.js +18 -0
- package/cjs/docs/task-manager-swagger.config.js +43 -0
- package/cjs/dtos/index.js +22 -0
- package/cjs/dtos/task-board.dto.js +310 -0
- package/cjs/dtos/task-comment.dto.js +131 -0
- package/cjs/dtos/task-label.dto.js +120 -0
- package/cjs/dtos/task-list.dto.js +198 -0
- package/cjs/dtos/task.dto.js +367 -0
- package/cjs/entities/index.js +72 -0
- package/cjs/entities/task-activity.entity.js +98 -0
- package/cjs/entities/task-assignee.entity.js +67 -0
- package/cjs/entities/task-board-member.entity.js +94 -0
- package/cjs/entities/task-board-with-company.entity.js +57 -0
- package/cjs/entities/task-board.entity.js +88 -0
- package/cjs/entities/task-comment.entity.js +80 -0
- package/cjs/entities/task-label.entity.js +72 -0
- package/cjs/entities/task-list.entity.js +104 -0
- package/cjs/entities/task-task-label.entity.js +67 -0
- package/cjs/entities/task.entity.js +151 -0
- package/cjs/gateways/index.js +18 -0
- package/cjs/gateways/task-board.gateway.js +199 -0
- package/cjs/index.js +26 -0
- package/cjs/interfaces/index.js +19 -0
- package/cjs/interfaces/task-manager-module.interface.js +4 -0
- package/cjs/interfaces/task.interface.js +4 -0
- package/cjs/modules/index.js +18 -0
- package/cjs/modules/task-manager.module.js +131 -0
- package/cjs/services/index.js +25 -0
- package/cjs/services/task-activity.service.js +76 -0
- package/cjs/services/task-board.service.js +235 -0
- package/cjs/services/task-comment.service.js +103 -0
- package/cjs/services/task-label.service.js +97 -0
- package/cjs/services/task-list.service.js +115 -0
- package/cjs/services/task-manager-config.service.js +69 -0
- package/cjs/services/task-manager-datasource.provider.js +84 -0
- package/cjs/services/task.service.js +359 -0
- package/config/index.d.ts +2 -0
- package/config/message-keys.d.ts +65 -0
- package/config/task-manager.constants.d.ts +1 -0
- package/controllers/index.d.ts +5 -0
- package/controllers/task-board.controller.d.ts +27 -0
- package/controllers/task-comment.controller.d.ts +22 -0
- package/controllers/task-label.controller.d.ts +22 -0
- package/controllers/task-list.controller.d.ts +26 -0
- package/controllers/task.controller.d.ts +28 -0
- package/docs/index.d.ts +1 -0
- package/docs/task-manager-swagger.config.d.ts +2 -0
- package/dtos/index.d.ts +5 -0
- package/dtos/task-board.dto.d.ts +44 -0
- package/dtos/task-comment.dto.d.ts +16 -0
- package/dtos/task-label.dto.d.ts +16 -0
- package/dtos/task-list.dto.d.ts +26 -0
- package/dtos/task.dto.d.ts +48 -0
- package/entities/index.d.ts +22 -0
- package/entities/task-activity.entity.d.ts +9 -0
- package/entities/task-assignee.entity.d.ts +5 -0
- package/entities/task-board-member.entity.d.ts +12 -0
- package/entities/task-board-with-company.entity.d.ts +4 -0
- package/entities/task-board.entity.d.ts +8 -0
- package/entities/task-comment.entity.d.ts +7 -0
- package/entities/task-label.entity.d.ts +6 -0
- package/entities/task-list.entity.d.ts +9 -0
- package/entities/task-task-label.entity.d.ts +5 -0
- package/entities/task.entity.d.ts +23 -0
- package/fesm/config/index.js +2 -0
- package/fesm/config/message-keys.js +65 -0
- package/fesm/config/task-manager.constants.js +1 -0
- package/fesm/controllers/index.js +5 -0
- package/fesm/controllers/task-board.controller.js +209 -0
- package/fesm/controllers/task-comment.controller.js +93 -0
- package/fesm/controllers/task-label.controller.js +102 -0
- package/fesm/controllers/task-list.controller.js +148 -0
- package/fesm/controllers/task.controller.js +189 -0
- package/fesm/docs/index.js +1 -0
- package/fesm/docs/task-manager-swagger.config.js +33 -0
- package/fesm/dtos/index.js +5 -0
- package/fesm/dtos/task-board.dto.js +277 -0
- package/fesm/dtos/task-comment.dto.js +110 -0
- package/fesm/dtos/task-label.dto.js +99 -0
- package/fesm/dtos/task-list.dto.js +174 -0
- package/fesm/dtos/task.dto.js +337 -0
- package/fesm/entities/index.js +46 -0
- package/fesm/entities/task-activity.entity.js +88 -0
- package/fesm/entities/task-assignee.entity.js +57 -0
- package/fesm/entities/task-board-member.entity.js +76 -0
- package/fesm/entities/task-board-with-company.entity.js +47 -0
- package/fesm/entities/task-board.entity.js +78 -0
- package/fesm/entities/task-comment.entity.js +70 -0
- package/fesm/entities/task-label.entity.js +62 -0
- package/fesm/entities/task-list.entity.js +94 -0
- package/fesm/entities/task-task-label.entity.js +57 -0
- package/fesm/entities/task.entity.js +133 -0
- package/fesm/gateways/index.js +1 -0
- package/fesm/gateways/task-board.gateway.js +148 -0
- package/fesm/index.js +9 -0
- package/fesm/interfaces/index.js +2 -0
- package/fesm/interfaces/task-manager-module.interface.js +1 -0
- package/fesm/interfaces/task.interface.js +1 -0
- package/fesm/modules/index.js +1 -0
- package/fesm/modules/task-manager.module.js +121 -0
- package/fesm/services/index.js +8 -0
- package/fesm/services/task-activity.service.js +66 -0
- package/fesm/services/task-board.service.js +225 -0
- package/fesm/services/task-comment.service.js +93 -0
- package/fesm/services/task-label.service.js +87 -0
- package/fesm/services/task-list.service.js +105 -0
- package/fesm/services/task-manager-config.service.js +59 -0
- package/fesm/services/task-manager-datasource.provider.js +74 -0
- package/fesm/services/task.service.js +349 -0
- package/gateways/index.d.ts +1 -0
- package/gateways/task-board.gateway.d.ts +22 -0
- package/index.d.ts +9 -0
- package/interfaces/index.d.ts +2 -0
- package/interfaces/task-manager-module.interface.d.ts +19 -0
- package/interfaces/task.interface.d.ts +52 -0
- package/modules/index.d.ts +1 -0
- package/modules/task-manager.module.d.ts +8 -0
- package/package.json +91 -0
- package/services/index.d.ts +8 -0
- package/services/task-activity.service.d.ts +8 -0
- package/services/task-board.service.d.ts +32 -0
- package/services/task-comment.service.d.ts +18 -0
- package/services/task-label.service.d.ts +18 -0
- package/services/task-list.service.d.ts +19 -0
- package/services/task-manager-config.service.d.ts +12 -0
- package/services/task-manager-datasource.provider.d.ts +18 -0
- package/services/task.service.d.ts +44 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
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;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
}
|
|
20
|
+
function _ts_metadata(k, v) {
|
|
21
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
22
|
+
}
|
|
23
|
+
function _ts_param(paramIndex, decorator) {
|
|
24
|
+
return function(target, key) {
|
|
25
|
+
decorator(target, key, paramIndex);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
import { createApiController } from '@flusys/nestjs-shared/classes';
|
|
29
|
+
import { ApiResponseDto, CurrentUser, RequirePermission } from '@flusys/nestjs-shared/decorators';
|
|
30
|
+
import { JwtAuthGuard, PermissionGuard } from '@flusys/nestjs-shared/guards';
|
|
31
|
+
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
32
|
+
import { Body, Controller, HttpCode, HttpStatus, Inject, Optional, Post, UseGuards } from '@nestjs/common';
|
|
33
|
+
import { ApiBearerAuth, ApiBody, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
34
|
+
import { plainToInstance } from 'class-transformer';
|
|
35
|
+
import { TASK_PERMISSIONS } from '@flusys/nestjs-shared';
|
|
36
|
+
import { TASK_MESSAGES } from '../config';
|
|
37
|
+
import { AssignTaskDto, CreateTaskDto, MoveTaskDto, TaskResponseDto, UpdateTaskDto } from '../dtos';
|
|
38
|
+
import { TaskBoardGateway } from '../gateways/task-board.gateway';
|
|
39
|
+
import { TaskService } from '../services/task.service';
|
|
40
|
+
export class TaskController extends createApiController(CreateTaskDto, UpdateTaskDto, TaskResponseDto, {
|
|
41
|
+
entityName: 'task',
|
|
42
|
+
enabledEndpoints: [
|
|
43
|
+
'insert',
|
|
44
|
+
'insertMany',
|
|
45
|
+
'getById',
|
|
46
|
+
'getAll',
|
|
47
|
+
'update',
|
|
48
|
+
'updateMany',
|
|
49
|
+
'delete'
|
|
50
|
+
],
|
|
51
|
+
security: {
|
|
52
|
+
insert: {
|
|
53
|
+
level: 'permission',
|
|
54
|
+
permissions: [
|
|
55
|
+
TASK_PERMISSIONS.CREATE
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
insertMany: {
|
|
59
|
+
level: 'permission',
|
|
60
|
+
permissions: [
|
|
61
|
+
TASK_PERMISSIONS.CREATE
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
getById: {
|
|
65
|
+
level: 'permission',
|
|
66
|
+
permissions: [
|
|
67
|
+
TASK_PERMISSIONS.READ
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
getAll: {
|
|
71
|
+
level: 'permission',
|
|
72
|
+
permissions: [
|
|
73
|
+
TASK_PERMISSIONS.READ
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
update: {
|
|
77
|
+
level: 'permission',
|
|
78
|
+
permissions: [
|
|
79
|
+
TASK_PERMISSIONS.UPDATE
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
updateMany: {
|
|
83
|
+
level: 'permission',
|
|
84
|
+
permissions: [
|
|
85
|
+
TASK_PERMISSIONS.UPDATE
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
delete: {
|
|
89
|
+
level: 'permission',
|
|
90
|
+
permissions: [
|
|
91
|
+
TASK_PERMISSIONS.DELETE
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}) {
|
|
96
|
+
async moveTask(dto, user) {
|
|
97
|
+
const task = await this.taskService.moveTask(dto, user);
|
|
98
|
+
const data = plainToInstance(TaskResponseDto, task, {
|
|
99
|
+
excludeExtraneousValues: true
|
|
100
|
+
});
|
|
101
|
+
this.gateway?.emitToBoardRoom(task.boardId, {
|
|
102
|
+
type: 'task:moved',
|
|
103
|
+
boardId: task.boardId,
|
|
104
|
+
payload: data
|
|
105
|
+
});
|
|
106
|
+
return {
|
|
107
|
+
success: true,
|
|
108
|
+
message: 'Task moved',
|
|
109
|
+
messageKey: TASK_MESSAGES.MOVE_SUCCESS,
|
|
110
|
+
data
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
async assignTask(dto, user) {
|
|
114
|
+
const task = await this.taskService.assignTask(dto, user);
|
|
115
|
+
const data = plainToInstance(TaskResponseDto, task, {
|
|
116
|
+
excludeExtraneousValues: true
|
|
117
|
+
});
|
|
118
|
+
this.gateway?.emitToBoardRoom(task.boardId, {
|
|
119
|
+
type: 'task:updated',
|
|
120
|
+
boardId: task.boardId,
|
|
121
|
+
payload: data
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
success: true,
|
|
125
|
+
message: 'Task assigned',
|
|
126
|
+
messageKey: TASK_MESSAGES.ASSIGN_SUCCESS,
|
|
127
|
+
data
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
constructor(taskService, gateway){
|
|
131
|
+
super(taskService), _define_property(this, "taskService", void 0), _define_property(this, "gateway", void 0), this.taskService = taskService, this.gateway = gateway;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
_ts_decorate([
|
|
135
|
+
Post('move'),
|
|
136
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
137
|
+
ApiBearerAuth(),
|
|
138
|
+
HttpCode(HttpStatus.OK),
|
|
139
|
+
RequirePermission(TASK_PERMISSIONS.MOVE),
|
|
140
|
+
ApiOperation({
|
|
141
|
+
summary: 'Move task to another list'
|
|
142
|
+
}),
|
|
143
|
+
ApiBody({
|
|
144
|
+
type: MoveTaskDto
|
|
145
|
+
}),
|
|
146
|
+
ApiResponseDto(TaskResponseDto),
|
|
147
|
+
_ts_param(0, Body()),
|
|
148
|
+
_ts_param(1, CurrentUser()),
|
|
149
|
+
_ts_metadata("design:type", Function),
|
|
150
|
+
_ts_metadata("design:paramtypes", [
|
|
151
|
+
typeof MoveTaskDto === "undefined" ? Object : MoveTaskDto,
|
|
152
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
153
|
+
]),
|
|
154
|
+
_ts_metadata("design:returntype", Promise)
|
|
155
|
+
], TaskController.prototype, "moveTask", null);
|
|
156
|
+
_ts_decorate([
|
|
157
|
+
Post('assign'),
|
|
158
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
159
|
+
ApiBearerAuth(),
|
|
160
|
+
HttpCode(HttpStatus.OK),
|
|
161
|
+
RequirePermission(TASK_PERMISSIONS.ASSIGN),
|
|
162
|
+
ApiOperation({
|
|
163
|
+
summary: 'Assign task to a board member'
|
|
164
|
+
}),
|
|
165
|
+
ApiBody({
|
|
166
|
+
type: AssignTaskDto
|
|
167
|
+
}),
|
|
168
|
+
ApiResponseDto(TaskResponseDto),
|
|
169
|
+
_ts_param(0, Body()),
|
|
170
|
+
_ts_param(1, CurrentUser()),
|
|
171
|
+
_ts_metadata("design:type", Function),
|
|
172
|
+
_ts_metadata("design:paramtypes", [
|
|
173
|
+
typeof AssignTaskDto === "undefined" ? Object : AssignTaskDto,
|
|
174
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
175
|
+
]),
|
|
176
|
+
_ts_metadata("design:returntype", Promise)
|
|
177
|
+
], TaskController.prototype, "assignTask", null);
|
|
178
|
+
TaskController = _ts_decorate([
|
|
179
|
+
ApiTags('Task Manager - Tasks'),
|
|
180
|
+
Controller('task-manager/task'),
|
|
181
|
+
_ts_param(0, Inject(TaskService)),
|
|
182
|
+
_ts_param(1, Optional()),
|
|
183
|
+
_ts_param(1, Inject(TaskBoardGateway)),
|
|
184
|
+
_ts_metadata("design:type", Function),
|
|
185
|
+
_ts_metadata("design:paramtypes", [
|
|
186
|
+
typeof TaskService === "undefined" ? Object : TaskService,
|
|
187
|
+
typeof TaskBoardGateway === "undefined" ? Object : TaskBoardGateway
|
|
188
|
+
])
|
|
189
|
+
], TaskController);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './task-manager-swagger.config';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function taskManagerSwaggerConfig() {
|
|
2
|
+
return {
|
|
3
|
+
title: 'Task Manager API',
|
|
4
|
+
description: `
|
|
5
|
+
## Task Manager API
|
|
6
|
+
|
|
7
|
+
Manages kanban boards, task lists, tasks, labels, comments, and real-time board collaboration.
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
- Board management with member access control
|
|
11
|
+
- Drag-and-drop task lists with position ordering
|
|
12
|
+
- Tasks with priority, due date, assignee, and label support
|
|
13
|
+
- Label assignment via junction table (many-to-many)
|
|
14
|
+
- Task comments and activity log
|
|
15
|
+
- Real-time updates via WebSocket (Socket.IO)
|
|
16
|
+
|
|
17
|
+
### Endpoints
|
|
18
|
+
|
|
19
|
+
- \`POST /task-manager/board/*\` — Board CRUD + member management
|
|
20
|
+
|
|
21
|
+
- \`POST /task-manager/list/*\` — List CRUD + reorder
|
|
22
|
+
|
|
23
|
+
- \`POST /task-manager/task/*\` — Task CRUD + move + assign
|
|
24
|
+
|
|
25
|
+
- \`POST /task-manager/label/*\` — Label CRUD
|
|
26
|
+
|
|
27
|
+
- \`POST /task-manager/comment/*\` — Comment CRUD
|
|
28
|
+
`,
|
|
29
|
+
version: '1.0',
|
|
30
|
+
path: 'api/docs/task-manager',
|
|
31
|
+
bearerAuth: true
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
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;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
}
|
|
20
|
+
function _ts_metadata(k, v) {
|
|
21
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
22
|
+
}
|
|
23
|
+
import { ApiProperty, ApiPropertyOptional, PartialType } from '@nestjs/swagger';
|
|
24
|
+
import { Expose } from 'class-transformer';
|
|
25
|
+
import { IsBoolean, IsNotEmpty, IsOptional, IsString, IsUUID, MaxLength, IsEnum } from 'class-validator';
|
|
26
|
+
import { IdentityResponseDto } from '@flusys/nestjs-shared/dtos';
|
|
27
|
+
import { BoardMemberRole } from '../entities/task-board-member.entity';
|
|
28
|
+
export class CreateTaskBoardDto {
|
|
29
|
+
constructor(){
|
|
30
|
+
_define_property(this, "name", void 0);
|
|
31
|
+
_define_property(this, "description", void 0);
|
|
32
|
+
_define_property(this, "color", void 0);
|
|
33
|
+
_define_property(this, "memberIds", void 0);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
_ts_decorate([
|
|
37
|
+
ApiProperty({
|
|
38
|
+
description: 'Board name',
|
|
39
|
+
maxLength: 255
|
|
40
|
+
}),
|
|
41
|
+
IsNotEmpty(),
|
|
42
|
+
IsString(),
|
|
43
|
+
MaxLength(255),
|
|
44
|
+
_ts_metadata("design:type", String)
|
|
45
|
+
], CreateTaskBoardDto.prototype, "name", void 0);
|
|
46
|
+
_ts_decorate([
|
|
47
|
+
ApiPropertyOptional({
|
|
48
|
+
description: 'Board description'
|
|
49
|
+
}),
|
|
50
|
+
IsOptional(),
|
|
51
|
+
IsString(),
|
|
52
|
+
_ts_metadata("design:type", String)
|
|
53
|
+
], CreateTaskBoardDto.prototype, "description", void 0);
|
|
54
|
+
_ts_decorate([
|
|
55
|
+
ApiPropertyOptional({
|
|
56
|
+
description: 'Board color hex',
|
|
57
|
+
example: '#3B82F6',
|
|
58
|
+
default: '#3B82F6'
|
|
59
|
+
}),
|
|
60
|
+
IsOptional(),
|
|
61
|
+
IsString(),
|
|
62
|
+
MaxLength(7),
|
|
63
|
+
_ts_metadata("design:type", String)
|
|
64
|
+
], CreateTaskBoardDto.prototype, "color", void 0);
|
|
65
|
+
_ts_decorate([
|
|
66
|
+
ApiPropertyOptional({
|
|
67
|
+
description: 'Initial member user IDs',
|
|
68
|
+
type: [
|
|
69
|
+
String
|
|
70
|
+
]
|
|
71
|
+
}),
|
|
72
|
+
IsOptional(),
|
|
73
|
+
IsUUID('4', {
|
|
74
|
+
each: true
|
|
75
|
+
}),
|
|
76
|
+
_ts_metadata("design:type", Array)
|
|
77
|
+
], CreateTaskBoardDto.prototype, "memberIds", void 0);
|
|
78
|
+
export class UpdateTaskBoardDto extends PartialType(CreateTaskBoardDto) {
|
|
79
|
+
constructor(...args){
|
|
80
|
+
super(...args), _define_property(this, "id", void 0), _define_property(this, "isActive", void 0);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
_ts_decorate([
|
|
84
|
+
ApiProperty(),
|
|
85
|
+
IsUUID(),
|
|
86
|
+
_ts_metadata("design:type", String)
|
|
87
|
+
], UpdateTaskBoardDto.prototype, "id", void 0);
|
|
88
|
+
_ts_decorate([
|
|
89
|
+
ApiPropertyOptional(),
|
|
90
|
+
IsOptional(),
|
|
91
|
+
IsBoolean(),
|
|
92
|
+
_ts_metadata("design:type", Boolean)
|
|
93
|
+
], UpdateTaskBoardDto.prototype, "isActive", void 0);
|
|
94
|
+
export class AddBoardMemberDto {
|
|
95
|
+
constructor(){
|
|
96
|
+
_define_property(this, "boardId", void 0);
|
|
97
|
+
_define_property(this, "userId", void 0);
|
|
98
|
+
_define_property(this, "role", void 0);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
_ts_decorate([
|
|
102
|
+
ApiProperty(),
|
|
103
|
+
IsUUID(),
|
|
104
|
+
_ts_metadata("design:type", String)
|
|
105
|
+
], AddBoardMemberDto.prototype, "boardId", void 0);
|
|
106
|
+
_ts_decorate([
|
|
107
|
+
ApiProperty(),
|
|
108
|
+
IsUUID(),
|
|
109
|
+
_ts_metadata("design:type", String)
|
|
110
|
+
], AddBoardMemberDto.prototype, "userId", void 0);
|
|
111
|
+
_ts_decorate([
|
|
112
|
+
ApiPropertyOptional({
|
|
113
|
+
enum: BoardMemberRole,
|
|
114
|
+
default: BoardMemberRole.MEMBER
|
|
115
|
+
}),
|
|
116
|
+
IsOptional(),
|
|
117
|
+
IsEnum(BoardMemberRole),
|
|
118
|
+
_ts_metadata("design:type", typeof BoardMemberRole === "undefined" ? Object : BoardMemberRole)
|
|
119
|
+
], AddBoardMemberDto.prototype, "role", void 0);
|
|
120
|
+
export class RemoveBoardMemberDto {
|
|
121
|
+
constructor(){
|
|
122
|
+
_define_property(this, "boardId", void 0);
|
|
123
|
+
_define_property(this, "userId", void 0);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
_ts_decorate([
|
|
127
|
+
ApiProperty(),
|
|
128
|
+
IsUUID(),
|
|
129
|
+
_ts_metadata("design:type", String)
|
|
130
|
+
], RemoveBoardMemberDto.prototype, "boardId", void 0);
|
|
131
|
+
_ts_decorate([
|
|
132
|
+
ApiProperty(),
|
|
133
|
+
IsUUID(),
|
|
134
|
+
_ts_metadata("design:type", String)
|
|
135
|
+
], RemoveBoardMemberDto.prototype, "userId", void 0);
|
|
136
|
+
export class GetBoardMembersDto {
|
|
137
|
+
constructor(){
|
|
138
|
+
_define_property(this, "boardId", void 0);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
_ts_decorate([
|
|
142
|
+
ApiProperty(),
|
|
143
|
+
IsUUID(),
|
|
144
|
+
_ts_metadata("design:type", String)
|
|
145
|
+
], GetBoardMembersDto.prototype, "boardId", void 0);
|
|
146
|
+
export class TaskBoardResponseDto extends IdentityResponseDto {
|
|
147
|
+
constructor(...args){
|
|
148
|
+
super(...args), _define_property(this, "name", void 0), _define_property(this, "description", void 0), _define_property(this, "color", void 0), _define_property(this, "isActive", void 0), _define_property(this, "settings", void 0), _define_property(this, "companyId", void 0), _define_property(this, "totalMembers", void 0), _define_property(this, "totalLists", void 0), _define_property(this, "totalTasks", void 0);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
_ts_decorate([
|
|
152
|
+
Expose(),
|
|
153
|
+
ApiProperty({
|
|
154
|
+
type: String,
|
|
155
|
+
description: 'Board name',
|
|
156
|
+
maxLength: 255
|
|
157
|
+
}),
|
|
158
|
+
_ts_metadata("design:type", String)
|
|
159
|
+
], TaskBoardResponseDto.prototype, "name", void 0);
|
|
160
|
+
_ts_decorate([
|
|
161
|
+
Expose(),
|
|
162
|
+
ApiPropertyOptional({
|
|
163
|
+
type: String,
|
|
164
|
+
description: 'Board description',
|
|
165
|
+
nullable: true
|
|
166
|
+
}),
|
|
167
|
+
_ts_metadata("design:type", Object)
|
|
168
|
+
], TaskBoardResponseDto.prototype, "description", void 0);
|
|
169
|
+
_ts_decorate([
|
|
170
|
+
Expose(),
|
|
171
|
+
ApiProperty({
|
|
172
|
+
type: String,
|
|
173
|
+
description: 'Board color hex',
|
|
174
|
+
example: '#3B82F6'
|
|
175
|
+
}),
|
|
176
|
+
_ts_metadata("design:type", String)
|
|
177
|
+
], TaskBoardResponseDto.prototype, "color", void 0);
|
|
178
|
+
_ts_decorate([
|
|
179
|
+
Expose(),
|
|
180
|
+
ApiProperty({
|
|
181
|
+
type: Boolean,
|
|
182
|
+
description: 'Whether the board is active'
|
|
183
|
+
}),
|
|
184
|
+
_ts_metadata("design:type", Boolean)
|
|
185
|
+
], TaskBoardResponseDto.prototype, "isActive", void 0);
|
|
186
|
+
_ts_decorate([
|
|
187
|
+
Expose(),
|
|
188
|
+
ApiPropertyOptional({
|
|
189
|
+
type: Object,
|
|
190
|
+
description: 'Board settings JSON',
|
|
191
|
+
nullable: true
|
|
192
|
+
}),
|
|
193
|
+
_ts_metadata("design:type", Object)
|
|
194
|
+
], TaskBoardResponseDto.prototype, "settings", void 0);
|
|
195
|
+
_ts_decorate([
|
|
196
|
+
Expose(),
|
|
197
|
+
ApiPropertyOptional({
|
|
198
|
+
type: String,
|
|
199
|
+
format: 'uuid',
|
|
200
|
+
description: 'Company ID',
|
|
201
|
+
nullable: true
|
|
202
|
+
}),
|
|
203
|
+
_ts_metadata("design:type", Object)
|
|
204
|
+
], TaskBoardResponseDto.prototype, "companyId", void 0);
|
|
205
|
+
_ts_decorate([
|
|
206
|
+
Expose(),
|
|
207
|
+
ApiPropertyOptional({
|
|
208
|
+
type: Number,
|
|
209
|
+
description: 'Total number of board members'
|
|
210
|
+
}),
|
|
211
|
+
_ts_metadata("design:type", Number)
|
|
212
|
+
], TaskBoardResponseDto.prototype, "totalMembers", void 0);
|
|
213
|
+
_ts_decorate([
|
|
214
|
+
Expose(),
|
|
215
|
+
ApiPropertyOptional({
|
|
216
|
+
type: Number,
|
|
217
|
+
description: 'Total number of task lists'
|
|
218
|
+
}),
|
|
219
|
+
_ts_metadata("design:type", Number)
|
|
220
|
+
], TaskBoardResponseDto.prototype, "totalLists", void 0);
|
|
221
|
+
_ts_decorate([
|
|
222
|
+
Expose(),
|
|
223
|
+
ApiPropertyOptional({
|
|
224
|
+
type: Number,
|
|
225
|
+
description: 'Total number of tasks'
|
|
226
|
+
}),
|
|
227
|
+
_ts_metadata("design:type", Number)
|
|
228
|
+
], TaskBoardResponseDto.prototype, "totalTasks", void 0);
|
|
229
|
+
export class TaskBoardMemberResponseDto extends IdentityResponseDto {
|
|
230
|
+
constructor(...args){
|
|
231
|
+
super(...args), _define_property(this, "boardId", void 0), _define_property(this, "userId", void 0), _define_property(this, "role", void 0), _define_property(this, "userName", void 0), _define_property(this, "userEmail", void 0);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
_ts_decorate([
|
|
235
|
+
Expose(),
|
|
236
|
+
ApiProperty({
|
|
237
|
+
type: String,
|
|
238
|
+
format: 'uuid',
|
|
239
|
+
description: 'Board ID'
|
|
240
|
+
}),
|
|
241
|
+
_ts_metadata("design:type", String)
|
|
242
|
+
], TaskBoardMemberResponseDto.prototype, "boardId", void 0);
|
|
243
|
+
_ts_decorate([
|
|
244
|
+
Expose(),
|
|
245
|
+
ApiProperty({
|
|
246
|
+
type: String,
|
|
247
|
+
format: 'uuid',
|
|
248
|
+
description: 'User ID'
|
|
249
|
+
}),
|
|
250
|
+
_ts_metadata("design:type", String)
|
|
251
|
+
], TaskBoardMemberResponseDto.prototype, "userId", void 0);
|
|
252
|
+
_ts_decorate([
|
|
253
|
+
Expose(),
|
|
254
|
+
ApiProperty({
|
|
255
|
+
enum: BoardMemberRole,
|
|
256
|
+
description: 'Member role on the board'
|
|
257
|
+
}),
|
|
258
|
+
_ts_metadata("design:type", typeof BoardMemberRole === "undefined" ? Object : BoardMemberRole)
|
|
259
|
+
], TaskBoardMemberResponseDto.prototype, "role", void 0);
|
|
260
|
+
_ts_decorate([
|
|
261
|
+
Expose(),
|
|
262
|
+
ApiPropertyOptional({
|
|
263
|
+
type: String,
|
|
264
|
+
description: 'User display name',
|
|
265
|
+
nullable: true
|
|
266
|
+
}),
|
|
267
|
+
_ts_metadata("design:type", Object)
|
|
268
|
+
], TaskBoardMemberResponseDto.prototype, "userName", void 0);
|
|
269
|
+
_ts_decorate([
|
|
270
|
+
Expose(),
|
|
271
|
+
ApiPropertyOptional({
|
|
272
|
+
type: String,
|
|
273
|
+
description: 'User email',
|
|
274
|
+
nullable: true
|
|
275
|
+
}),
|
|
276
|
+
_ts_metadata("design:type", Object)
|
|
277
|
+
], TaskBoardMemberResponseDto.prototype, "userEmail", void 0);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
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;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
}
|
|
20
|
+
function _ts_metadata(k, v) {
|
|
21
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
22
|
+
}
|
|
23
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
24
|
+
import { Expose } from 'class-transformer';
|
|
25
|
+
import { IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';
|
|
26
|
+
import { IdentityResponseDto } from '@flusys/nestjs-shared/dtos';
|
|
27
|
+
export class CreateTaskCommentDto {
|
|
28
|
+
constructor(){
|
|
29
|
+
_define_property(this, "taskId", void 0);
|
|
30
|
+
_define_property(this, "content", void 0);
|
|
31
|
+
_define_property(this, "parentCommentId", void 0);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
_ts_decorate([
|
|
35
|
+
ApiProperty(),
|
|
36
|
+
IsUUID(),
|
|
37
|
+
_ts_metadata("design:type", String)
|
|
38
|
+
], CreateTaskCommentDto.prototype, "taskId", void 0);
|
|
39
|
+
_ts_decorate([
|
|
40
|
+
ApiProperty(),
|
|
41
|
+
IsNotEmpty(),
|
|
42
|
+
IsString(),
|
|
43
|
+
_ts_metadata("design:type", String)
|
|
44
|
+
], CreateTaskCommentDto.prototype, "content", void 0);
|
|
45
|
+
_ts_decorate([
|
|
46
|
+
ApiPropertyOptional({
|
|
47
|
+
description: 'Reply to comment ID'
|
|
48
|
+
}),
|
|
49
|
+
IsOptional(),
|
|
50
|
+
IsUUID(),
|
|
51
|
+
_ts_metadata("design:type", Object)
|
|
52
|
+
], CreateTaskCommentDto.prototype, "parentCommentId", void 0);
|
|
53
|
+
export class UpdateTaskCommentDto {
|
|
54
|
+
constructor(){
|
|
55
|
+
_define_property(this, "id", void 0);
|
|
56
|
+
_define_property(this, "content", void 0);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
_ts_decorate([
|
|
60
|
+
ApiProperty(),
|
|
61
|
+
IsUUID(),
|
|
62
|
+
_ts_metadata("design:type", String)
|
|
63
|
+
], UpdateTaskCommentDto.prototype, "id", void 0);
|
|
64
|
+
_ts_decorate([
|
|
65
|
+
ApiProperty(),
|
|
66
|
+
IsNotEmpty(),
|
|
67
|
+
IsString(),
|
|
68
|
+
_ts_metadata("design:type", String)
|
|
69
|
+
], UpdateTaskCommentDto.prototype, "content", void 0);
|
|
70
|
+
export class TaskCommentResponseDto extends IdentityResponseDto {
|
|
71
|
+
constructor(...args){
|
|
72
|
+
super(...args), _define_property(this, "taskId", void 0), _define_property(this, "userId", void 0), _define_property(this, "content", void 0), _define_property(this, "parentCommentId", void 0);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
_ts_decorate([
|
|
76
|
+
Expose(),
|
|
77
|
+
ApiProperty({
|
|
78
|
+
type: String,
|
|
79
|
+
format: 'uuid',
|
|
80
|
+
description: 'Task ID'
|
|
81
|
+
}),
|
|
82
|
+
_ts_metadata("design:type", String)
|
|
83
|
+
], TaskCommentResponseDto.prototype, "taskId", void 0);
|
|
84
|
+
_ts_decorate([
|
|
85
|
+
Expose(),
|
|
86
|
+
ApiProperty({
|
|
87
|
+
type: String,
|
|
88
|
+
format: 'uuid',
|
|
89
|
+
description: 'Author user ID'
|
|
90
|
+
}),
|
|
91
|
+
_ts_metadata("design:type", String)
|
|
92
|
+
], TaskCommentResponseDto.prototype, "userId", void 0);
|
|
93
|
+
_ts_decorate([
|
|
94
|
+
Expose(),
|
|
95
|
+
ApiProperty({
|
|
96
|
+
type: String,
|
|
97
|
+
description: 'Comment content'
|
|
98
|
+
}),
|
|
99
|
+
_ts_metadata("design:type", String)
|
|
100
|
+
], TaskCommentResponseDto.prototype, "content", void 0);
|
|
101
|
+
_ts_decorate([
|
|
102
|
+
Expose(),
|
|
103
|
+
ApiPropertyOptional({
|
|
104
|
+
type: String,
|
|
105
|
+
format: 'uuid',
|
|
106
|
+
description: 'Parent comment ID for replies',
|
|
107
|
+
nullable: true
|
|
108
|
+
}),
|
|
109
|
+
_ts_metadata("design:type", Object)
|
|
110
|
+
], TaskCommentResponseDto.prototype, "parentCommentId", void 0);
|