Skip to content

feat: WorkerDocument-Task 연결 및 taskId 필터 지원 - #87

Merged
chaeliki merged 6 commits into
mainfrom
feat/60-worker-document-task-link
Aug 5, 2026
Merged

feat: WorkerDocument-Task 연결 및 taskId 필터 지원#87
chaeliki merged 6 commits into
mainfrom
feat/60-worker-document-task-link

Conversation

@chaeliki

@chaeliki chaeliki commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

왜 필요한가요?

Closes #60

taskId 누락 이슈로, WorkerDocument 도메인 자체에 taskId 필드가 없어 근로자 서류를 특정 업무카드와 연결해 조회하는 기능을 추가합니다.

완료된 범위

  • WorkerDocument에 taskId 필드 추가 (도메인, Entity, Command, Request, Controller, Service)
  • Migration V15: worker_document.task_id 컬럼 + FK(task_id, company_id) + 인덱스
  • GET /documents에 taskId 필터 지원 + 실제 검증 통합 테스트 추가

결정 사항

검증

  • ./gradlew clean test 전체 통과
  • taskId 필터 정상 동작: 같은 근로자의 문서 중 taskId 있는 것만 필터링되는지 통합 테스트로 검증(listDocumentsFiltersByTaskId)

알려진 이슈 (후속 조치)

  • V15의 (task_id, company_id) FK만으로는 같은 사업장 내 다른 근로자의 Task를
    WorkerDocument에 연결하는 것을 막지 못함 -> krestar님이 chore: Worker Link tenant 무결성과 PostgreSQL RLS 보강 #90(V16)에서
    (task_id, worker_id, company_id) 복합 FK로 보강 예정
  • DemoWorkerDocumentSeeder의 taskId가 merge 충돌 해결 과정에서 임시로 null
    처리됨 -> hywznn님이 #88에서 실제 Task 연결로 수정 완료

@chaeliki
chaeliki requested a review from krestar August 5, 2026 02:18

@krestar krestar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

현재 운영 DB와 운영 트래픽이 없고, 후속 V16이 최초 배포 전에 함께 적용될 예정이므로 이 PR은 승인하겠습니다.

다만 현재 V15의 (task_id, company_id) FK만으로는 같은 사업장 내에서 다른 근로자의 Task를 WorkerDocument에 연결할 수 있습니다. 이 부분은 제가 진행 중인 V16 tenant 무결성 보강에서 다음과 같이 처리하겠습니다.

task(task_id, worker_id, company_id) 복합 UNIQUE 추가
worker_document(task_id, worker_id, company_id) 복합 FK로 교체
등록 시 Task 존재 여부와 Task–Worker 일치 검증
동일 사업장 다른 근로자, 타 사업장, 존재하지 않는 Task 연결 거부 테스트

@chaeliki
chaeliki merged commit a85c637 into main Aug 5, 2026
4 checks passed
@chaeliki
chaeliki deleted the feat/60-worker-document-task-link branch August 5, 2026 02:31
seed.documentId(),
seed.workerId(),
context.companyId(),
null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

taskId 부분은 현재 null인 이유가 있을까요

@chaeliki chaeliki Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

제가 섣불리 건드는 것 보다, 그 부분 체크 하고 싶어서 krestat 리뷰 요청드린건데 demo 머지 충돌 해결하면서 맞춘 임시 처리입니다!
따로 말씀드렸고 확인 픽스 주신다고 하셨습니다. 원래 본문에 추가했어야 했는데 리뷰 포인트로// 확인해주셔서 감사해욥!!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Worker] WorkerDocument-Task 연결 (누락 범위 추가)

3 participants