Skip to content

[#64] [Feat]DocumentVersion 삭제 권한 검사 및 DB 정리 구현 - #65

Merged
snowballourown merged 4 commits into
feature/62-history-displayfrom
feature/64-db
Nov 19, 2026
Merged

snowballourown merged 4 commits into
feature/62-history-displayfrom
feature/64-db

Conversation

@snowballourown

Copy link
Copy Markdown
Collaborator

작업 목적

워크스페이스에 소속된 업로더가 선택한 DocumentVersion을 삭제할 수 있도록 한다.

선택한 DocumentVersion의 관련 DB 데이터를 함께 삭제하고,
원본 Word와 변환 PDF의 S3 삭제를 위한 S3ObjectDeletionTask를 저장한다.

작업 내용

  • 로그인한 회원의 워크스페이스 소속 및 DocumentVersion 업로더 확인
  • 요청한 workspaceId·documentId·documentVersionId의 소속 관계 확인
  • PROCESSING 상태의 DocumentConversionJob이 있으면 삭제 거부
  • 선택한 DocumentVersion과 연결된 DB 데이터 삭제
    • DocumentFeedback
    • DocumentConversionJob
    • DocumentUpload
    • 원본·PDF의 StoreFile
  • 원본·PDF 저장 키를 S3ObjectDeletionTask에 저장
  • DB 삭제와 S3ObjectDeletionTask 저장을 하나의 트랜잭션으로 처리
  • 다른 DocumentVersion과 Document 유지
  • Document.revision을 유지하여 삭제한 버전 번호의 재사용 방지
  • S3ObjectDeleter 및 관련 테스트 추가

완료 기준

  • 워크스페이스에 소속된 업로더만 삭제할 수 있다.
  • 다른 업로더와 비멤버의 요청은 403으로 거부된다.
  • 존재하지 않거나 요청한 Document에 속하지 않는 버전은 404로 응답한다.
  • 변환 중이거나 파일 연결이 일치하지 않으면 409로 응답한다.
  • 관련 DB 데이터 삭제 또는 S3ObjectDeletionTask 저장이 실패하면 전체 롤백된다.
  • 다른 버전의 파일과 피드백은 유지된다.
  • 마지막 버전을 삭제해도 Document는 유지된다.
  • V3 삭제 후 새 버전을 등록하면 V4가 발급된다.
  • 동시 삭제 요청으로 S3ObjectDeletionTask가 중복 생성되지 않는다.

검증

  • 삭제 통합 테스트 23개 통과
  • 기존 업로드 완료·PDF 변환 및 S3 삭제 단위 테스트를 포함해 총 66개 통과
  • 별도 임시 MySQL DB와 모의 S3Client 사용

후속 작업

이번 범위에는 실제 S3 삭제 작업 실행, 삭제 API 및 화면 연결을 포함하지 않는다.

  • S3ObjectDeletionTask 처리 스케줄러 및 실패 재시도
  • DocumentVersion 삭제 API
  • 삭제 후 남은 최신 버전 조회
  • 버전 히스토리 삭제 버튼 및 목록 갱신

@snowballourown
snowballourown added this pull request to stack #48 November 18, 2026 14:30
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7fec7aec-ed07-4726-928b-6fac8a763e49

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@snowballourown snowballourown self-assigned this Nov 18, 2026
@sonarqubecloud

Copy link
Copy Markdown

@snowballourown
snowballourown merged commit bd77a55 into feature/42 Nov 19, 2026
3 checks passed
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.

1 participant