Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
c1d27b7
[step0] 0단계 - 기본 코드 준비 (#329)
suzhanlee Feb 16, 2025
f6c6f9d
[Step1] 1단계 - 리팩토링(상품) (#330)
suzhanlee Feb 17, 2025
69ead3e
[Step2] 2단계 - 리팩터링(메뉴) (#341)
suzhanlee Feb 19, 2025
83ad1f3
squash!(kitchen pos) : rebase squash
suzhanlee Feb 16, 2025
7b1ea72
refactor(kitchen pos) : menu 관련 예외 메시지 enum으로 분리
suzhanlee Feb 19, 2025
76c3858
refactor(kitchen pos) : product 관련 예외 메시지 enum으로 분리
suzhanlee Feb 19, 2025
be6ef08
feat(kitchen pos) : OrderTableName 생성
suzhanlee Feb 19, 2025
780f002
refactor(kitchen pos) : OrderTable 점유 해제 및 손님 수 변경 책임 주문 테이블로 이동
suzhanlee Feb 19, 2025
90f3cc3
refactor(kitchen pos) : OrderTable 점유 해제 및 손님 수 변경 책임 적용
suzhanlee Feb 19, 2025
cfd3f56
test(kitchen pos) : OrderTable changeNumberOfGuests 테스트 코드 작성
suzhanlee Feb 19, 2025
80f7217
feat & fix(kitchen pos) : EatInOrder Order를 기반으로 만들고, 컴파일 오류 해결
suzhanlee Feb 19, 2025
5e6d963
remove(kitchen pos) : EatInOrder 에 필요 없는 주문 유형 제거
suzhanlee Feb 19, 2025
e3a8c8f
fix(kitchen pos) : EatInOrder Entity 생성으로 인한 테이블 매핑 오류 해결
suzhanlee Feb 19, 2025
08bee5c
feat&refactor(kitchen pos) : EatInOrder, OrderLineItem 유효성 검사 로직 추가 및 적용
suzhanlee Feb 19, 2025
5d03daa
docs&test(kitchen pos) : OrderLineItem 요구 사항 추가 및 테스트 코드 작성
suzhanlee Feb 19, 2025
553ce8e
refactor & test(kitchen pos) : EatInOrderService 리팩토링 및 테스트 코드 작성
suzhanlee Feb 19, 2025
9acec4d
test(kitchen pos) : EatInOrderFlow test 코드 작성
suzhanlee Feb 19, 2025
69d6052
test(kitchen pos) : EatInOrder processOrderFlow test 코드 작성
suzhanlee Feb 19, 2025
fe29b83
fix(kitchen pos) : EatInOrderRepository existsByOrderTableAndEatInOrd…
suzhanlee Feb 19, 2025
3f00360
feat(kitchen pos) : EatInOrderFlow 예외 메시지 추가
suzhanlee Feb 19, 2025
f3e12ad
fix(kitchen pos) : JsonCreator 및 JsonValue로 데이터 직렬화로 인한 Controller 테스…
suzhanlee Feb 19, 2025
2cf1193
feat(kitchen pos) : EatInOrderRestController 기능 추가
suzhanlee Feb 20, 2025
f031dfc
test(kitchen pos) : EatInOrderRestController 테스트 코드 추가
suzhanlee Feb 20, 2025
2b09973
style(kitchen pos) : import 문 최적화 및 정렬
suzhanlee Feb 20, 2025
66cfde5
remove(kitchen pos) : 필요 없는 getter, setter 삭제
suzhanlee Feb 23, 2025
f87a3c6
feat & refactor(kitchen pos) : OrderLineItemValidator 및 EatInOrderFac…
suzhanlee Feb 23, 2025
98e1924
feat(kitchen pos) : OrderTableOccupationManager 생성 및 테스트
suzhanlee Feb 23, 2025
6907f2d
feat & test(kitchen pos) : EatInOrder 이벤트 애그러거트 설정 및 이벤트 발행 로직 적용, 테스트
suzhanlee Feb 23, 2025
43854c1
Merge remote-tracking branch 'origin/step3' into step3
suzhanlee Feb 23, 2025
ac0ec78
refactor(kitchen pos) : OrderTableService clear 메소드 리팩토링
suzhanlee Feb 24, 2025
9a5a39b
refactor(kitchen pos) : EatInOrderFactory 팩토리 메소드 애노테이션 수정
suzhanlee Feb 24, 2025
95d2acd
test(kitchen pos) : OrderTableOccupationManager 예외 테스트 작성
suzhanlee Feb 24, 2025
f334fdf
refactor(kitchen pos) : EatInOrder, OrderTable id 생성자 내에서 자동 생성하도록 숨기기
suzhanlee Feb 24, 2025
ccfe2d2
refactor(kitchen pos) : Menu, MenuGroup, Product id 생성자 내에서 자동 생성하도록 숨기기
suzhanlee Feb 24, 2025
7cfe350
style(kitchen pos) : import 문 최적화 및 정렬
suzhanlee Feb 24, 2025
25ac259
refactor(kitchen pos) : EatInOrderRestController create 메소드 dto 적용
suzhanlee Feb 24, 2025
484d4cc
refactor(kitchen pos) : EatInOrderRestController create 제외 나머지 메소드 dt…
suzhanlee Feb 25, 2025
d11b48a
refactor(kitchen pos) : OrderTableRestController create 메소드 dto를 사용하도…
suzhanlee Feb 25, 2025
6b8faf9
refactor(kitchen pos) : OrderTableRestController create 제외 나머지 메소드 dt…
suzhanlee Feb 25, 2025
21e8a34
refactor(kitchen pos) : EatInOrderRestController 반환 dto 타입 수정
suzhanlee Feb 25, 2025
6acd197
refactor(kitchen pos) : service -> application 잘못된 패키지 이동
suzhanlee Feb 25, 2025
3cf4724
refactor(kitchen pos) : MenuGroupRestController dto 사용하도록 리팩토링
suzhanlee Feb 25, 2025
7d8902a
refactor(kitchen pos) : ProductRestController dto 사용하도록 리팩토링
suzhanlee Feb 25, 2025
0b1695d
refactor(kitchen pos) : MenuRestController dto 사용하도록 리팩토링
suzhanlee Feb 25, 2025
9a60447
remove(kitchen pos) : 사용하지 않는 테스트 메소드 삭제
suzhanlee Feb 25, 2025
5354b99
feat(kitchen pos) : 같은 트랜잭션 전파를 사용하도록 해 오류 발생 시 같이 롤백되도록 수정
suzhanlee Feb 25, 2025
a61dbf8
fix(kitchen pos) : event 부분에서 예외 발생 시 전체 트랜잭션이 함께 롤백되도록 수정
suzhanlee Feb 25, 2025
3dcf859
chore(kitchen pos) : queryDSL gradle 설정
suzhanlee Feb 26, 2025
767a12f
feat(kitchen pos) : Menu, Product 쿼리 모델 생성
suzhanlee Feb 26, 2025
d9a8710
feat(kitchen pos) : findAll 쿼리 모델을 통해 조회하도록 수정
suzhanlee Feb 26, 2025
51d8a5b
refactor(kitchen pos) : menu 관련 예외 메시지 enum으로 분리
suzhanlee Feb 19, 2025
b87589b
refactor(kitchen pos) : product 관련 예외 메시지 enum으로 분리
suzhanlee Feb 19, 2025
ace54b6
fix(kitchen pos) : EatInOrder Entity 생성으로 인한 테이블 매핑 오류 해결
suzhanlee Feb 19, 2025
1def621
feat&refactor(kitchen pos) : EatInOrder, OrderLineItem 유효성 검사 로직 추가 및 적용
suzhanlee Feb 19, 2025
d78682d
refactor & test(kitchen pos) : EatInOrderService 리팩토링 및 테스트 코드 작성
suzhanlee Feb 19, 2025
7c4a566
test(kitchen pos) : EatInOrderRestController 테스트 코드 추가
suzhanlee Feb 20, 2025
92d2382
style(kitchen pos) : import 문 최적화 및 정렬
suzhanlee Feb 20, 2025
1dfe6e9
refactor(kitchen pos) : EatInOrder, OrderTable id 생성자 내에서 자동 생성하도록 숨기기
suzhanlee Feb 24, 2025
4c445d3
style(kitchen pos) : import 문 최적화 및 정렬
suzhanlee Feb 24, 2025
4848d6b
refactor(kitchen pos) : EatInOrderRestController create 메소드 dto 적용
suzhanlee Feb 24, 2025
70db9d0
refactor(kitchen pos) : EatInOrderRestController create 제외 나머지 메소드 dt…
suzhanlee Feb 25, 2025
c396258
refactor(kitchen pos) : OrderTableRestController create 메소드 dto를 사용하도…
suzhanlee Feb 25, 2025
dcfc9b3
refactor(kitchen pos) : OrderTableRestController create 제외 나머지 메소드 dt…
suzhanlee Feb 25, 2025
4de1835
refactor(kitchen pos) : service -> application 잘못된 패키지 이동
suzhanlee Feb 25, 2025
3337e96
refactor(kitchen pos) : MenuRestController dto 사용하도록 리팩토링
suzhanlee Feb 25, 2025
70dacec
squash
suzhanlee Feb 19, 2025
f310842
Merge remote-tracking branch 'origin/step4/cqrs' into step4/cqrs
suzhanlee Feb 26, 2025
698a618
fix(kitchen pos) : rebase 오류 해결
suzhanlee Feb 26, 2025
0e27cce
test(kitchen pos) : MenuRestControllerTest findAll test code 작성
suzhanlee Feb 27, 2025
d1b5121
test(kitchen pos) : MenuQueryRepository test code 작성
suzhanlee Feb 27, 2025
f945af5
fix(kitchen pos) : MenuSummary 와 ProductSummary 가 Menu, Product 와 id를…
suzhanlee Feb 27, 2025
5f1b3d0
feat(kitchen pos) : MenuQueryModelSynchronizer 쿼리 모델 동기화 저장소 생성
suzhanlee Feb 27, 2025
24756a7
style(kitchen pos) : import 문 재정리 및 정렬
suzhanlee Feb 27, 2025
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
471 changes: 365 additions & 106 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
kotlin("jvm") version "1.9.23"
kotlin("plugin.spring") version "1.9.23"
kotlin("plugin.jpa") version "1.9.23"
kotlin("kapt") version "1.9.23"
id("org.flywaydb.flyway") version "7.12.0"
}

Expand All @@ -32,6 +33,11 @@ dependencies {
runtimeOnly("com.h2database:h2")
runtimeOnly("com.mysql:mysql-connector-j")
testImplementation("org.springframework.boot:spring-boot-starter-test")

implementation("com.querydsl:querydsl-jpa:5.0.0:jakarta")
kapt("com.querydsl:querydsl-apt:5.0.0:jakarta")
kapt("jakarta.persistence:jakarta.persistence-api")
kapt("jakarta.annotation:jakarta.annotation-api")
}

tasks.withType<KotlinCompile> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kitchenpos.products.infra;
package kitchenpos.common.application;

public interface PurgomalumClient {
boolean containsProfanity(String text);
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/kitchenpos/common/config/QuerydslConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package kitchenpos.common.config;

import com.querydsl.jpa.impl.JPAQueryFactory;
import jakarta.persistence.EntityManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class QuerydslConfig {

private final EntityManager entityManager;

public QuerydslConfig(EntityManager entityManager) {
this.entityManager = entityManager;
}

@Bean
public JPAQueryFactory jpaQueryFactory() {
return new JPAQueryFactory(entityManager);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package kitchenpos.common.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class GlobalExceptionHandler {

@ExceptionHandler(IllegalArgumentException.class)
public ResponseEntity<String> handleIllegalArgument(IllegalArgumentException e) {
return ResponseEntity.badRequest().body(e.getMessage());
}

@ExceptionHandler(IllegalStateException.class)
public ResponseEntity<String> handleIllegalState(IllegalStateException e) {
return ResponseEntity.badRequest().body(e.getMessage());
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package kitchenpos.products.infra;
package kitchenpos.common.infra.external;

import java.net.URI;
import kitchenpos.common.application.PurgomalumClient;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;

import java.net.URI;

@Component
public class DefaultPurgomalumClient implements PurgomalumClient {
private final RestTemplate restTemplate;
Expand All @@ -18,9 +18,9 @@ public DefaultPurgomalumClient(final RestTemplateBuilder restTemplateBuilder) {
@Override
public boolean containsProfanity(final String text) {
final URI url = UriComponentsBuilder.fromUriString("https://www.purgomalum.com/service/containsprofanity")
.queryParam("text", text)
.build()
.toUri();
.queryParam("text", text)
.build()
.toUri();
return Boolean.parseBoolean(restTemplate.getForObject(url, String.class));
}
}

This file was deleted.

85 changes: 0 additions & 85 deletions src/main/java/kitchenpos/eatinorders/domain/OrderLineItem.java

This file was deleted.

60 changes: 0 additions & 60 deletions src/main/java/kitchenpos/eatinorders/domain/OrderTable.java

This file was deleted.

This file was deleted.

Loading