feat: 통합 문서함·파일 업로드·문서 준비도 구현 - #57
Merged
Merged
Conversation
10 tasks
chaeliki
force-pushed
the
feat/13-document-hub
branch
from
July 27, 2026 07:30
c01079e to
07a40c4
Compare
chaeliki
force-pushed
the
feat/13-document-hub
branch
from
July 28, 2026 16:58
67de36b to
5a64b0c
Compare
chaeliki
marked this pull request as ready for review
July 28, 2026 17:03
10 tasks
Contributor
|
금일 오전 중으로 확인해보겠습니다 |
hywznn
reviewed
Jul 29, 2026
hywznn
approved these changes
Jul 29, 2026
22 tasks
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
왜 필요한가요?
#13(통합 문서함·파일 업로드·문서 준비도)의 4개 API와 감사 로그 연동,
통합 테스트까지 완료했습니다.
Closes #13
완료된 범위
API 4개
POST /files— 파일 업로드 (MIME/크기 검증,scan_statusNOT_SCANNED 고정)GET /documents— 통합 문서함 조회 (근로자 표시 이름 포함)GET /tasks/{taskId}/document-readiness— 서류 준비도 (Task 체크리스트 snapshot 기준)PUT /tasks/{taskId}/document-request-draft— 문서 요청 초안 저장(생성/갱신)패키지
file:StoredFile도메인,FileStorageport +LocalFileStorage/FakeFileStoragedocument:ChecklistItemDocumentMapper(itemCode↔DocumentType),DocumentRequestDraft,통합 조회·준비도·초안 Service 3종
worker 패키지 재수정 (이미 병합된 #5 코드)
WorkerDocument에file_id실제 연결 (tenant 재검증 포함)WorkerRepository에 근로자 배치조회 추가, count 쿼리 정리(리팩토링)감사 로그
AuditEvent기록AuditAction/AuditTargetType에 새 값 추가 (FILE_UPLOADED,WORKER_DOCUMENT_FILE_LINKED,DOCUMENT_REQUEST_DRAFT_SAVED/FILE,WORKER_DOCUMENT,DOCUMENT_REQUEST_DRAFT)존재-검증 감사
(
FileService.upload()의 taskId/workerId,WorkerDocumentService.register()의 workerId,DocumentRequestDraftService.upsert()의 taskId — 전부 존재하지 않는 ID를 넘기면DB 제약 위반으로
500이 나던 것을404로 명확히 처리하도록 수정)통합 테스트
FileSecurityIntegrationTest3개 (업로드 성공+감사로그, MIME 거부, taskId 존재검증)DocumentSecurityIntegrationTest6개 (준비도 missing→available, 준비도 타사업장 404,목록조회+근로자이름, 초안 생성/갱신/버전충돌, 초안 타사업장 404)
결정 사항
scan_status는 검사 인프라가 없어 항상NOT_SCANNED로 고정, 파일 연결은 허용FileService에 TODO)purpose,SubmissionStatus4개 값 확정,WorkerDocument.taskId필터는#60으로 분리
file/document패키지 분리는docs/project-structure.md기준ChecklistItemDocumentMapper는 직접 정의(현재 워크플로우 2개, item_code 6개 반영, 향후 갱신 필요)
발견된 버그 (수정 완료)
LocalFileStorage: 저장 경로가normalize()안 돼서 실제 파일 저장 시 항상 실패DocumentRequestDraftJpaEntity:@Version누락으로 버전이 증가 안 함검증
./gradlew clean test— 전체 통과 (170개)리뷰 포인트
ChecklistItemDocumentMapper의 하드코딩 매핑 방식 (임시, 후속 갱신 필요)