Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ public void deleteGraduationUser(Long id) {
}

public GraduationUserDetailResponse getGraduationUserById(Long graduationUserId) {
return GraduationUserDetailResponse.from(graduationUserQueryService.getById(graduationUserId));
GraduationUser graduationUser = graduationUserQueryService.getById(graduationUserId);
GraduationUserStatusResponse status = buildSubmissionStatus(graduationUser);
return GraduationUserDetailResponse.from(graduationUser, status);
}

public GraduationUserBatchDeleteResponse deleteGraduationUsers(GraduationUserBatchDeleteRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,28 @@ public record GraduationUserDetailResponse(
String major,

@Schema(description = "캡스톤 이수 여부", example = "true", requiredMode = REQUIRED)
Boolean capstoneCompletion
Boolean capstoneCompletion,

@Schema(
description = "졸업 요건 제출 및 승인 상태 (자격증 또는 논문)",
example = "{"
+ "\"type\": \"THESIS\", "
+ "\"midThesis\": {"
+ "\"submitted\": true, "
+ "\"approval\": true"
+ "}, "
+ "\"finalThesis\": {"
+ "\"submitted\": false, "
+ "\"approval\": false"
+ "}"
+ "}",
requiredMode = REQUIRED
)
GraduationUserStatusResponse status
) {
public static GraduationUserDetailResponse from(
GraduationUser graduationUser
GraduationUser graduationUser,
GraduationUserStatusResponse status
) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
return GraduationUserDetailResponse.builder()
Expand All @@ -45,6 +63,7 @@ public static GraduationUserDetailResponse from(
.advisor(graduationUser.getAdvisorProfessor())
.major(graduationUser.getDepartment())
.capstoneCompletion(graduationUser.getCapstoneCompletion())
.status(status)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public record GraduationUserSummaryResponse(
)
GraduationUserStatusResponse status
) {
public static GraduationUserSummaryResponse of(GraduationUser graduationUser, GraduationUserStatusResponse status) {
public static GraduationUserSummaryResponse of(
GraduationUser graduationUser,
GraduationUserStatusResponse status
) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");

return GraduationUserSummaryResponse.builder()
Expand Down
12 changes: 6 additions & 6 deletions aics-api/src/main/resources/db/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ VALUES ('참여 신청 방법을 자세히 알고 싶습니다.', '2025-03-03 00
('프로젝트 자료를 다운로드했습니다. 유익하네요.', '2025-03-03 07:01:00', '2025-03-03 07:01:00', 8, '202412347'),
('연구 참여 방법이 있나요?', '2025-03-03 07:02:00', '2025-03-03 07:02:00', 8, '202412346');

INSERT INTO graduation_user (name, email, advisor_professor, graduation_type, graduation_date,
INSERT INTO graduation_user (name, email, advisor_professor, graduation_type, graduation_date, capstone_completion,
mid_thesis_id, final_thesis_id, certificate_id, user_id, created_at, updated_at)
VALUES
('김철수', 'chulsoo@kyonggi.ac.kr', '이순신', '논문', '2028-02-28', 1, 2, NULL, '202512345', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
('이영희', 'younghee@kyonggi.ac.kr', '홍길동', '자격증', '2028-08-31', NULL, NULL, 1, '202512346', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
('박민수', 'minsu@kyonggi.ac.kr', '정약용', '논문', '2029-02-28', 3, NULL, NULL, '202512347', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
('정수진', 'sujin@kyonggi.ac.kr', '김이박', '논문', '2030-02-28', 4, 5, NULL, '202512349', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
('최동욱', 'dongwook@kyonggi.ac.kr', '이교수', '자격증', '2027-08-31', NULL, NULL, 2, '202512348', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
('김철수', 'chulsoo@kyonggi.ac.kr', '이순신', '논문', '2028-02-01', true, 1, 2, NULL, '202512345', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
('이영희', 'younghee@kyonggi.ac.kr', '홍길동', '자격증', '2028-08-01', true, NULL, NULL, 1, '202512346', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
('박민수', 'minsu@kyonggi.ac.kr', '정약용', '논문', '2029-02-01', true, 3, NULL, NULL, '202512347', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
('정수진', 'sujin@kyonggi.ac.kr', '김이박', '논문', '2030-02-01', false, 4, 5, NULL, '202512349', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
('최동욱', 'dongwook@kyonggi.ac.kr', '이교수', '자격증', '2027-08-01', false, NULL, NULL, 2, '202512348', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);

-- schedule
INSERT INTO schedule (submission_type, content, start_date, end_date, created_at, updated_at)
Expand Down
1 change: 1 addition & 0 deletions aics-api/src/main/resources/db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ CREATE TABLE graduation_user
CONSTRAINT graduation_type_check
CHECK ((graduation_type)::TEXT = ANY (ARRAY ['THESIS', 'CERTIFICATE'])),
graduation_date DATE,
capstone_completion BOOLEAN,
mid_thesis_id BIGINT,
final_thesis_id BIGINT,
certificate_id BIGINT,
Expand Down