sparta-tigers / sparta-tigers/backend

[REFACTORING] 직관 기록 도메인 전면 재구축

Open
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactor
Dominant language
Java
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

📦 리팩터링 대상

  • 기존 직관 기록(MatchAttendance) 도메인의 단순 CRUD 로직 전체
  • 티켓 OCR API 이미지 업로드 로직
  • 사용하지 않는 구 버전 도메인(Alarm) 완전 삭제 및 패키지 정리

🧠 개선 방향

  • 기존 단순 텍스트 기반의 CRUD를 실제 프론트엔드요구사항에 맞추어 다중 이미지(multipart/form-data) 처리 기반으로 전면 개편.
  • JPA 영속성 컨텍스트(Dirty Checking, Cascade, 고아 객체 삭제)를 적극 활용하여 객체 지향적이고 안전한 상태 관리 구현.
  • 본인 소유의 데이터만 조회 및 수정/삭제가 가능하도록 인가

📝 작업 내역

  • 미사용 Alarm 도메인 관련 패키지 제거
  • 직관 기록 엔티티(MatchAttendance, AttendanceImage) 재설계 및 연관관계 메서드(addImage, clearImages) 구현
  • 직관 기록 생성 API 구현 (@RequestPart로 JSON DTO와 다중 파일 동시 수신)
  • 직관 기록 수정 API 구현 (프론트에서 넘어온 oldImageUrls와 대조하여 기존 이미지 부분 삭제 및 새 이미지 병합 처리)
  • 내 직관 기록 전체 목록 및 단건 상세 조회 API 구현

🔗 관련 항목 (선택)

📌 참고 사항 (선택)

  • 수정 API 호출 시 oldImageUrls에 포함되지 않은 기존 이미지는 DB 및 로컬 스토리지에서 삭제됩니다.
  • 안 쓰는 패키지(기존 alarm) 삭제로 인해 컴파일 에러 발생 시, build clean이 필요할 수 있습니다.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue describes a broad refactor whose checklist is already marked complete. Review the MatchAttendance and AttendanceImage entities and the create/update APIs, including @RequestPart handling and oldImageUrls reconciliation. Run a clean build after the Alarm package removal; done means the listed APIs and ownership checks work without compilation errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, authorization, backend, database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.