Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class Education {
@Column(nullable = false, length = 25)
private GraduationType graduationType;

@Column(nullable = false, length = 10)
private String studentNumber;

@Column(nullable = false, length = 4)
private String graduationYear;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ public class EducationRequest {
@NotNull(message = "필수값입니다.")
private GraduationType graduationType;

@NotBlank(message = "필수값입니다.")
@Size(max = 10, message = "10자 이하여야합니다.")
private String studentNumber;

@NotBlank(message = "필수값입니다.")
@Size(min = 4, max = 4, message = "4자여야 합니다.")
private String graduationYear;
Expand Down Expand Up @@ -56,6 +60,7 @@ public class EducationRequest {
public Education toValue() {
return new Education(
graduationType,
studentNumber,
graduationYear,
new School(
schoolName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
public class EducationResponse {

private GraduationType graduationType;
private String studentNumber;
private String graduationYear;
private String schoolName;
private String schoolLocation;
Expand All @@ -21,6 +22,7 @@ public class EducationResponse {

public EducationResponse(Education education) {
this.graduationType = education.getGraduationType();
this.studentNumber = education.getStudentNumber();
this.graduationYear = education.getGraduationYear();
this.schoolName = education.getSchool().getName();
this.schoolLocation = education.getSchool().getLocation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ class FormControllerTest extends RestDocsTestSupport {
fieldWithPath("education.graduationType")
.type(JsonFieldType.STRING)
.description("<<graduation-type,졸업 유형>>"),
fieldWithPath("education.studentNumber")
.type(JsonFieldType.STRING)
.description("학번(예 : 20303), (검정고시일 경우 '검정고시', 외국고등학교일 경우 '기타')"),
fieldWithPath("education.graduationYear")
.type(JsonFieldType.STRING)
.description("졸업 연도, 합격 연도"),
Expand Down Expand Up @@ -754,6 +757,9 @@ class FormControllerTest extends RestDocsTestSupport {
fieldWithPath("education.graduationType")
.type(JsonFieldType.STRING)
.description("<<graduation-type,졸업 유형>>"),
fieldWithPath("education.studentNumber")
.type(JsonFieldType.STRING)
.description("학번(예 : 20303), (검정고시일 경우 '검정고시', 외국고등학교일 경우 '기타')"),
fieldWithPath("education.graduationYear")
.type(JsonFieldType.STRING)
.description("졸업 연도"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static Form createForm(FormType type) {
),
new Education(
GraduationType.EXPECTED,
"20309",
"2021",
new School("비전중학교", "경기도", "경기도 비전시 비전구 비전로 1", "7631003"),
new Teacher("나교사", new PhoneNumber("0519701234"), new PhoneNumber("01012344321"))
Expand Down Expand Up @@ -104,6 +105,7 @@ public static Form createMaleForm(FormType type) {
),
new Education(
GraduationType.EXPECTED,
"20309",
"2021",
new School("비전중학교", "경기도", "경기도 비전시 비전구 비전로 1", "7631003"),
new Teacher("나교사", new PhoneNumber("0519701234"), new PhoneNumber("01012344321"))
Expand Down Expand Up @@ -169,6 +171,7 @@ public static Form createRandomBusanForm(User user) {
),
new Education(
GraduationType.EXPECTED,
"20309",
"2021",
new School("부산중학교", "부산광역시", "부산광역시 동구 초량로40번길 29", "7631003"),
new Teacher("나교사", new PhoneNumber("0519701234"), new PhoneNumber("01012344321"))
Expand Down Expand Up @@ -246,6 +249,7 @@ public static Form createRandomOtherRegionForm(User user) {
),
new Education(
GraduationType.EXPECTED,
"20309",
"2021",
new School("비전중학교", "경기도","경기도 비전시 비전구 비전로 1", "7631003"),
new Teacher("나교사", new PhoneNumber("0519701234"), new PhoneNumber("01012344321"))
Expand Down Expand Up @@ -323,6 +327,7 @@ public static Form createRandomQualificationExaminationForm(User user) {
),
new Education(
GraduationType.QUALIFICATION_EXAMINATION,
"검정고시",
"2021",
new School(null, null, null, null),
new Teacher(null, null, null)
Expand Down Expand Up @@ -390,6 +395,7 @@ public static Form createQualificationExaminationForm(FormType type) {
),
new Education(
GraduationType.QUALIFICATION_EXAMINATION,
"검정고시",
"2021",
null,
null
Expand Down Expand Up @@ -426,6 +432,7 @@ public static SubmitFormRequest createFormRequest(FormType type) {
createParentRequest(),
new EducationRequest(
GraduationType.EXPECTED,
"20309",
"2021",
"비전중학교",
"경기도",
Expand Down Expand Up @@ -468,6 +475,7 @@ public static SubmitFormRequest createQualificationExaminationFormRequest(FormTy
createParentRequest(),
new EducationRequest(
GraduationType.QUALIFICATION_EXAMINATION,
"검정고시",
"2021",
null,
null,
Expand Down Expand Up @@ -504,6 +512,7 @@ public static UpdateFormRequest createUpdateFormRequest(FormType type) {
createParentRequest(),
new EducationRequest(
GraduationType.EXPECTED,
"20309",
"2021",
"비전중학교",
"경기도",
Expand Down Expand Up @@ -561,6 +570,7 @@ public static FormResponse createFormResponse() {
),
new EducationResponse(
GraduationType.EXPECTED,
"20309",
"2021",
"비전중학교",
"경기도",
Expand Down
Loading