diff --git a/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java b/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java index 03789ff73..b1a4de421 100644 --- a/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java +++ b/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java @@ -87,7 +87,8 @@ class EventApiTest extends MockMvcTestHelper { fieldWithPath("type").type(JsonFieldType.STRING) .description("event의 타입"), fieldWithPath("imageUrls[]").description("이미지 URL들").optional(), - fieldWithPath("organization").description("행사기관") + fieldWithPath("organization").description("행사기관"), + fieldWithPath("paymentType").description("유무료 여부(유료,무료,유무료)") ); @Test @@ -102,7 +103,7 @@ void findEvent() throws Exception { "UPCOMING", "ENDED", List.of("코틀린", "백엔드", "안드로이드"), "https://www.image.com", 2, -12, EventType.COMPETITION.toString(), - List.of("imageUrl1", "imageUrl2"), "인프런"); + List.of("imageUrl1", "imageUrl2"), "인프런", "유료"); Mockito.when(eventService.findEvent(ArgumentMatchers.anyLong(), any())) .thenReturn(eventDetailResponse); @@ -211,7 +212,7 @@ void updateEventTest() throws Exception { request.getApplyStartDateTime(), request.getApplyEndDateTime(), request.getLocation(), EventStatus.IN_PROGRESS.name(), EventStatus.ENDED.name(), tags.stream().map(TagRequest::getName).collect(Collectors.toList()), request.getImageUrl(), - 10, 10, request.getType().toString(), Collections.emptyList(), "행사기관"); + 10, 10, request.getType().toString(), Collections.emptyList(), "행사기관", "유료"); Mockito.when(eventService.updateEvent(any(), any(), any())).thenReturn(response); @@ -299,7 +300,7 @@ void addEventTest() throws Exception { request.getLocation(), EventStatus.IN_PROGRESS.name(), EventStatus.ENDED.name(), tags.stream().map(TagRequest::getName).collect(Collectors.toList()), request.getImageUrl(), 10, 10, request.getType().toString(), - List.of("imageUrl1", "imageUrl2"), "행사기관"); + List.of("imageUrl1", "imageUrl2"), "행사기관", "무료"); Mockito.when(eventService.addEvent(any(), any())) .thenReturn(response); diff --git a/backend/emm-sale/src/main/java/com/emmsale/event/application/dto/EventDetailResponse.java b/backend/emm-sale/src/main/java/com/emmsale/event/application/dto/EventDetailResponse.java index a4a8051fb..10bcb7728 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event/application/dto/EventDetailResponse.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event/application/dto/EventDetailResponse.java @@ -39,6 +39,7 @@ public class EventDetailResponse { private final String type; private final List imageUrls; private final String organization; + private final String paymentType; public static EventDetailResponse from( final Event event, @@ -67,7 +68,8 @@ public static EventDetailResponse from( event.getEventPeriod().calculateApplyRemainingDays(today), event.getType().toString(), imageUrls, - event.getOrganization() + event.getOrganization(), + event.getPaymentType().getValue() ); } } diff --git a/backend/emm-sale/src/test/java/com/emmsale/event/application/dto/EventDetailResponseTest.java b/backend/emm-sale/src/test/java/com/emmsale/event/application/dto/EventDetailResponseTest.java index 457baa024..132b50fd3 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/event/application/dto/EventDetailResponseTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/event/application/dto/EventDetailResponseTest.java @@ -5,6 +5,7 @@ import com.emmsale.event.EventFixture; import com.emmsale.event.domain.Event; import com.emmsale.event.domain.EventStatus; +import com.emmsale.event.domain.PaymentType; import java.time.LocalDate; import java.util.Collections; import java.util.List; @@ -37,7 +38,8 @@ void createEventDetailResponseTest() { 2, 2, 구름톤.getType().toString(), imageUrls, - 구름톤.getOrganization() + 구름톤.getOrganization(), + PaymentType.FREE_PAID.getValue() ); //when