From e984ff74c9f57f97928a0f03d2d29f323aa4c0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=A0=EA=B4=80=EA=B7=9C?= Date: Thu, 29 Oct 2026 22:20:18 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=EC=83=81=EC=A0=90=20=EC=98=88?= =?UTF-8?q?=EA=B8=88=EC=A3=BC=20=EC=BB=AC=EB=9F=BC=EA=B3=BC=20V2=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EC=9D=91=EB=8B=B5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../koin/domain/shop/dto/shop/response/ShopResponseV2.java | 4 ++++ .../java/in/koreatech/koin/domain/shop/model/shop/Shop.java | 6 ++++++ .../resources/db/migration/V27__add_shop_account_holder.sql | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 src/main/resources/db/migration/V27__add_shop_account_holder.sql diff --git a/src/main/java/in/koreatech/koin/domain/shop/dto/shop/response/ShopResponseV2.java b/src/main/java/in/koreatech/koin/domain/shop/dto/shop/response/ShopResponseV2.java index 8317be31a1..0424788722 100644 --- a/src/main/java/in/koreatech/koin/domain/shop/dto/shop/response/ShopResponseV2.java +++ b/src/main/java/in/koreatech/koin/domain/shop/dto/shop/response/ShopResponseV2.java @@ -77,6 +77,9 @@ public record ShopResponseV2( @Schema(example = "110-439-1234567", description = "계좌번호", requiredMode = NOT_REQUIRED) String accountNumber, + @Schema(example = "홍길동", description = "예금주", requiredMode = NOT_REQUIRED, nullable = true) + String accountHolder, + @Schema(description = "상점 영업 시작 시간", example = "11:30") @JsonFormat(pattern = "HH:mm") LocalTime openTime, @@ -137,6 +140,7 @@ public static ShopResponseV2 from(Shop shop, LocalDate now) { shop.getEventArticles().stream().anyMatch(events -> events.isEventDuration(now)), shop.getBank(), shop.getAccountNumber(), + shop.getAccountHolder(), openTime, closeTime ); diff --git a/src/main/java/in/koreatech/koin/domain/shop/model/shop/Shop.java b/src/main/java/in/koreatech/koin/domain/shop/model/shop/Shop.java index 6fbdbb1902..0e49e3c6ca 100644 --- a/src/main/java/in/koreatech/koin/domain/shop/model/shop/Shop.java +++ b/src/main/java/in/koreatech/koin/domain/shop/model/shop/Shop.java @@ -162,6 +162,10 @@ public class Shop extends BaseEntity { @Column(name = "account_number", length = 20) private String accountNumber; + @Size(max = 50) + @Column(name = "account_holder", length = 50) + private String accountHolder; + @Column(name = "introduction", columnDefinition = "text") private String introduction; @@ -187,6 +191,7 @@ private Shop( Integer hit, String bank, String accountNumber, + String accountHolder, ShopCategory shopMainCategory, ShopOperation shopOperation ) { @@ -207,6 +212,7 @@ private Shop( this.hit = hit; this.bank = bank; this.accountNumber = accountNumber; + this.accountHolder = accountHolder; this.shopMainCategory = shopMainCategory; this.shopOperation = shopOperation; } diff --git a/src/main/resources/db/migration/V27__add_shop_account_holder.sql b/src/main/resources/db/migration/V27__add_shop_account_holder.sql new file mode 100644 index 0000000000..3566b8825e --- /dev/null +++ b/src/main/resources/db/migration/V27__add_shop_account_holder.sql @@ -0,0 +1,2 @@ +ALTER TABLE `shops` + ADD COLUMN `account_holder` VARCHAR(50) NULL COMMENT '예금주'; From f9403c33917d40bc255b7e2388923131036c48a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=A0=EA=B4=80=EA=B7=9C?= Date: Thu, 29 Oct 2026 22:22:39 +0900 Subject: [PATCH 2/3] =?UTF-8?q?test:=20=EC=83=81=EC=A0=90=20V2=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EC=A1=B0=ED=9A=8C=EC=9D=98=20=EC=98=88=EA=B8=88?= =?UTF-8?q?=EC=A3=BC=20=EC=9D=91=EB=8B=B5=20=EA=B2=80=EC=A6=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../koin/acceptance/domain/ShopApiTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/test/java/in/koreatech/koin/acceptance/domain/ShopApiTest.java b/src/test/java/in/koreatech/koin/acceptance/domain/ShopApiTest.java index 24b4d54c73..02c590d045 100644 --- a/src/test/java/in/koreatech/koin/acceptance/domain/ShopApiTest.java +++ b/src/test/java/in/koreatech/koin/acceptance/domain/ShopApiTest.java @@ -5,6 +5,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.time.LocalDate; @@ -201,6 +202,28 @@ void setUp() { """)); } + @Test + void V2_상점_상세_조회에_예금주를_반환한다() throws Exception { + entityManager.createNativeQuery("UPDATE shops SET account_holder = :accountHolder WHERE id = :id") + .setParameter("accountHolder", "홍길동") + .setParameter("id", 마슬랜.getId()) + .executeUpdate(); + entityManager.clear(); + + mockMvc.perform(get("/v2/shops/{shopId}", 마슬랜.getId())) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.account_holder").value("홍길동")) + .andExpect(jsonPath("$.bank").value("국민")) + .andExpect(jsonPath("$.account_number").value("01022595923")); + } + + @Test + void V2_상점_상세_조회에서_미등록_예금주는_null로_반환한다() throws Exception { + mockMvc.perform(get("/v2/shops/{shopId}", 마슬랜.getId())) + .andExpect(status().isOk()) + .andExpect(content().json("{\"account_holder\": null}")); + } + @Test void 특정_상점_조회() throws Exception { menuCategoryFixture.사이드메뉴(마슬랜); From a89af99c35eb160d652d0ec1d0a95947aa5a0af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=A0=EA=B4=80=EA=B7=9C?= Date: Thu, 29 Oct 2026 22:25:15 +0900 Subject: [PATCH 3/3] =?UTF-8?q?test:=20=EC=83=81=EC=A0=90=20=EC=98=88?= =?UTF-8?q?=EA=B8=88=EC=A3=BC=20=EC=9D=91=EB=8B=B5=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../koin/acceptance/domain/ShopApiTest.java | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/src/test/java/in/koreatech/koin/acceptance/domain/ShopApiTest.java b/src/test/java/in/koreatech/koin/acceptance/domain/ShopApiTest.java index 02c590d045..24b4d54c73 100644 --- a/src/test/java/in/koreatech/koin/acceptance/domain/ShopApiTest.java +++ b/src/test/java/in/koreatech/koin/acceptance/domain/ShopApiTest.java @@ -5,7 +5,6 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.time.LocalDate; @@ -202,28 +201,6 @@ void setUp() { """)); } - @Test - void V2_상점_상세_조회에_예금주를_반환한다() throws Exception { - entityManager.createNativeQuery("UPDATE shops SET account_holder = :accountHolder WHERE id = :id") - .setParameter("accountHolder", "홍길동") - .setParameter("id", 마슬랜.getId()) - .executeUpdate(); - entityManager.clear(); - - mockMvc.perform(get("/v2/shops/{shopId}", 마슬랜.getId())) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.account_holder").value("홍길동")) - .andExpect(jsonPath("$.bank").value("국민")) - .andExpect(jsonPath("$.account_number").value("01022595923")); - } - - @Test - void V2_상점_상세_조회에서_미등록_예금주는_null로_반환한다() throws Exception { - mockMvc.perform(get("/v2/shops/{shopId}", 마슬랜.getId())) - .andExpect(status().isOk()) - .andExpect(content().json("{\"account_holder\": null}")); - } - @Test void 특정_상점_조회() throws Exception { menuCategoryFixture.사이드메뉴(마슬랜);