Skip to content

[Feat] 임시저장 API 구현 (#23)#40

Merged
whc9999 merged 1 commit into
mainfrom
feat/applicationdraft
May 12, 2026
Merged

[Feat] 임시저장 API 구현 (#23)#40
whc9999 merged 1 commit into
mainfrom
feat/applicationdraft

Conversation

@whc9999
Copy link
Copy Markdown
Collaborator

@whc9999 whc9999 commented May 12, 2026

✨ 어떤 이유로 PR를 하셨나요?

  • feature 병합
  • 버그 수정(아래에 issue #를 남겨주세요)
  • 코드 개선
  • 코드 수정
  • 배포
  • 기타(아래에 자세한 내용 기입해주세요)

📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요

  • 지원 플로우 작성 상태를 저장하기 위한 ApplicationDraft 엔티티 추가
  • 작성 단계 관리를 위한 ApplicationDraftStep enum 추가
  • 기존 ApplyType을 재사용하여 실제 공고/가상 공고 지원 유형 저장
  • 로그인 사용자 기준 임시저장 생성 및 수정 API 구현
  • 로그인 사용자 기준 최근 임시저장 조회 API 구현
  • 로그인 사용자 기준 임시저장 삭제 API 구현
  • 사용자당 임시저장 1건만 유지되도록 user_id unique 제약 및 upsert 로직 적용
  • selectedQuestionIds를 ElementCollection으로 저장하고 null 요청 시 빈 리스트로 처리
  • 기존 공통 응답 포맷(ApiResponse)과 인증 사용자 조회 방식 준수
  • 임시저장 생성, 수정, 삭제 서비스 테스트 추가

📸 작업 화면 스크린샷

⚠️ PR하기 전에 확인해주세요

  • 로컬테스트를 진행하셨나요?
  • 머지할 브랜치를 확인하셨나요?
  • 관련 label을 선택하셨나요?

🚨 관련 이슈 번호 [#23 ]

- 지원 플로우 작성 상태를 저장하기 위한 ApplicationDraft 엔티티 추가
- 작성 단계 관리를 위한 ApplicationDraftStep enum 추가
- 기존 ApplyType을 재사용하여 실제 공고/가상 공고 지원 유형 저장
- 로그인 사용자 기준 임시저장 생성 및 수정 API 구현
- 로그인 사용자 기준 최근 임시저장 조회 API 구현
- 로그인 사용자 기준 임시저장 삭제 API 구현
- 사용자당 임시저장 1건만 유지되도록 user_id unique 제약 및 upsert 로직 적용
- selectedQuestionIds를 ElementCollection으로 저장하고 null 요청 시 빈 리스트로 처리
- 기존 공통 응답 포맷(ApiResponse)과 인증 사용자 조회 방식 준수
- 임시저장 생성, 수정, 삭제 서비스 테스트 추가
@whc9999 whc9999 requested a review from shinae1023 May 12, 2026 11:40
@whc9999 whc9999 self-assigned this May 12, 2026
@whc9999 whc9999 added the ✨ feat New feature or request label May 12, 2026
@whc9999 whc9999 merged commit bd37505 into main May 12, 2026
2 checks passed
summary = "내 임시저장 생성/수정",
description = "로그인한 사용자의 지원 플로우 임시저장을 생성하거나 수정합니다. 사용자당 최근 임시저장 1개만 유지합니다."
)
@PutMapping("/me")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

임시저장 자체가 이미 개인화된거니까 굳이 url에 me를 쓸 필요 없을거 같기도,,,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me 넣는게 더 명확할 것 같긴 했는데.. 걍 짧게 ㄱㄱ 할게

return ApiResponse.onSuccess("임시저장이 삭제되었습니다.");
}

private User getCurrentUser(UserDetailsImpl userDetails) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 아까 리뷰 단거랑 마찬가지

@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder(access = AccessLevel.PRIVATE)
@Table(name = "application_drafts")
public class ApplicationDraft {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApplicationDraft가 step을 세분화해서 상태를 저장하고 있는데 현재 draft에서 실제 MockApply로 전환되는 흐름이 없는거 같은데 그러면 사실상 임시 수정값 저장 용도로만 쓰이는 거인듯..? draft 테이블을 두기보다 MockApply에 status enum을 두고 지원 공고 추출/지원서 생성 -> 질문 선택 -> 답변 작성 -> 완료 정도의 큰 단계만 관리하는 쪽이 더 나을듯

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

처음에는 최종 제출 전까지 mockapply를 안 만드는 구조를 생각해서 임시저장 테이블을 나눌라 했는데, #43 에서 문항 선택 단계 진입 전에 mockapply를 먼저 생성하고 mockApplyId 기준으로 이어지는 구조가 됐으니 너 말대로 enum을 두고 관리하는게 좋을듯

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

회의록에서도 물어볼라카는거 같으니 답변 미리 준비해놓을게

@whc9999
Copy link
Copy Markdown
Collaborator Author

whc9999 commented May 13, 2026

@shinae1023
리뷰 반영했습니다.
ApplicationDraft 별도 테이블/API는 제거하고, MockApply에 status enum을 추가해 지원 생성 이후 플로우를 MockApply 기준으로 관리하도록 수정했습니다.
이후 문항 선택/답변 작성/완료 단계는 mockApplyId와 status를 기준으로 이어가겠습니다.

whc9999 added a commit that referenced this pull request May 13, 2026
…-draft

[Refactor] 임시저장 구조를 MockApply 상태 관리로 변경 (#23, #40)
@shinae1023
Copy link
Copy Markdown
Member

@shinae1023

리뷰 반영했습니다.

ApplicationDraft 별도 테이블/API는 제거하고, MockApply에 status enum을 추가해 지원 생성 이후 플로우를 MockApply 기준으로 관리하도록 수정했습니다.

이후 문항 선택/답변 작성/완료 단계는 mockApplyId와 status를 기준으로 이어가겠습니다.

우혁피티 뭔데~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants