@venturialstd/project-management 0.0.1
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 +179 -0
- package/dist/constants/task.constant.d.ts +25 -0
- package/dist/constants/task.constant.d.ts.map +1 -0
- package/dist/constants/task.constant.js +32 -0
- package/dist/constants/task.constant.js.map +1 -0
- package/dist/dtos/CreateSprint.dto.d.ts +11 -0
- package/dist/dtos/CreateSprint.dto.d.ts.map +1 -0
- package/dist/dtos/CreateSprint.dto.js +58 -0
- package/dist/dtos/CreateSprint.dto.js.map +1 -0
- package/dist/dtos/CreateTask.dto.d.ts +20 -0
- package/dist/dtos/CreateTask.dto.d.ts.map +1 -0
- package/dist/dtos/CreateTask.dto.js +113 -0
- package/dist/dtos/CreateTask.dto.js.map +1 -0
- package/dist/dtos/MoveTask.dto.d.ts +6 -0
- package/dist/dtos/MoveTask.dto.d.ts.map +1 -0
- package/dist/dtos/MoveTask.dto.js +35 -0
- package/dist/dtos/MoveTask.dto.js.map +1 -0
- package/dist/dtos/UpdateSprint.dto.d.ts +10 -0
- package/dist/dtos/UpdateSprint.dto.d.ts.map +1 -0
- package/dist/dtos/UpdateSprint.dto.js +52 -0
- package/dist/dtos/UpdateSprint.dto.js.map +1 -0
- package/dist/dtos/UpdateTask.dto.d.ts +18 -0
- package/dist/dtos/UpdateTask.dto.d.ts.map +1 -0
- package/dist/dtos/UpdateTask.dto.js +101 -0
- package/dist/dtos/UpdateTask.dto.js.map +1 -0
- package/dist/entities/sprint.entity.d.ts +14 -0
- package/dist/entities/sprint.entity.d.ts.map +1 -0
- package/dist/entities/sprint.entity.js +96 -0
- package/dist/entities/sprint.entity.js.map +1 -0
- package/dist/entities/task.entity.d.ts +27 -0
- package/dist/entities/task.entity.d.ts.map +1 -0
- package/dist/entities/task.entity.js +193 -0
- package/dist/entities/task.entity.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/project-management.module.d.ts +3 -0
- package/dist/project-management.module.d.ts.map +1 -0
- package/dist/project-management.module.js +27 -0
- package/dist/project-management.module.js.map +1 -0
- package/dist/services/sprint.service.d.ts +36 -0
- package/dist/services/sprint.service.d.ts.map +1 -0
- package/dist/services/sprint.service.js +223 -0
- package/dist/services/sprint.service.js.map +1 -0
- package/dist/services/task.service.d.ts +40 -0
- package/dist/services/task.service.d.ts.map +1 -0
- package/dist/services/task.service.js +272 -0
- package/dist/services/task.service.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,223 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var SprintService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.SprintService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const core_1 = require("@venturialstd/core");
|
|
20
|
+
const typeorm_2 = require("typeorm");
|
|
21
|
+
const task_constant_1 = require("../constants/task.constant");
|
|
22
|
+
const sprint_entity_1 = require("../entities/sprint.entity");
|
|
23
|
+
const task_entity_1 = require("../entities/task.entity");
|
|
24
|
+
let SprintService = SprintService_1 = class SprintService {
|
|
25
|
+
repo;
|
|
26
|
+
taskRepo;
|
|
27
|
+
logger;
|
|
28
|
+
constructor(repo, taskRepo, logger) {
|
|
29
|
+
this.repo = repo;
|
|
30
|
+
this.taskRepo = taskRepo;
|
|
31
|
+
this.logger = logger;
|
|
32
|
+
this.logger.setContext(SprintService_1.name);
|
|
33
|
+
}
|
|
34
|
+
async createSprint(data) {
|
|
35
|
+
try {
|
|
36
|
+
const { name, goal, startDate, endDate, status, capacity, organizationId } = data;
|
|
37
|
+
if (new Date(startDate) >= new Date(endDate)) {
|
|
38
|
+
throw new common_1.BadRequestException('Start date must be before end date');
|
|
39
|
+
}
|
|
40
|
+
const overlappingSprints = await this.repo
|
|
41
|
+
.createQueryBuilder('sprint')
|
|
42
|
+
.where('sprint.organizationId = :organizationId', { organizationId })
|
|
43
|
+
.andWhere('sprint.status != :archived', { archived: task_constant_1.SPRINT_STATUS.ARCHIVED })
|
|
44
|
+
.andWhere('(sprint.startDate <= :endDate AND sprint.endDate >= :startDate)', { startDate, endDate })
|
|
45
|
+
.getMany();
|
|
46
|
+
if (overlappingSprints.length > 0) {
|
|
47
|
+
this.logger.warn(`Warning: Sprint overlaps with ${overlappingSprints.length} existing sprint(s)`);
|
|
48
|
+
}
|
|
49
|
+
const sprint = this.repo.create({
|
|
50
|
+
name,
|
|
51
|
+
goal,
|
|
52
|
+
startDate,
|
|
53
|
+
endDate,
|
|
54
|
+
status: status || task_constant_1.SPRINT_STATUS.PLANNING,
|
|
55
|
+
capacity: capacity || 80,
|
|
56
|
+
organizationId,
|
|
57
|
+
});
|
|
58
|
+
const savedSprint = await this.repo.save(sprint);
|
|
59
|
+
this.logger.log(`Sprint created: ${savedSprint.id} - ${savedSprint.name}`);
|
|
60
|
+
return savedSprint;
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
this.logger.error('Error creating sprint:', error);
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async updateSprint(sprintId, data) {
|
|
68
|
+
const sprint = await this.repo.findOne({ where: { id: sprintId } });
|
|
69
|
+
if (!sprint) {
|
|
70
|
+
throw new common_1.NotFoundException(`Sprint with id "${sprintId}" not found`);
|
|
71
|
+
}
|
|
72
|
+
const newStartDate = data.startDate || sprint.startDate;
|
|
73
|
+
const newEndDate = data.endDate || sprint.endDate;
|
|
74
|
+
if (new Date(newStartDate) >= new Date(newEndDate)) {
|
|
75
|
+
throw new common_1.BadRequestException('Start date must be before end date');
|
|
76
|
+
}
|
|
77
|
+
Object.assign(sprint, data);
|
|
78
|
+
const updatedSprint = await this.repo.save(sprint);
|
|
79
|
+
this.logger.log(`Sprint updated: ${sprintId}`);
|
|
80
|
+
return updatedSprint;
|
|
81
|
+
}
|
|
82
|
+
async deleteSprint(sprintId) {
|
|
83
|
+
const sprint = await this.repo.findOne({ where: { id: sprintId } });
|
|
84
|
+
if (!sprint) {
|
|
85
|
+
throw new common_1.NotFoundException(`Sprint with id "${sprintId}" not found`);
|
|
86
|
+
}
|
|
87
|
+
await this.taskRepo
|
|
88
|
+
.createQueryBuilder()
|
|
89
|
+
.update(task_entity_1.Task)
|
|
90
|
+
.set({ sprintId: () => 'NULL' })
|
|
91
|
+
.where('sprintId = :sprintId', { sprintId })
|
|
92
|
+
.execute();
|
|
93
|
+
await this.repo.remove(sprint);
|
|
94
|
+
this.logger.log(`Sprint deleted: ${sprintId} - Tasks moved to backlog`);
|
|
95
|
+
}
|
|
96
|
+
async startSprint(sprintId) {
|
|
97
|
+
const sprint = await this.repo.findOne({ where: { id: sprintId } });
|
|
98
|
+
if (!sprint) {
|
|
99
|
+
throw new common_1.NotFoundException(`Sprint with id "${sprintId}" not found`);
|
|
100
|
+
}
|
|
101
|
+
if (sprint.status !== task_constant_1.SPRINT_STATUS.PLANNING) {
|
|
102
|
+
throw new common_1.BadRequestException(`Cannot start sprint with status "${sprint.status}". Only planning sprints can be started.`);
|
|
103
|
+
}
|
|
104
|
+
sprint.status = task_constant_1.SPRINT_STATUS.ACTIVE;
|
|
105
|
+
const updatedSprint = await this.repo.save(sprint);
|
|
106
|
+
this.logger.log(`Sprint started: ${sprintId}`);
|
|
107
|
+
return updatedSprint;
|
|
108
|
+
}
|
|
109
|
+
async completeSprint(sprintId, moveIncompleteTasks = true) {
|
|
110
|
+
const sprint = await this.repo.findOne({ where: { id: sprintId } });
|
|
111
|
+
if (!sprint) {
|
|
112
|
+
throw new common_1.NotFoundException(`Sprint with id "${sprintId}" not found`);
|
|
113
|
+
}
|
|
114
|
+
if (sprint.status !== task_constant_1.SPRINT_STATUS.ACTIVE) {
|
|
115
|
+
throw new common_1.BadRequestException(`Cannot complete sprint with status "${sprint.status}". Only active sprints can be completed.`);
|
|
116
|
+
}
|
|
117
|
+
if (moveIncompleteTasks) {
|
|
118
|
+
await this.taskRepo
|
|
119
|
+
.createQueryBuilder()
|
|
120
|
+
.update(task_entity_1.Task)
|
|
121
|
+
.set({ sprintId: () => 'NULL' })
|
|
122
|
+
.where('sprintId = :sprintId', { sprintId })
|
|
123
|
+
.andWhere('status NOT IN (:...doneStatuses)', {
|
|
124
|
+
doneStatuses: ['done', 'completed'],
|
|
125
|
+
})
|
|
126
|
+
.execute();
|
|
127
|
+
this.logger.log(`Incomplete tasks from sprint ${sprintId} moved to backlog`);
|
|
128
|
+
}
|
|
129
|
+
sprint.status = task_constant_1.SPRINT_STATUS.COMPLETED;
|
|
130
|
+
const updatedSprint = await this.repo.save(sprint);
|
|
131
|
+
this.logger.log(`Sprint completed: ${sprintId}`);
|
|
132
|
+
return updatedSprint;
|
|
133
|
+
}
|
|
134
|
+
async archiveSprint(sprintId) {
|
|
135
|
+
const sprint = await this.repo.findOne({ where: { id: sprintId } });
|
|
136
|
+
if (!sprint) {
|
|
137
|
+
throw new common_1.NotFoundException(`Sprint with id "${sprintId}" not found`);
|
|
138
|
+
}
|
|
139
|
+
sprint.status = task_constant_1.SPRINT_STATUS.ARCHIVED;
|
|
140
|
+
const updatedSprint = await this.repo.save(sprint);
|
|
141
|
+
this.logger.log(`Sprint archived: ${sprintId}`);
|
|
142
|
+
return updatedSprint;
|
|
143
|
+
}
|
|
144
|
+
async getActiveSprints(organizationId) {
|
|
145
|
+
return this.repo.find({
|
|
146
|
+
where: {
|
|
147
|
+
organizationId,
|
|
148
|
+
status: task_constant_1.SPRINT_STATUS.ACTIVE,
|
|
149
|
+
},
|
|
150
|
+
order: { startDate: 'ASC' },
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
async getSprintsByOrganization(organizationId, includeArchived = false) {
|
|
154
|
+
const query = this.repo
|
|
155
|
+
.createQueryBuilder('sprint')
|
|
156
|
+
.where('sprint.organizationId = :organizationId', { organizationId });
|
|
157
|
+
if (!includeArchived) {
|
|
158
|
+
query.andWhere('sprint.status != :archived', { archived: task_constant_1.SPRINT_STATUS.ARCHIVED });
|
|
159
|
+
}
|
|
160
|
+
return query.orderBy('sprint.startDate', 'DESC').getMany();
|
|
161
|
+
}
|
|
162
|
+
async getSprintWithStats(sprintId) {
|
|
163
|
+
const sprint = await this.repo.findOne({ where: { id: sprintId } });
|
|
164
|
+
if (!sprint) {
|
|
165
|
+
throw new common_1.NotFoundException(`Sprint with id "${sprintId}" not found`);
|
|
166
|
+
}
|
|
167
|
+
const tasks = await this.taskRepo.find({ where: { sprintId } });
|
|
168
|
+
const stats = {
|
|
169
|
+
totalTasks: tasks.length,
|
|
170
|
+
completedTasks: tasks.filter((t) => t.status === 'done' || t.status === 'completed').length,
|
|
171
|
+
inProgressTasks: tasks.filter((t) => t.status === 'in_progress').length,
|
|
172
|
+
todoTasks: tasks.filter((t) => t.status === 'todo').length,
|
|
173
|
+
totalEstimatedHours: tasks.reduce((sum, t) => sum + (Number(t.estimatedHours) || 0), 0),
|
|
174
|
+
totalActualHours: tasks.reduce((sum, t) => sum + (Number(t.actualHours) || 0), 0),
|
|
175
|
+
capacityUsed: 0,
|
|
176
|
+
};
|
|
177
|
+
stats.capacityUsed = (stats.totalEstimatedHours / sprint.capacity) * 100;
|
|
178
|
+
return { sprint, stats };
|
|
179
|
+
}
|
|
180
|
+
async getCurrentSprint(organizationId) {
|
|
181
|
+
const today = new Date();
|
|
182
|
+
const sprint = await this.repo
|
|
183
|
+
.createQueryBuilder('sprint')
|
|
184
|
+
.where('sprint.organizationId = :organizationId', { organizationId })
|
|
185
|
+
.andWhere('sprint.status = :active', { active: task_constant_1.SPRINT_STATUS.ACTIVE })
|
|
186
|
+
.andWhere('sprint.startDate <= :today', { today })
|
|
187
|
+
.andWhere('sprint.endDate >= :today', { today })
|
|
188
|
+
.orderBy('sprint.startDate', 'DESC')
|
|
189
|
+
.getOne();
|
|
190
|
+
return sprint || null;
|
|
191
|
+
}
|
|
192
|
+
async getUpcomingSprints(organizationId) {
|
|
193
|
+
const today = new Date();
|
|
194
|
+
return this.repo.find({
|
|
195
|
+
where: {
|
|
196
|
+
organizationId,
|
|
197
|
+
status: task_constant_1.SPRINT_STATUS.PLANNING,
|
|
198
|
+
startDate: (0, typeorm_2.MoreThanOrEqual)(today),
|
|
199
|
+
},
|
|
200
|
+
order: { startDate: 'ASC' },
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
async getCompletedSprints(organizationId, limit = 10) {
|
|
204
|
+
return this.repo.find({
|
|
205
|
+
where: {
|
|
206
|
+
organizationId,
|
|
207
|
+
status: task_constant_1.SPRINT_STATUS.COMPLETED,
|
|
208
|
+
},
|
|
209
|
+
order: { endDate: 'DESC' },
|
|
210
|
+
take: limit,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
exports.SprintService = SprintService;
|
|
215
|
+
exports.SprintService = SprintService = SprintService_1 = __decorate([
|
|
216
|
+
(0, common_1.Injectable)(),
|
|
217
|
+
__param(0, (0, typeorm_1.InjectRepository)(sprint_entity_1.Sprint)),
|
|
218
|
+
__param(1, (0, typeorm_1.InjectRepository)(task_entity_1.Task)),
|
|
219
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
220
|
+
typeorm_2.Repository,
|
|
221
|
+
core_1.AppLogger])
|
|
222
|
+
], SprintService);
|
|
223
|
+
//# sourceMappingURL=sprint.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprint.service.js","sourceRoot":"","sources":["../../src/services/sprint.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoF;AACpF,6CAAmD;AACnD,6CAA+C;AAC/C,qCAAsD;AAItD,8DAA2D;AAC3D,6DAAmD;AACnD,yDAA+C;AAGxC,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAGN;IAEC;IACA;IALnB,YAEkB,IAAwB,EAEvB,QAA0B,EAC1B,MAAiB;QAHlB,SAAI,GAAJ,IAAI,CAAoB;QAEvB,aAAQ,GAAR,QAAQ,CAAkB;QAC1B,WAAM,GAAN,MAAM,CAAW;QAElC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAKD,KAAK,CAAC,YAAY,CAAC,IAAqB;QACtC,IAAI,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;YAGlF,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7C,MAAM,IAAI,4BAAmB,CAAC,oCAAoC,CAAC,CAAC;YACtE,CAAC;YAGD,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,IAAI;iBACvC,kBAAkB,CAAC,QAAQ,CAAC;iBAC5B,KAAK,CAAC,yCAAyC,EAAE,EAAE,cAAc,EAAE,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4BAA4B,EAAE,EAAE,KAAK,EAAE,CAAC;aACjD,QAAQ,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,CAAC;aAC/C,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC;aACnC,MAAM,EAAE,CAAC;QAEZ,OAAO,MAAM,IAAI,IAAI,CAAC;IACxB,CAAC;IAKD,KAAK,CAAC,kBAAkB,CAAC,cAAsB;QAC7C,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;QAEzB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACpB,KAAK,EAAE;gBACL,cAAc;gBACd,MAAM,EAAE,6BAAa,CAAC,QAAQ;gBAC9B,SAAS,EAAE,IAAA,yBAAe,EAAC,KAAK,CAAC;aAClC;YACD,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;SAC5B,CAAC,CAAC;IACL,CAAC;IAKD,KAAK,CAAC,mBAAmB,CAAC,cAAsB,EAAE,KAAK,GAAG,EAAE;QAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACpB,KAAK,EAAE;gBACL,cAAc;gBACd,MAAM,EAAE,6BAAa,CAAC,SAAS;aAChC;YACD,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;YAC1B,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAvSY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,sBAAM,CAAC,CAAA;IAExB,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;qCADD,oBAAU;QAEL,oBAAU;QACZ,gBAAS;GANzB,aAAa,CAuSzB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AppLogger } from '@venturialstd/core';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { CreateTaskDto } from '../dtos/CreateTask.dto';
|
|
4
|
+
import { MoveTaskDto } from '../dtos/MoveTask.dto';
|
|
5
|
+
import { UpdateTaskDto } from '../dtos/UpdateTask.dto';
|
|
6
|
+
import { Task } from '../entities/task.entity';
|
|
7
|
+
export declare class TaskService {
|
|
8
|
+
readonly repo: Repository<Task>;
|
|
9
|
+
private readonly logger;
|
|
10
|
+
constructor(repo: Repository<Task>, logger: AppLogger);
|
|
11
|
+
createTask(data: CreateTaskDto): Promise<Task>;
|
|
12
|
+
updateTask(taskId: string, data: UpdateTaskDto): Promise<Task>;
|
|
13
|
+
moveTask(data: MoveTaskDto): Promise<Task>;
|
|
14
|
+
assignTask(taskId: string, assigneeId: string, assigneeName: string, assigneeAvatar?: string | null): Promise<Task>;
|
|
15
|
+
unassignTask(taskId: string): Promise<Task>;
|
|
16
|
+
addComment(taskId: string, comment: {
|
|
17
|
+
userId: string;
|
|
18
|
+
userName: string;
|
|
19
|
+
text: string;
|
|
20
|
+
timestamp: Date;
|
|
21
|
+
}): Promise<Task>;
|
|
22
|
+
addAttachment(taskId: string, attachment: {
|
|
23
|
+
fileName: string;
|
|
24
|
+
fileUrl: string;
|
|
25
|
+
fileSize: number;
|
|
26
|
+
uploadedBy: string;
|
|
27
|
+
}): Promise<Task>;
|
|
28
|
+
getTasksBySprint(sprintId: string, organizationId: string): Promise<Task[]>;
|
|
29
|
+
getBacklogTasks(organizationId: string): Promise<Task[]>;
|
|
30
|
+
getTasksByAssignee(assigneeId: string, organizationId: string): Promise<Task[]>;
|
|
31
|
+
getTasksByOrganization(organizationId: string): Promise<Task[]>;
|
|
32
|
+
deleteTask(taskId: string): Promise<void>;
|
|
33
|
+
private getMaxOrder;
|
|
34
|
+
updateTaskStatus(taskId: string, status: string): Promise<Task>;
|
|
35
|
+
bulkUpdateOrders(updates: Array<{
|
|
36
|
+
taskId: string;
|
|
37
|
+
order: number;
|
|
38
|
+
}>): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=task.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|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ACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GACtF,OAAO,CAAC,IAAI,CAAC;IAoBV,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAU3E,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAUxD,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAU/E,sBAAsB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAU/D,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAyBjC,WAAW;IAcnB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB/D,gBAAgB,CACpB,OAAO,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,GAChD,OAAO,CAAC,IAAI,CAAC;CAWjB"}
|
|
@@ -0,0 +1,272 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var TaskService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.TaskService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const core_1 = require("@venturialstd/core");
|
|
20
|
+
const typeorm_2 = require("typeorm");
|
|
21
|
+
const task_entity_1 = require("../entities/task.entity");
|
|
22
|
+
let TaskService = TaskService_1 = class TaskService {
|
|
23
|
+
repo;
|
|
24
|
+
logger;
|
|
25
|
+
constructor(repo, logger) {
|
|
26
|
+
this.repo = repo;
|
|
27
|
+
this.logger = logger;
|
|
28
|
+
this.logger.setContext(TaskService_1.name);
|
|
29
|
+
}
|
|
30
|
+
async createTask(data) {
|
|
31
|
+
try {
|
|
32
|
+
const { title, description, status, priority, type, assigneeId, assigneeName, assigneeAvatar, reporterId, reporterName, reporterAvatar, dueDate, estimatedHours, tags, organizationId, sprintId, } = data;
|
|
33
|
+
const maxOrder = await this.getMaxOrder(organizationId, sprintId || null);
|
|
34
|
+
const task = this.repo.create({
|
|
35
|
+
title,
|
|
36
|
+
description,
|
|
37
|
+
status: status || 'todo',
|
|
38
|
+
priority,
|
|
39
|
+
type,
|
|
40
|
+
assigneeId,
|
|
41
|
+
assigneeName,
|
|
42
|
+
assigneeAvatar,
|
|
43
|
+
reporterId,
|
|
44
|
+
reporterName,
|
|
45
|
+
reporterAvatar,
|
|
46
|
+
dueDate,
|
|
47
|
+
estimatedHours,
|
|
48
|
+
tags: tags || [],
|
|
49
|
+
organizationId,
|
|
50
|
+
sprintId,
|
|
51
|
+
order: maxOrder + 1,
|
|
52
|
+
comments: [],
|
|
53
|
+
attachments: [],
|
|
54
|
+
});
|
|
55
|
+
const savedTask = await this.repo.save(task);
|
|
56
|
+
this.logger.log(`Task created: ${savedTask.id} - ${savedTask.title}`);
|
|
57
|
+
return savedTask;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
this.logger.error('Error creating task:', error);
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async updateTask(taskId, data) {
|
|
65
|
+
const task = await this.repo.findOne({ where: { id: taskId } });
|
|
66
|
+
if (!task) {
|
|
67
|
+
throw new common_1.NotFoundException(`Task with id "${taskId}" not found`);
|
|
68
|
+
}
|
|
69
|
+
Object.assign(task, data);
|
|
70
|
+
const updatedTask = await this.repo.save(task);
|
|
71
|
+
this.logger.log(`Task updated: ${taskId}`);
|
|
72
|
+
return updatedTask;
|
|
73
|
+
}
|
|
74
|
+
async moveTask(data) {
|
|
75
|
+
const { taskId, targetSprintId, targetOrder } = data;
|
|
76
|
+
const task = await this.repo.findOne({ where: { id: taskId } });
|
|
77
|
+
if (!task) {
|
|
78
|
+
throw new common_1.NotFoundException(`Task with id "${taskId}" not found`);
|
|
79
|
+
}
|
|
80
|
+
const oldSprintId = task.sprintId;
|
|
81
|
+
const oldOrder = task.order;
|
|
82
|
+
if (targetSprintId !== oldSprintId) {
|
|
83
|
+
const maxOrder = await this.getMaxOrder(task.organizationId, targetSprintId || null);
|
|
84
|
+
const newOrder = targetOrder !== undefined ? targetOrder : maxOrder + 1;
|
|
85
|
+
await this.repo
|
|
86
|
+
.createQueryBuilder()
|
|
87
|
+
.update(task_entity_1.Task)
|
|
88
|
+
.set({ order: () => '"order" - 1' })
|
|
89
|
+
.where('organizationId = :organizationId', { organizationId: task.organizationId })
|
|
90
|
+
.andWhere(oldSprintId ? 'sprintId = :oldSprintId' : 'sprintId IS NULL', {
|
|
91
|
+
oldSprintId,
|
|
92
|
+
})
|
|
93
|
+
.andWhere('order > :oldOrder', { oldOrder })
|
|
94
|
+
.execute();
|
|
95
|
+
await this.repo
|
|
96
|
+
.createQueryBuilder()
|
|
97
|
+
.update(task_entity_1.Task)
|
|
98
|
+
.set({ order: () => '"order" + 1' })
|
|
99
|
+
.where('organizationId = :organizationId', { organizationId: task.organizationId })
|
|
100
|
+
.andWhere(targetSprintId ? 'sprintId = :targetSprintId' : 'sprintId IS NULL', {
|
|
101
|
+
targetSprintId,
|
|
102
|
+
})
|
|
103
|
+
.andWhere('order >= :newOrder', { newOrder })
|
|
104
|
+
.execute();
|
|
105
|
+
task.sprintId = targetSprintId || null;
|
|
106
|
+
task.order = newOrder;
|
|
107
|
+
}
|
|
108
|
+
else if (targetOrder !== undefined && targetOrder !== oldOrder) {
|
|
109
|
+
if (targetOrder < oldOrder) {
|
|
110
|
+
await this.repo
|
|
111
|
+
.createQueryBuilder()
|
|
112
|
+
.update(task_entity_1.Task)
|
|
113
|
+
.set({ order: () => '"order" + 1' })
|
|
114
|
+
.where('organizationId = :organizationId', { organizationId: task.organizationId })
|
|
115
|
+
.andWhere(oldSprintId ? 'sprintId = :sprintId' : 'sprintId IS NULL', {
|
|
116
|
+
sprintId: oldSprintId,
|
|
117
|
+
})
|
|
118
|
+
.andWhere('order >= :targetOrder', { targetOrder })
|
|
119
|
+
.andWhere('order < :oldOrder', { oldOrder })
|
|
120
|
+
.execute();
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
await this.repo
|
|
124
|
+
.createQueryBuilder()
|
|
125
|
+
.update(task_entity_1.Task)
|
|
126
|
+
.set({ order: () => '"order" - 1' })
|
|
127
|
+
.where('organizationId = :organizationId', { organizationId: task.organizationId })
|
|
128
|
+
.andWhere(oldSprintId ? 'sprintId = :sprintId' : 'sprintId IS NULL', {
|
|
129
|
+
sprintId: oldSprintId,
|
|
130
|
+
})
|
|
131
|
+
.andWhere('order > :oldOrder', { oldOrder })
|
|
132
|
+
.andWhere('order <= :targetOrder', { targetOrder })
|
|
133
|
+
.execute();
|
|
134
|
+
}
|
|
135
|
+
task.order = targetOrder;
|
|
136
|
+
}
|
|
137
|
+
const updatedTask = await this.repo.save(task);
|
|
138
|
+
this.logger.log(`Task moved: ${taskId} to sprint ${targetSprintId || 'backlog'}`);
|
|
139
|
+
return updatedTask;
|
|
140
|
+
}
|
|
141
|
+
async assignTask(taskId, assigneeId, assigneeName, assigneeAvatar) {
|
|
142
|
+
const task = await this.repo.findOne({ where: { id: taskId } });
|
|
143
|
+
if (!task) {
|
|
144
|
+
throw new common_1.NotFoundException(`Task with id "${taskId}" not found`);
|
|
145
|
+
}
|
|
146
|
+
task.assigneeId = assigneeId;
|
|
147
|
+
task.assigneeName = assigneeName;
|
|
148
|
+
task.assigneeAvatar = assigneeAvatar || null;
|
|
149
|
+
const updatedTask = await this.repo.save(task);
|
|
150
|
+
this.logger.log(`Task assigned: ${taskId} to ${assigneeName}`);
|
|
151
|
+
return updatedTask;
|
|
152
|
+
}
|
|
153
|
+
async unassignTask(taskId) {
|
|
154
|
+
const task = await this.repo.findOne({ where: { id: taskId } });
|
|
155
|
+
if (!task) {
|
|
156
|
+
throw new common_1.NotFoundException(`Task with id "${taskId}" not found`);
|
|
157
|
+
}
|
|
158
|
+
task.assigneeId = null;
|
|
159
|
+
task.assigneeName = null;
|
|
160
|
+
task.assigneeAvatar = null;
|
|
161
|
+
const updatedTask = await this.repo.save(task);
|
|
162
|
+
this.logger.log(`Task unassigned: ${taskId}`);
|
|
163
|
+
return updatedTask;
|
|
164
|
+
}
|
|
165
|
+
async addComment(taskId, comment) {
|
|
166
|
+
const task = await this.repo.findOne({ where: { id: taskId } });
|
|
167
|
+
if (!task) {
|
|
168
|
+
throw new common_1.NotFoundException(`Task with id "${taskId}" not found`);
|
|
169
|
+
}
|
|
170
|
+
if (!task.comments) {
|
|
171
|
+
task.comments = [];
|
|
172
|
+
}
|
|
173
|
+
task.comments.push(comment);
|
|
174
|
+
const updatedTask = await this.repo.save(task);
|
|
175
|
+
this.logger.log(`Comment added to task: ${taskId}`);
|
|
176
|
+
return updatedTask;
|
|
177
|
+
}
|
|
178
|
+
async addAttachment(taskId, attachment) {
|
|
179
|
+
const task = await this.repo.findOne({ where: { id: taskId } });
|
|
180
|
+
if (!task) {
|
|
181
|
+
throw new common_1.NotFoundException(`Task with id "${taskId}" not found`);
|
|
182
|
+
}
|
|
183
|
+
if (!task.attachments) {
|
|
184
|
+
task.attachments = [];
|
|
185
|
+
}
|
|
186
|
+
task.attachments.push(attachment);
|
|
187
|
+
const updatedTask = await this.repo.save(task);
|
|
188
|
+
this.logger.log(`Attachment added to task: ${taskId}`);
|
|
189
|
+
return updatedTask;
|
|
190
|
+
}
|
|
191
|
+
async getTasksBySprint(sprintId, organizationId) {
|
|
192
|
+
return this.repo.find({
|
|
193
|
+
where: { sprintId, organizationId },
|
|
194
|
+
order: { order: 'ASC' },
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
async getBacklogTasks(organizationId) {
|
|
198
|
+
return this.repo.find({
|
|
199
|
+
where: { sprintId: (0, typeorm_2.IsNull)(), organizationId },
|
|
200
|
+
order: { order: 'ASC' },
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
async getTasksByAssignee(assigneeId, organizationId) {
|
|
204
|
+
return this.repo.find({
|
|
205
|
+
where: { assigneeId, organizationId },
|
|
206
|
+
order: { createdAt: 'DESC' },
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
async getTasksByOrganization(organizationId) {
|
|
210
|
+
return this.repo.find({
|
|
211
|
+
where: { organizationId },
|
|
212
|
+
order: { createdAt: 'DESC' },
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
async deleteTask(taskId) {
|
|
216
|
+
const task = await this.repo.findOne({ where: { id: taskId } });
|
|
217
|
+
if (!task) {
|
|
218
|
+
throw new common_1.NotFoundException(`Task with id "${taskId}" not found`);
|
|
219
|
+
}
|
|
220
|
+
await this.repo
|
|
221
|
+
.createQueryBuilder()
|
|
222
|
+
.update(task_entity_1.Task)
|
|
223
|
+
.set({ order: () => '"order" - 1' })
|
|
224
|
+
.where('organizationId = :organizationId', { organizationId: task.organizationId })
|
|
225
|
+
.andWhere(task.sprintId ? 'sprintId = :sprintId' : 'sprintId IS NULL', {
|
|
226
|
+
sprintId: task.sprintId,
|
|
227
|
+
})
|
|
228
|
+
.andWhere('order > :order', { order: task.order })
|
|
229
|
+
.execute();
|
|
230
|
+
await this.repo.remove(task);
|
|
231
|
+
this.logger.log(`Task deleted: ${taskId}`);
|
|
232
|
+
}
|
|
233
|
+
async getMaxOrder(organizationId, sprintId) {
|
|
234
|
+
const result = await this.repo
|
|
235
|
+
.createQueryBuilder('task')
|
|
236
|
+
.select('MAX(task.order)', 'maxOrder')
|
|
237
|
+
.where('task.organizationId = :organizationId', { organizationId })
|
|
238
|
+
.andWhere(sprintId ? 'task.sprintId = :sprintId' : 'task.sprintId IS NULL', { sprintId })
|
|
239
|
+
.getRawOne();
|
|
240
|
+
return result?.maxOrder ?? 0;
|
|
241
|
+
}
|
|
242
|
+
async updateTaskStatus(taskId, status) {
|
|
243
|
+
const task = await this.repo.findOne({ where: { id: taskId } });
|
|
244
|
+
if (!task) {
|
|
245
|
+
throw new common_1.NotFoundException(`Task with id "${taskId}" not found`);
|
|
246
|
+
}
|
|
247
|
+
task.status = status;
|
|
248
|
+
const updatedTask = await this.repo.save(task);
|
|
249
|
+
this.logger.log(`Task status updated: ${taskId} to ${status}`);
|
|
250
|
+
return updatedTask;
|
|
251
|
+
}
|
|
252
|
+
async bulkUpdateOrders(updates) {
|
|
253
|
+
try {
|
|
254
|
+
for (const update of updates) {
|
|
255
|
+
await this.repo.update(update.taskId, { order: update.order });
|
|
256
|
+
}
|
|
257
|
+
this.logger.log(`Bulk updated ${updates.length} task orders`);
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
this.logger.error('Error bulk updating task orders:', error);
|
|
261
|
+
throw error;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
exports.TaskService = TaskService;
|
|
266
|
+
exports.TaskService = TaskService = TaskService_1 = __decorate([
|
|
267
|
+
(0, common_1.Injectable)(),
|
|
268
|
+
__param(0, (0, typeorm_1.InjectRepository)(task_entity_1.Task)),
|
|
269
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
270
|
+
core_1.AppLogger])
|
|
271
|
+
], TaskService);
|
|
272
|
+
//# sourceMappingURL=task.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.service.js","sourceRoot":"","sources":["../../src/services/task.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,6CAAmD;AACnD,6CAA+C;AAC/C,qCAA6C;AAK7C,yDAA+C;AAGxC,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAGJ;IACC;IAHnB,YAEkB,IAAsB,EACrB,MAAiB;QADlB,SAAI,GAAJ,IAAI,CAAkB;QACrB,WAAM,GAAN,MAAM,CAAW;QAElC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,aAAW,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAKD,KAAK,CAAC,UAAU,CAAC,IAAmB;QAClC,IAAI,CAAC;YACH,MAAM,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,cAAc,EACd,UAAU,EACV,YAAY,EACZ,cAAc,EACd,OAAO,EACP,cAAc,EACd,IAAI,EACJ,cAAc,EACd,QAAQ,GACT,GAAG,IAAI,CAAC;YAGT,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,QAAQ,IAAI,IAAI,CAAC,CAAC;YAE1E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC5B,KA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C;YACH,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YACjE,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,OAAO,CAAC,MAAM,cAAc,CAAC,CAAC;QAChE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAc,CAAC,CAAC;YACtE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AAlXY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;qCACD,oBAAU;QACP,gBAAS;GAJzB,WAAW,CAkXvB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@venturialstd/project-management",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Project Management Module for Venturial - Task and Sprint Management",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.json",
|
|
16
|
+
"prepublishOnly": "npm run build",
|
|
17
|
+
"release:patch": "npm run build && npm version patch --no-git-tag-version && npm publish"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@nestjs/common": "^11.1.11",
|
|
21
|
+
"@nestjs/core": "^11.1.11",
|
|
22
|
+
"@nestjs/typeorm": "^10.0.2",
|
|
23
|
+
"@types/node": "^20.0.0",
|
|
24
|
+
"@venturialstd/core": "^1.6.6",
|
|
25
|
+
"class-transformer": "^0.5.1",
|
|
26
|
+
"class-validator": "^0.14.3",
|
|
27
|
+
"reflect-metadata": "^0.2.2",
|
|
28
|
+
"rxjs": "^7.8.2",
|
|
29
|
+
"typeorm": "^0.3.28",
|
|
30
|
+
"typescript": "^5.9.3"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@nestjs/common": "^11.0.11",
|
|
34
|
+
"@nestjs/core": "^11.0.5",
|
|
35
|
+
"@nestjs/typeorm": "^10.0.0",
|
|
36
|
+
"@venturialstd/core": "^1.0.16",
|
|
37
|
+
"class-transformer": "^0.5.1",
|
|
38
|
+
"class-validator": "^0.14.1",
|
|
39
|
+
"typeorm": "^0.3.20"
|
|
40
|
+
}
|
|
41
|
+
}
|