1 parent
f0f36c4f48
commit
40d579cdb9
30 files changed
+115
-14
No files matched your search
@@ -12,6 +12,7 @@ export class IssueWithUsersDto {
|
||||
assignee: UserDto | null;
|
||||
reporter: UserDto;
|
||||
projectId: string;
|
||||
dueDate: Date | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export class IssueDto {
|
||||
assigneeId: string | null;
|
||||
reporterId: string;
|
||||
projectId: string;
|
||||
dueDate: Date | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
@@ -15,6 +15,7 @@ export class IssueApplicationMapper {
|
||||
assigneeId: issue.assignee,
|
||||
reporterId: issue.reporter,
|
||||
projectId: issue.projectId,
|
||||
dueDate: issue.dueDate,
|
||||
createdAt: issue.createdAt,
|
||||
updatedAt: issue.updatedAt,
|
||||
};
|
||||
@@ -39,6 +40,7 @@ export class IssueApplicationMapper {
|
||||
assignee: issue.assignee ? (usersById.get(issue.assignee) ?? null) : null,
|
||||
reporter,
|
||||
projectId: issue.projectId,
|
||||
dueDate: issue.dueDate,
|
||||
createdAt: issue.createdAt,
|
||||
updatedAt: issue.updatedAt,
|
||||
};
|
||||
|
||||
@@ -27,6 +27,7 @@ const buildIssue = (overrides: Partial<{ assignee: string | null; reporter: stri
|
||||
assignee: 'assignee' in overrides ? (overrides.assignee ?? null) : 'user-2',
|
||||
reporter: overrides.reporter ?? 'user-1',
|
||||
projectId: 'project-1',
|
||||
dueDate: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
});
|
||||
|
||||
@@ -7,5 +7,6 @@ export class CreateIssueCommand {
|
||||
public readonly content?: string,
|
||||
public readonly priority?: number,
|
||||
public readonly assignee?: string,
|
||||
public readonly dueDate?: Date,
|
||||
) {}
|
||||
}
|
||||
@@ -56,6 +56,7 @@ describe('CreateIssueUseCase', () => {
|
||||
assignee: issue.assignee,
|
||||
reporter: issue.reporter,
|
||||
projectId: issue.projectId,
|
||||
dueDate: issue.dueDate,
|
||||
createdAt: issue.createdAt,
|
||||
updatedAt: issue.updatedAt,
|
||||
}),
|
||||
@@ -104,6 +105,7 @@ describe('CreateIssueUseCase', () => {
|
||||
assignee: issue.assignee,
|
||||
reporter: issue.reporter,
|
||||
projectId: issue.projectId,
|
||||
dueDate: issue.dueDate,
|
||||
createdAt: issue.createdAt,
|
||||
updatedAt: issue.updatedAt,
|
||||
}),
|
||||
|
||||
@@ -31,6 +31,7 @@ export class CreateIssueUseCase {
|
||||
assignee: command.assignee,
|
||||
reporter: command.reporter,
|
||||
projectId: command.projectId,
|
||||
dueDate: command.dueDate,
|
||||
});
|
||||
|
||||
const issue = await this.issueRepository.create(draft);
|
||||
|
||||
@@ -17,6 +17,7 @@ const buildIssue = () =>
|
||||
assignee: null,
|
||||
reporter: 'user-1',
|
||||
projectId: 'project-1',
|
||||
dueDate: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
});
|
||||
|
||||
+1
@@ -18,6 +18,7 @@ const buildIssue = () =>
|
||||
assignee: 'user-2',
|
||||
reporter: 'user-1',
|
||||
projectId: 'project-1',
|
||||
dueDate: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
});
|
||||
|
||||
@@ -18,6 +18,7 @@ const buildIssue = () =>
|
||||
assignee: 'user-2',
|
||||
reporter: 'user-1',
|
||||
projectId: 'project-1',
|
||||
dueDate: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ const buildIssue = (id: number) =>
|
||||
assignee: null,
|
||||
reporter: 'user-1',
|
||||
projectId: 'project-1',
|
||||
dueDate: null,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
});
|
||||
|
||||
@@ -7,5 +7,6 @@ export class UpdateIssueCommand {
|
||||
public readonly status?: string,
|
||||
public readonly priority?: number,
|
||||
public readonly assignee?: string | null,
|
||||
public readonly dueDate?: Date | null,
|
||||
) {}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ const buildIssue = () =>
|
||||
assignee: null,
|
||||
reporter: 'user-1',
|
||||
projectId: 'project-1',
|
||||
dueDate: null,
|
||||
createdAt: new Date('2026-01-01T00:00:00.000Z'),
|
||||
updatedAt: new Date('2026-01-01T00:00:00.000Z'),
|
||||
});
|
||||
|
||||
@@ -53,6 +53,10 @@ export class UpdateIssueUseCase {
|
||||
}
|
||||
}
|
||||
|
||||
if (command.dueDate !== undefined) {
|
||||
issue.updateDueDate(command.dueDate);
|
||||
}
|
||||
|
||||
await this.issueRepository.update(issue);
|
||||
const dto = await this.issueUserExpander.expand(issue);
|
||||
|
||||
|
||||
Reference in new issue
Block a user