Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] feat: Festival 엔티티 startDate, endDate 필드 FestivalDuration 값 타입 변경 및 thumbnail 필드명 변경 (#880) #881

Merged
merged 4 commits into from
Apr 20, 2024

Conversation

seokjin8678
Copy link
Collaborator

@seokjin8678 seokjin8678 commented Apr 19, 2024

📌 관련 이슈

✨ PR 세부 내용

Festival 엔티티의 startDate, endDate 필드를 더 명확한 의미를 가지는 festivalDuration 필드로 변경했습니다.

그에따라 축제의 기간을 검증하는 메서드도 festivalDuration으로 옮겨졌고, Festival 엔티티는 해당 로직을 festivalDuration필드에 위임하여 실행합니다.

isBeforeStartDate() 메서드 명을 isStartDateBeforeTo() 변경했는데, 테스트 코드를 작성하니 해당 메서드 명이 인자로 넘어오는 LocalDate가 startDate 이전인지 확인하는 메서드 같더군요. 😂

따라서 헷갈리지 않고, 명확한 의미를 가지도록 isStartDateBeforeTo()로 이름을 변경했습니다.

검증 로직을 FestivalDuration 클래스로 위임하니, Festival 엔티티는 크게 하는 일이 없네요.

또한 기존에 사용되던 thubnail 필드를 posterImageUrl으로 변경했습니다.

필드명이 바뀜에 따라 사용중이던 QueryRepository에도 영향이 많이 가네요. 😂

언젠가 해야했던 일인지라.. 빨리 변경하는게 좋을 것 같습니다.

@seokjin8678 seokjin8678 added BE 백엔드에 관련된 작업 ⚙️ 리팩터링 리팩터링에 관련된 작업 labels Apr 19, 2024
@seokjin8678 seokjin8678 self-assigned this Apr 19, 2024
@github-actions github-actions bot requested review from BGuga, carsago and xxeol2 April 19, 2024 15:49
Copy link

Test Results

200 files  200 suites   25s ⏱️
665 tests 665 ✅ 0 💤 0 ❌
678 runs  678 ✅ 0 💤 0 ❌

Results for commit f6a03fe.

Comment on lines +19 to +23
class FestivalDurationTest {

LocalDate _6월_15일 = LocalDate.parse("2077-06-15");
LocalDate _6월_16일 = LocalDate.parse("2077-06-16");
LocalDate _6월_17일 = LocalDate.parse("2077-06-17");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 녀석이 festival 보다 더 생성하기 쉬운 객체니까 이렇게 빼는게 더 테스트 하기 쉽네요.

Comment on lines -32 to 34
public boolean isBeforeStartDate(LocalDate date) {
public boolean isStartDateBeforeTo(LocalDate date) {
return startDate.isBefore(date);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@seokjin8678 seokjin8678 merged commit 0ba69ad into dev Apr 20, 2024
7 checks passed
@seokjin8678 seokjin8678 deleted the feat/#880 branch April 20, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드에 관련된 작업 ⚙️ 리팩터링 리팩터링에 관련된 작업
Projects
None yet
2 participants