Skip to content

Commit

Permalink
refactor(#104): 피드백 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
jusung-c committed Nov 17, 2023
1 parent 2a93f3a commit 1da017f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,8 @@ public void deleteHouseworkInfo(HouseworkInfoDeleteRequest request) {
houseworkInfoRepository.deleteById(houseworkInfo.getId());
log.info(">>>> HouseworkInfo Deleted: {}", houseworkInfo.getId());

// HouseworkInfo를 외래키로 가진 HouseworkTodo 리스트 조회
List<HouseworkTodo> findTodoList = houseworkTodoRepository.findHouseworkTodoByHouseworkInfo(houseworkInfo.getId());

// requestDate 이후의 HouseworkTodo를 HOUSEWORK_TODO_DELETE로 상태 변경
findTodoList.stream()
houseworkTodoRepository.findHouseworkTodoByHouseworkInfo(houseworkInfo.getId()).stream()
.filter(todo -> todo.getDate().isAfter(requestDate))
.forEach(HouseworkTodo::deleteHouseworkTodo);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

@Getter
public class HouseworkInfoDeleteRequest {
Long groupId;
LocalDate date;
Long todoId;
HouseworkInfoDeleteType deleteType;
private Long groupId;
private LocalDate date;
private Long todoId;
private HouseworkInfoDeleteType deleteType;

@Builder
public HouseworkInfoDeleteRequest(Long groupId, LocalDate date, Long todoId, HouseworkInfoDeleteType deleteType) {
Expand Down

0 comments on commit 1da017f

Please sign in to comment.