Skip to content
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bde7ea3
Price에 multiply() 추가
chr0m3 Oct 22, 2022
86b5760
MenuGroup entity 추가
chr0m3 Oct 22, 2022
4022276
MenuGroupEntity 추가
chr0m3 Oct 22, 2022
8382a9b
MenuGroupEntityConverter 추가
chr0m3 Oct 22, 2022
a1644b4
MenuGroupRepository 추가
chr0m3 Oct 22, 2022
b84cfe6
JpaMenuGroupRepository, JpaMenuGroupDao 추가
chr0m3 Oct 22, 2022
eb121a6
Price.multiply() 테스트 추가
chr0m3 Oct 22, 2022
4e44a8f
Price에 add() 추가
chr0m3 Oct 22, 2022
2c52931
Price가 Comparable을 구현하도록 수정
chr0m3 Oct 22, 2022
0146904
MenuProductQuantity VO 추가
chr0m3 Oct 22, 2022
a968bc6
MenuProduct VO 추가
chr0m3 Oct 23, 2022
7ff9973
MenuGroup VO 추가
chr0m3 Oct 23, 2022
3621adb
Menu entity 추가
chr0m3 Oct 23, 2022
5aab011
MenuDisplayPolicy 추가
chr0m3 Oct 23, 2022
58bd527
MenuRepository 추가
chr0m3 Oct 23, 2022
0701e17
Menu의 isVisible을 displayed로 변경
chr0m3 Oct 23, 2022
bf9bfb1
MenuEntity 추가
chr0m3 Oct 23, 2022
44adb96
MenuGroup VO 삭제
chr0m3 Oct 24, 2022
2d16e74
MenuProductEntity 추가
chr0m3 Oct 24, 2022
218f580
MenuProductEntityConverter 추가
chr0m3 Oct 24, 2022
c346395
누락된 final 추가
chr0m3 Oct 24, 2022
26aa5e7
MenuEntityConverter 추가
chr0m3 Oct 24, 2022
ac684f6
JpaMenuRepository 추가
chr0m3 Oct 24, 2022
748ee71
JpaMenuRepository 리팩터링 - 중복 코드 제거
chr0m3 Oct 24, 2022
96fe49a
메뉴 노출 정책을 위반하는 가격 변경이 불가능하도록 수정
chr0m3 Oct 24, 2022
f795b5c
새로운 도메인 모델을 사용하도록 Menu 컨텍스트 수정
chr0m3 Oct 24, 2022
2c7035e
불필요해진 과거 코드 제거
chr0m3 Oct 24, 2022
a662282
CreateMenuGroupCommand DTO 추가
chr0m3 Oct 24, 2022
a753755
ChangeMenuPriceCommand DTO 추가
chr0m3 Oct 24, 2022
86dc9e6
CreateMenuCommand DTO 추가
chr0m3 Oct 24, 2022
81afbbc
메뉴 노출 정책을 위반하는 메뉴 생성이 불가능하도록 수정
chr0m3 Oct 24, 2022
bd08ccb
메뉴 생성시 정확한 상품 가격을 반영하도록 개선
chr0m3 Oct 24, 2022
71f200a
DB 마이그레이션
chr0m3 Oct 24, 2022
139c6f8
도메인 모델 수정
chr0m3 Oct 24, 2022
1c460a0
Converter 인터페이스 제거
chr0m3 Oct 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/main/java/kitchenpos/menu/tobe/domain/entity/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ public class Menu {

private final List<MenuProduct> menuProducts;

private Boolean isVisible;
private Boolean displayed;
Copy link
Author

@chr0m3 chr0m3 Oct 24, 2022

Choose a reason for hiding this comment

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

굳이 isVisible로 바꿔야만 하는 이유가 없어서 불필요한 데이터베이스 변경을 만들지 않기 위해 displayed를 그대로 사용하기로 했습니다.


private Price price;

public Menu(
final UUID id,
final Name name,
final Boolean isVisible,
final Boolean displayed,
final Price price,
final MenuGroup menuGroup,
final List<MenuProduct> menuProducts
) {
this.id = id;
this.name = name;
this.isVisible = isVisible;
this.displayed = displayed;
this.price = price;
this.menuGroup = menuGroup;
this.menuProducts = menuProducts;
}

public boolean isVisible() {
return this.isVisible;
public boolean displayed() {
return this.displayed;
}

public Price price() {
Expand All @@ -55,11 +55,11 @@ public void display() {
if (!MenuDisplayPolicy.isDisplayable(this)) {
throw new IllegalStateException("메뉴 노출 정책에 따라 이 메뉴를 노출할 수 없습니다");
}
this.isVisible = true;
this.displayed = true;
}

public void hide() {
this.isVisible = false;
this.displayed = false;
}

public void setPrice(final Price price) {
Copy link

Choose a reason for hiding this comment

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

setter 네이밍을 사용하기 보다는 의미있는 네이밍을 고민해보세요 😄

Expand Down