Skip to content

Commit

Permalink
feat: 백로그 조회 API에 우선순위 데이터(rankValue)추가
Browse files Browse the repository at this point in the history
- initBacklog 테스트에 rankValue 정보 추가
- initBacklog Response DTO에 rankValue 정보 추가
  • Loading branch information
choyoungwoo9 committed Aug 2, 2024
1 parent 898d200 commit 268d63e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/src/project/dto/InitBacklogResponse.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class TaskDto {
actualTime: number | null;
status: TaskStatus;
assignedMemberId: number | null;
rankValue: string;

static of(task: Task): TaskDto {
const dto = new TaskDto();
Expand All @@ -20,6 +21,7 @@ class TaskDto {
dto.actualTime = task.actualTime;
dto.status = task.status;
dto.assignedMemberId = task.assignedMemberId;
dto.rankValue = task.rankValue;
return dto;
}
}
Expand All @@ -29,6 +31,7 @@ class StoryDto {
title: string;
point: number | null;
status: StoryStatus;
rankValue: string;
taskList: TaskDto[];

static of(story: Story): StoryDto {
Expand All @@ -37,6 +40,7 @@ class StoryDto {
dto.title = story.title;
dto.point = story.point;
dto.status = story.status;
dto.rankValue = story.rankValue;
dto.taskList = story.taskList.map(TaskDto.of);
return dto;
}
Expand All @@ -46,13 +50,15 @@ class EpicDto {
id: number;
name: string;
color: EpicColor;
rankValue: string;
storyList: StoryDto[];

static of(epic: Epic): EpicDto {
const dto = new EpicDto();
dto.id = epic.id;
dto.name = epic.name;
dto.color = epic.color;
dto.rankValue = epic.rankValue;
dto.storyList = epic.storyList.map(StoryDto.of);
return dto;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,16 @@ describe('WS epic', () => {
expect(epic.id).toBe(epicId);
expect(epic.name).toBe(epicName);
expect(epic.color).toBe(epicColor);
expect(epic.rankValue).toBe(middleRankValue);

expect(epic.storyList).toHaveLength(1);
const story = epic.storyList[0];
expect(story.id).toBe(storyId);
expect(story.title).toBe(storyTitle);
expect(story.point).toBe(storyPoint);
expect(story.status).toBe(storyStatus);
expect(story.rankValue).toBe(middleRankValue);

expect(story.taskList).toHaveLength(1);
const task = story.taskList[0];
expect(task.id).toBe(taskId);
Expand All @@ -90,6 +94,7 @@ describe('WS epic', () => {
expect(task.actualTime).toBe(taskActualTime);
expect(task.status).toBe(taskStatus);
expect(task.assignedMemberId).toBe(taskAssignedMemberId);
expect(task.rankValue).toBe(middleRankValue);
} catch (e) {
reject(e);
}
Expand Down

0 comments on commit 268d63e

Please sign in to comment.