Skip to content

Commit 81e5e73

Browse files
authored
refactor: 이벤트 설명을 기본 정보로 변경 (#1273)
* refactor: 신청 폼 설명을 행사 설명으로 변경 * refactor: 설명 필드를 기본 정보 도메인 로직으로 이동 * refactor: dto 변경 * refactor: 생성, 수정 서비스 로직 변경 * test: 테스트 생성, 수정 로직 변경
1 parent 729e107 commit 81e5e73

File tree

14 files changed

+35
-28
lines changed

14 files changed

+35
-28
lines changed

src/main/java/com/gdschongik/gdsc/domain/event/application/EventService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public EventCreateResponse createEvent(EventCreateRequest request) {
5353
request.name(),
5454
request.venue(),
5555
request.startAt(),
56+
request.description(),
5657
request.applicationPeriod(),
5758
request.regularRoleOnlyStatus(),
5859
request.mainEventMaxApplicantCount(),
@@ -86,6 +87,7 @@ public void updateEventBasicInfo(Long eventId, EventUpdateBasicInfoRequest reque
8687
request.name(),
8788
request.venue(),
8889
request.startAt(),
90+
request.description(),
8991
request.applicationPeriod(),
9092
request.regularRoleOnlyStatus(),
9193
request.mainEventMaxApplicantCount(),
@@ -105,7 +107,6 @@ public void updateEventFormInfo(Long eventId, EventUpdateFormInfoRequest request
105107

106108
eventDomainService.updateFormInfo(
107109
event,
108-
request.applicationDescription(),
109110
request.afterPartyStatus(),
110111
request.prePaymentStatus(),
111112
request.postPaymentStatus(),

src/main/java/com/gdschongik/gdsc/domain/event/domain/Event.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public class Event extends BaseEntity {
3939
@Column(name = "start_at")
4040
private LocalDateTime startAt;
4141

42-
@Comment("[메타] 행사 신청 폼 설명")
42+
@Comment("[메타] 행사 설명")
4343
@Column(columnDefinition = "TEXT")
44-
private String applicationDescription;
44+
private String description;
4545

4646
@Comment("행사 신청 기간")
4747
@Embedded
@@ -93,7 +93,7 @@ private Event(
9393
String name,
9494
String venue,
9595
LocalDateTime startAt,
96-
String applicationDescription,
96+
String description,
9797
Period applicationPeriod,
9898
UsageStatus regularRoleOnlyStatus,
9999
UsageStatus afterPartyStatus,
@@ -106,7 +106,7 @@ private Event(
106106
this.name = name;
107107
this.venue = venue;
108108
this.startAt = startAt;
109-
this.applicationDescription = applicationDescription;
109+
this.description = description;
110110
this.applicationPeriod = applicationPeriod;
111111
this.regularRoleOnlyStatus = regularRoleOnlyStatus;
112112
this.afterPartyStatus = afterPartyStatus;
@@ -123,6 +123,7 @@ public static Event create(
123123
String name,
124124
String venue,
125125
LocalDateTime startAt,
126+
String description,
126127
Period applicationPeriod,
127128
UsageStatus regularRoleOnlyStatus,
128129
Integer mainEventMaxApplicantCount,
@@ -132,7 +133,7 @@ public static Event create(
132133
.name(name)
133134
.venue(venue)
134135
.startAt(startAt)
135-
.applicationDescription(null)
136+
.description(description)
136137
.applicationPeriod(applicationPeriod)
137138
.regularRoleOnlyStatus(regularRoleOnlyStatus)
138139
.afterPartyStatus(ENABLED)
@@ -162,13 +163,15 @@ public void updateBasicInfo(
162163
String name,
163164
String venue,
164165
LocalDateTime startAt,
166+
String description,
165167
Period applicationPeriod,
166168
UsageStatus regularRoleOnlyStatus,
167169
Integer mainEventMaxApplicantCount,
168170
Integer afterPartyMaxApplicantCount) {
169171
this.name = name;
170172
this.venue = venue;
171173
this.startAt = startAt;
174+
this.description = description;
172175
this.applicationPeriod = applicationPeriod;
173176
this.regularRoleOnlyStatus = regularRoleOnlyStatus;
174177
this.mainEventMaxApplicantCount = mainEventMaxApplicantCount;
@@ -181,15 +184,13 @@ public void updateBasicInfo(
181184
* @see EventDomainService
182185
*/
183186
public void updateFormInfo(
184-
String applicationDescription,
185187
UsageStatus afterPartyStatus,
186188
UsageStatus prePaymentStatus,
187189
UsageStatus postPaymentStatus,
188190
UsageStatus rsvpQuestionStatus,
189191
UsageStatus noticeConfirmQuestionStatus) {
190192
validatePaymentStatus(afterPartyStatus, prePaymentStatus, postPaymentStatus);
191193

192-
this.applicationDescription = applicationDescription;
193194
this.afterPartyStatus = afterPartyStatus;
194195
this.prePaymentStatus = prePaymentStatus;
195196
this.postPaymentStatus = postPaymentStatus;

src/main/java/com/gdschongik/gdsc/domain/event/domain/service/EventDomainService.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public void updateBasicInfo(
2626
String name,
2727
String venue,
2828
LocalDateTime startAt,
29+
String description,
2930
Period applicationPeriod,
3031
UsageStatus regularRoleOnlyStatus,
3132
@Nullable Integer mainEventMaxApplicantCount,
@@ -44,6 +45,7 @@ public void updateBasicInfo(
4445
name,
4546
venue,
4647
startAt,
48+
description,
4749
applicationPeriod,
4850
regularRoleOnlyStatus,
4951
mainEventMaxApplicantCount,
@@ -79,7 +81,6 @@ private void validateAlreadyExistsEventParticipation(boolean eventParticipationE
7981
*/
8082
public void updateFormInfo(
8183
Event event,
82-
String applicationDescription,
8384
UsageStatus afterPartyStatus,
8485
UsageStatus prePaymentStatus,
8586
UsageStatus postPaymentStatus,
@@ -89,11 +90,6 @@ public void updateFormInfo(
8990
validateAlreadyExistsEventParticipation(eventParticipationExists);
9091

9192
event.updateFormInfo(
92-
applicationDescription,
93-
afterPartyStatus,
94-
prePaymentStatus,
95-
postPaymentStatus,
96-
rsvpQuestionStatus,
97-
noticeConfirmQuestionStatus);
93+
afterPartyStatus, prePaymentStatus, postPaymentStatus, rsvpQuestionStatus, noticeConfirmQuestionStatus);
9894
}
9995
}

src/main/java/com/gdschongik/gdsc/domain/event/dto/dto/EventDto.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static EventDto from(Event event) {
2727
event.getName(),
2828
event.getVenue(),
2929
event.getStartAt(),
30-
event.getApplicationDescription(),
30+
event.getDescription(),
3131
event.getApplicationPeriod(),
3232
event.getRegularRoleOnlyStatus(),
3333
event.getAfterPartyStatus(),

src/main/java/com/gdschongik/gdsc/domain/event/dto/request/EventCreateRequest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public record EventCreateRequest(
1212
@NotBlank String name,
1313
String venue,
1414
@NotNull LocalDateTime startAt,
15+
String description,
1516
@NotNull Period applicationPeriod,
1617
@NotNull UsageStatus regularRoleOnlyStatus,
1718
@Positive @Schema(description = "본 행사 최대 신청 가능 인원. 제한 없음은 null을 입력합니다.") Integer mainEventMaxApplicantCount,

src/main/java/com/gdschongik/gdsc/domain/event/dto/request/EventUpdateBasicInfoRequest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public record EventUpdateBasicInfoRequest(
1111
@NotBlank String name,
1212
String venue,
1313
@NotNull LocalDateTime startAt,
14+
String description,
1415
@NotNull Period applicationPeriod,
1516
@NotNull UsageStatus regularRoleOnlyStatus,
1617
@Positive Integer mainEventMaxApplicantCount,

src/main/java/com/gdschongik/gdsc/domain/event/dto/request/EventUpdateFormInfoRequest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package com.gdschongik.gdsc.domain.event.dto.request;
22

33
import com.gdschongik.gdsc.domain.event.domain.UsageStatus;
4-
import jakarta.validation.constraints.NotBlank;
54
import jakarta.validation.constraints.NotNull;
65

76
public record EventUpdateFormInfoRequest(
8-
@NotBlank String applicationDescription,
97
@NotNull UsageStatus afterPartyStatus,
108
@NotNull UsageStatus prePaymentStatus,
119
@NotNull UsageStatus postPaymentStatus,

src/test/java/com/gdschongik/gdsc/domain/event/application/EventParticipationServiceTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ private Event createAfterPartyDisabledEvent() {
10631063
EVENT_NAME,
10641064
VENUE,
10651065
EVENT_START_AT,
1066+
EVENT_DESCRIPTION,
10661067
EVENT_APPLICATION_PERIOD,
10671068
REGULAR_ROLE_ONLY_STATUS,
10681069
MAIN_EVENT_MAX_APPLICATION_COUNT,
@@ -1077,6 +1078,7 @@ private Event createEvent(String name) {
10771078
name,
10781079
VENUE,
10791080
EVENT_START_AT,
1081+
EVENT_DESCRIPTION,
10801082
EVENT_APPLICATION_PERIOD,
10811083
REGULAR_ROLE_ONLY_STATUS,
10821084
MAIN_EVENT_MAX_APPLICATION_COUNT,

src/test/java/com/gdschongik/gdsc/domain/event/application/EventServiceTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import static org.assertj.core.api.Assertions.*;
66

77
import com.gdschongik.gdsc.domain.event.domain.Event;
8+
import com.gdschongik.gdsc.domain.event.domain.UsageStatus;
89
import com.gdschongik.gdsc.domain.event.dto.request.EventCreateRequest;
910
import com.gdschongik.gdsc.domain.event.dto.request.EventUpdateBasicInfoRequest;
1011
import com.gdschongik.gdsc.domain.event.dto.request.EventUpdateFormInfoRequest;
@@ -29,6 +30,7 @@ class 이벤트_생성시 {
2930
EVENT_NAME,
3031
VENUE,
3132
EVENT_START_AT,
33+
EVENT_DESCRIPTION,
3234
EVENT_APPLICATION_PERIOD,
3335
REGULAR_ROLE_ONLY_STATUS,
3436
MAIN_EVENT_MAX_APPLICATION_COUNT,
@@ -50,6 +52,7 @@ class 이벤트_기본_정보_수정시 {
5052
EVENT_NAME,
5153
VENUE,
5254
EVENT_START_AT,
55+
EVENT_DESCRIPTION,
5356
EVENT_APPLICATION_PERIOD,
5457
REGULAR_ROLE_ONLY_STATUS,
5558
MAIN_EVENT_MAX_APPLICATION_COUNT,
@@ -72,6 +75,7 @@ class 이벤트_기본_정보_수정시 {
7275
updatedName,
7376
VENUE,
7477
EVENT_START_AT,
78+
EVENT_DESCRIPTION,
7579
EVENT_APPLICATION_PERIOD,
7680
REGULAR_ROLE_ONLY_STATUS,
7781
MAIN_EVENT_MAX_APPLICATION_COUNT,
@@ -93,7 +97,6 @@ class 이벤트_폼_정보_수정시 {
9397
// given
9498
Long invalidId = 999L;
9599
var request = new EventUpdateFormInfoRequest(
96-
APPLICATION_DESCRIPTION,
97100
AFTER_PARTY_STATUS,
98101
PRE_PAYMENT_STATUS,
99102
POST_PAYMENT_STATUS,
@@ -112,21 +115,20 @@ class 이벤트_폼_정보_수정시 {
112115
Event event = createEvent();
113116
Long eventId = event.getId();
114117

115-
String updatedApplicationDescription = "수정된 행사 설명";
118+
UsageStatus updatedRsvpQuestionStatus = UsageStatus.ENABLED;
116119
var request = new EventUpdateFormInfoRequest(
117-
updatedApplicationDescription,
118120
AFTER_PARTY_STATUS,
119121
PRE_PAYMENT_STATUS,
120122
POST_PAYMENT_STATUS,
121-
RSVP_QUESTION_STATUS,
123+
updatedRsvpQuestionStatus,
122124
NOTICE_CONFIRM_QUESTION_STATUS);
123125

124126
// when
125127
eventService.updateEventFormInfo(eventId, request);
126128

127129
// then
128-
assertThat(eventRepository.findById(eventId).get().getApplicationDescription())
129-
.isEqualTo(updatedApplicationDescription);
130+
assertThat(eventRepository.findById(eventId).get().getRsvpQuestionStatus())
131+
.isEqualTo(updatedRsvpQuestionStatus);
130132
}
131133
}
132134
}

src/test/java/com/gdschongik/gdsc/domain/event/domain/EventDomainServiceTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class 이벤트_기본정보를_수정할_때 {
3333
EVENT_NAME,
3434
VENUE,
3535
EVENT_START_AT,
36+
EVENT_DESCRIPTION,
3637
EVENT_APPLICATION_PERIOD,
3738
newRegularRoleOnlyStatus,
3839
null,
@@ -59,6 +60,7 @@ class 이벤트_기본정보를_수정할_때 {
5960
EVENT_NAME,
6061
VENUE,
6162
EVENT_START_AT,
63+
EVENT_DESCRIPTION,
6264
EVENT_APPLICATION_PERIOD,
6365
REGULAR_ROLE_ONLY_STATUS,
6466
newMainEventMaxApplicantCount,
@@ -86,6 +88,7 @@ class 이벤트_기본정보를_수정할_때 {
8688
EVENT_NAME,
8789
VENUE,
8890
EVENT_START_AT,
91+
EVENT_DESCRIPTION,
8992
EVENT_APPLICATION_PERIOD,
9093
REGULAR_ROLE_ONLY_STATUS,
9194
newMainEventMaxApplicantCount,
@@ -113,6 +116,7 @@ class 이벤트_기본정보를_수정할_때 {
113116
EVENT_NAME,
114117
VENUE,
115118
EVENT_START_AT,
119+
EVENT_DESCRIPTION,
116120
EVENT_APPLICATION_PERIOD,
117121
REGULAR_ROLE_ONLY_STATUS,
118122
newMainEventMaxApplicantCount,
@@ -136,7 +140,6 @@ class 이벤트_폼_정보를_수정할_때 {
136140
// when & then
137141
assertThatThrownBy(() -> eventDomainService.updateFormInfo(
138142
event,
139-
APPLICATION_DESCRIPTION,
140143
AFTER_PARTY_STATUS,
141144
PRE_PAYMENT_STATUS,
142145
POST_PAYMENT_STATUS,

0 commit comments

Comments
 (0)