Skip to content

Commit

Permalink
Merge pull request #89 from Bamdoliro/perf/#86
Browse files Browse the repository at this point in the history
[개선] 입학설명회 도메인 수정
  • Loading branch information
jyj1289 authored Jun 12, 2024
2 parents e906600 + 848ace9 commit cb8ba00
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public void execute(CreateFairRequest request) {
.start(request.getStart())
.capacity(request.getCapacity())
.place(request.getPlace())
.applicationUrl(request.getApplicationUrl())
.type(request.getType())
.applicationStartDate(request.getApplicationStartDate())
.applicationEndDate(request.getApplicationEndDate())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public class Fair extends BaseTimeEntity {
@Column(nullable = false, length = 30)
private String place;

@Column(nullable = false)
private String applicationUrl;

@Enumerated(EnumType.STRING)
@Column(nullable = false, length = 20)
private FairType type;
Expand All @@ -54,14 +57,16 @@ public class Fair extends BaseTimeEntity {
@Column(nullable = false)
private LocalDate applicationEndDate;


@OneToMany(mappedBy = "fair", fetch = FetchType.LAZY)
private final List<Attendee> attendeeList = new ArrayList<>();

@Builder
public Fair(LocalDateTime start, Integer capacity, String place, FairType type, LocalDate applicationStartDate, LocalDate applicationEndDate) {
public Fair(LocalDateTime start, Integer capacity, String place, String applicationUrl, FairType type, LocalDate applicationStartDate, LocalDate applicationEndDate) {
this.start = start;
this.capacity = capacity;
this.place = place;
this.applicationUrl = applicationUrl;
this.type = type;
this.applicationStartDate = applicationStartDate == null ? LocalDate.now() : applicationStartDate;
this.applicationEndDate = applicationEndDate == null ? start.minusDays(3).toLocalDate() : applicationEndDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public class CreateFairRequest {
@Size(max = 30, message = "30자 이하여야 합니다.")
private String place;

@NotBlank(message = "필수값입니다.")
private String applicationUrl;

@NotNull(message = "필수값입니다.")
private FairType type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class FairControllerTest extends RestDocsTestSupport {
fieldWithPath("place")
.type(JsonFieldType.STRING)
.description("입학설명회 장소"),
fieldWithPath("applicationUrl")
.type(JsonFieldType.STRING)
.description("입학설명회 신청 폼 링크"),
fieldWithPath("type")
.type(JsonFieldType.STRING)
.description("<<fair-type,입학설명회 유형>>"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static Fair createFair() {
LocalDateTime.of(2025, 4, 15, 10, 39),
120,
"서울시 강남구",
"https://docs.google.com",
FairType.STUDENT_AND_PARENT,
LocalDate.now(),
LocalDate.now().plusDays(3)
Expand All @@ -32,6 +33,7 @@ public static CreateFairRequest createFairRequest() {
LocalDateTime.of(2025, 4, 15, 10, 39),
120,
"서울시 강남구",
"https://docs.google.com",
FairType.STUDENT_AND_PARENT,
LocalDate.now(),
null
Expand All @@ -43,6 +45,7 @@ public static Fair createClosedFair() {
LocalDateTime.of(2005, 4, 15, 10, 39),
120,
"서울시 강남구",
"https://docs.google.com",
FairType.STUDENT_AND_PARENT,
LocalDate.now(),
LocalDate.now().plusDays(3)
Expand Down

0 comments on commit cb8ba00

Please sign in to comment.