Skip to content

Conversation

@dahyun24
Copy link
Contributor

@dahyun24 dahyun24 commented Oct 31, 2025

🔗 연관된 이슈

🚀 변경 유형

  • ✨ 기능 추가 (feature)
  • 🐛 버그 수정 (fix)
  • 📝 문서 변경 (docs)
  • ♻️ 리팩토링 (refactor)
  • 🧪 테스트 추가 / 수정 (test)
  • ⚙️ 설정 변경 (chore)

📝 작업 내용

  • 앨범 초대장 정보에 isExpired 필드 추가
  • UserAlbum 엔티티에 isVisible 필드 추가 (나에게만 삭제 기능을 위해서)
  • 앨범 참여 시 3가지 분기를 joinStatus로 구현
    • 새로운 참여자 NEW : 앨범 정보와 함께 썸네일 이미지 제공
    • 존재하는 참여자 중에 isVisibletrue 인 경우 EXISTING : (추후) 앨범 상세 페이지로 이동
    • 존재하는 참여자 중에 isVisiblefalse 인 경우 RESTORED : isVisible = true로 바꿔준 후 (추후) 마이페이지로 이동

📸 스크린샷

  • isExpired 필드 추가
    스크린샷 2025-10-31 오후 5 33 54

  • NEW
    스크린샷 2025-10-31 오후 8 25 41

  • EXISTING
    스크린샷 2025-10-31 오후 8 17 58

  • RESTORED
    스크린샷 2025-10-31 오후 8 19 23

💬 리뷰 요구사항

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 앨범 입장 상태 표시 추가 (NEW / EXISTING / REJOINED)
    • 메이커 정보(maker) 응답 적용
    • 신규/기존 입장 응답 구조 분리
  • 개선 사항

    • 앨범 입장 흐름 간소화 및 재참여 복원 처리
    • 앨범 용량 검증 강화 및 남은 업로드 슬롯 계산 제공
    • 최근 사진 썸네일 반환 방식 개선
    • 참여자 가시성(isVisible) 관리 추가

@coderabbitai
Copy link

coderabbitai bot commented Oct 31, 2025

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between d2d8fe1 and df27e46.

📒 Files selected for processing (5)
  • src/main/java/com/cheeeese/album/application/AlbumService.java (5 hunks)
  • src/main/java/com/cheeeese/album/domain/type/AlbumJoinStatus.java (1 hunks)
  • src/main/java/com/cheeeese/album/dto/response/ExistingEnterResponse.java (1 hunks)
  • src/main/java/com/cheeeese/album/dto/response/NewEnterResponse.java (1 hunks)
  • src/main/java/com/cheeeese/album/infrastructure/mapper/AlbumMapper.java (5 hunks)
 _____________________________
< I speak fluent stack trace. >
 -----------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Tip

CodeRabbit can generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.

Walkthrough

앨범 도메인에서 호스트 중심 모델을 제작자 중심 모델로 리팩토링하고, 앨범 입장 흐름을 다단계 분기 로직으로 개선했습니다. 사용자 앨범 가시성 관리와 신규/기존/복구 참여 상태 구분이 추가되었으며, 응답 구조를 sealed interface 기반 다형으로 변경했습니다.

Changes

Cohort / File(s) 변경 요약
도메인 모델 - 호스트→제작자 리네이밍
src/main/java/com/cheeeese/album/domain/Album.java
hostId 필드를 makerId로 리네이밍, 데이터베이스 컬럼 host_id → maker_id 변경
도메인 모델 - 사용자 앨범 가시성
src/main/java/com/cheeeese/album/domain/UserAlbum.java
isVisible 필드 및 컬럼 추가, hide()/show() 메서드 구현
도메인 타입 - 입장 상태
src/main/java/com/cheeeese/album/domain/type/AlbumJoinStatus.java
AlbumJoinStatus 열거형 추가 (NEW, EXISTING, RESTORED 상수)
응답 DTO - 구조 변경
src/main/java/com/cheeeese/album/dto/response/AlbumEnterResponse.java
구체적 레코드에서 sealed interface로 변경, NewEnterResponse/ExistingEnterResponse 구현 지정
응답 DTO - 제작자 정보
src/main/java/com/cheeeese/album/dto/response/AlbumMakerInfo.java
새 DTO 레코드 추가 (makerName, makerProfileImage)
응답 DTO - 신규 입장
src/main/java/com/cheeeese/album/dto/response/NewEnterResponse.java
AlbumEnterResponse 구현, joinStatus/title/themeEmoji/eventDate/expiredAt/makerInfo/remainingUploadSlots/recentPhotoUrls
응답 DTO - 기존 입장
src/main/java/com/cheeeese/album/dto/response/ExistingEnterResponse.java
AlbumEnterResponse 구현, joinStatus/title/themeEmoji/eventDate/expiredAt/makerInfo
응답 DTO - 초대 정보
src/main/java/com/cheeeese/album/dto/response/AlbumInvitationResponse.java
isExpired 필드 추가
비즈니스 로직 - 앨범 서비스
src/main/java/com/cheeeese/album/application/AlbumService.java
enterAlbum 다단계 분기 흐름 구현 (기존/신규 여부 확인), 가시성 복구 로직, maker 기반 호스트 조회, calculateRemainingUploadSlots 유틸 추가
검증 로직
src/main/java/com/cheeeese/album/application/validator/AlbumValidator.java
validateAlbumExpiration을 private으로 변경, validateAlbumCapacity(Album) public 메서드 추가
데이터 매핑 - 앨범
src/main/java/com/cheeeese/album/infrastructure/mapper/AlbumMapper.java
makerId 사용, toMakerInfo/toNewResponse/toExistingResponse/toExpiredInvitationResponse 메서드 추가, toHostInfo/toParticipantResponse 제거
데이터 매핑 - 사용자 앨범
src/main/java/com/cheeeese/album/infrastructure/mapper/UserAlbumMapper.java
isVisible(true) 빌더 체인 추가
저장소
src/main/java/com/cheeeese/album/infrastructure/persistence/AlbumRepository.java
findByHostId → findByMakerId 리네이밍, 쿼리 countByUserAndCreatedAtBetween 업데이트
사진 서비스
src/main/java/com/cheeeese/photo/application/PhotoService.java
countTotalPhotos(Long) 제거, getRecentThumbnailUrls(Long) 추가, getRecentPhotoUrls 썸네일 URL 반환으로 변경
사진 저장소
src/main/java/com/cheeeese/photo/infrastructure/persistence/PhotoRepository.java
findTop9ByAlbumIdAndIsDeletedFalseOrderByCreatedAtDesc / countByAlbumIdAndIsDeletedFalse 제거, findTop5ByAlbumIdAndIsDeletedFalseAndStatusOrderByCreatedAtDesc 추가
문서화
src/main/java/com/cheeeese/album/presentation/swagger/AlbumSwagger.java
enterAlbum 엔드포인트 설명 리포맷, 처리 로직 상세 설명 추가
테스트
src/test/java/com/cheeeese/album/integration/UserAlbumServiceIntegrationTest.java
findByHostId → findByMakerId 호출 변경

Sequence Diagram(s)

sequenceDiagram
    actor User as 사용자
    participant AlbumService as AlbumService
    participant AlbumRepository as AlbumRepository
    participant UserAlbumRepository as UserAlbumRepository
    participant PhotoService as PhotoService
    participant AlbumValidator as AlbumValidator
    participant AlbumMapper as AlbumMapper
    
    User->>AlbumService: enterAlbum(albumCode, userId)
    
    AlbumService->>AlbumRepository: findByCode(albumCode)
    AlbumRepository-->>AlbumService: Album
    
    AlbumService->>AlbumValidator: validateAlbumExpiration(album)
    
    rect rgb(200, 150, 255)
        Note over AlbumService: 만료 확인 단계
        alt 만료됨
            AlbumService-->>User: ExpiredInvitationResponse(RESTORED)
        else 만료 안됨
            AlbumService->>AlbumValidator: validateAlbumCapacity(album)
        end
    end
    
    rect rgb(150, 200, 255)
        Note over AlbumService: 참여 상태 확인 단계
        AlbumService->>UserAlbumRepository: findByUserIdAndAlbumId(userId, albumId)
        alt 기존 참여 기록 있음
            rect rgb(200, 255, 200)
                Note over AlbumService: 복구 흐름
                UserAlbumRepository-->>AlbumService: UserAlbum(isVisible=false)
                AlbumService->>UserAlbumRepository: show() 호출
                AlbumService-->>User: ExistingEnterResponse(RESTORED)
            end
        else 기존 참여 기록 없음
            rect rgb(200, 255, 200)
                Note over AlbumService: 신규 흐름
                AlbumService->>UserAlbumRepository: 새 UserAlbum 생성 및 저장
                AlbumService->>AlbumRepository: 참여자 수 증가
                AlbumService->>PhotoService: getRecentThumbnailUrls(albumId)
                PhotoService-->>AlbumService: 썸네일 URL 리스트
                AlbumService->>AlbumMapper: toNewResponse(album, makerInfo, slots, urls)
                AlbumMapper-->>AlbumService: NewEnterResponse
                AlbumService-->>User: NewEnterResponse(NEW)
            end
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 분

추가 검토 필요 영역:

  • AlbumEnterResponse sealed interface 변경: 이전 레코드 기반 구조에서 다형 sealed interface로의 대대적 변경으로, 호출처에서의 타입 캐스팅 및 클라이언트 적응 로직 확인 필요
  • AlbumService.enterAlbum 다단계 분기 로직: 신규/기존/복구 상태 분기가 올바르게 구현되었는지, 특히 가시성 복구(hide/show) 시나리오와 원자성 보장 확인
  • hostId → makerId 일관성: 저장소, 도메인, 매퍼, 서비스 전반에서 리네이밍이 완전하게 적용되었는지 확인 (쿼리, Builder, 할당문 등)
  • PhotoService 메서드 시그니처 변경: countTotalPhotos 제거 및 getRecentPhotoUrls의 URL 타입 변경에 따른 기존 호출처 영향 범위 확인
  • PhotoRepository 쿼리 필터: status 필드 필터 추가로 인한 데이터 검색 결과 변화 및 인덱스 고려 확인
  • UserAlbum.isVisible 기본값: 모든 생성 경로에서 isVisible(true)가 일관되게 설정되는지 확인

Possibly related issues

  • fix: 앨범 참여 로직 수정 #29: enterAlbum 흐름에서 isExpired 처리, 기존 UserAlbum vs 신규 참여자 분기, 용량 검사, 최근 썸네일 URL 반환 등을 동일하게 다루므로 직접 관련

Possibly related PRs

Suggested reviewers

  • zyovn

Poem

🐰 호스트여 제작자가 되고,
참여자의 모습을 감추었다 드러내고,
신규 기존 복구의 삼갈래 길을 열었네.
썸네일 다섯 장이 인사하고,
sealed 인터페이스가 다형의 새벽을 맞이하니
앨범은 또 한 발 성숙해지는구나. 📸✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.15% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed PR 제목 "fix: 앨범 참여 로직 수정"은 changeset의 주요 변경사항을 정확하게 반영합니다. 이 changeset의 핵심은 AlbumService의 enterAlbum 메서드 로직을 재작성하고, 새로운 AlbumJoinStatus 열거형(NEW, EXISTING, RESTORED)을 도입하여 참여 상태에 따른 분기 처리를 구현한 것입니다. 제목은 명확하고 구체적이며, 일반적이거나 비설명적인 용어를 사용하지 않습니다.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/main/java/com/cheeeese/album/infrastructure/mapper/AlbumMapper.java (1)

5-5: 명시적 import 사용을 고려해보세요.

와일드카드 import (import com.cheeeese.album.dto.response.*)는 어떤 클래스들이 실제로 사용되는지 파악하기 어렵게 만들고, 네이밍 충돌 가능성을 높입니다. 명시적 import를 사용하면 코드 가독성과 유지보수성이 향상됩니다.

예시:

-import com.cheeeese.album.dto.response.*;
+import com.cheeeese.album.dto.response.AlbumCreationResponse;
+import com.cheeeese.album.dto.response.AlbumInvitationResponse;
+import com.cheeeese.album.dto.response.AlbumMakerInfo;
+import com.cheeeese.album.dto.response.ExistingEnterResponse;
+import com.cheeeese.album.dto.response.NewEnterResponse;
+import com.cheeeese.album.dto.response.UploadAvailableCountResponse;
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 878e395 and d2d8fe1.

📒 Files selected for processing (17)
  • src/main/java/com/cheeeese/album/application/AlbumService.java (5 hunks)
  • src/main/java/com/cheeeese/album/application/validator/AlbumValidator.java (2 hunks)
  • src/main/java/com/cheeeese/album/domain/Album.java (3 hunks)
  • src/main/java/com/cheeeese/album/domain/UserAlbum.java (1 hunks)
  • src/main/java/com/cheeeese/album/domain/type/AlbumJoinStatus.java (1 hunks)
  • src/main/java/com/cheeeese/album/dto/response/AlbumEnterResponse.java (1 hunks)
  • src/main/java/com/cheeeese/album/dto/response/AlbumInvitationResponse.java (1 hunks)
  • src/main/java/com/cheeeese/album/dto/response/AlbumMakerInfo.java (1 hunks)
  • src/main/java/com/cheeeese/album/dto/response/ExistingEnterResponse.java (1 hunks)
  • src/main/java/com/cheeeese/album/dto/response/NewEnterResponse.java (1 hunks)
  • src/main/java/com/cheeeese/album/infrastructure/mapper/AlbumMapper.java (4 hunks)
  • src/main/java/com/cheeeese/album/infrastructure/mapper/UserAlbumMapper.java (2 hunks)
  • src/main/java/com/cheeeese/album/infrastructure/persistence/AlbumRepository.java (2 hunks)
  • src/main/java/com/cheeeese/album/presentation/swagger/AlbumSwagger.java (1 hunks)
  • src/main/java/com/cheeeese/photo/application/PhotoService.java (1 hunks)
  • src/main/java/com/cheeeese/photo/infrastructure/persistence/PhotoRepository.java (1 hunks)
  • src/test/java/com/cheeeese/album/integration/UserAlbumServiceIntegrationTest.java (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/test/java/com/cheeeese/album/integration/UserAlbumServiceIntegrationTest.java (1)
src/test/java/com/cheeeese/fixture/FixtureFactory.java (2)
  • FixtureFactory (14-65)
  • createHostUserAlbum (58-64)
src/main/java/com/cheeeese/album/domain/type/AlbumJoinStatus.java (3)
src/main/java/com/cheeeese/photo/domain/PhotoStatus.java (1)
  • PhotoStatus (3-8)
src/main/java/com/cheeeese/album/domain/type/Role.java (1)
  • Role (3-7)
src/main/java/com/cheeeese/photo/domain/Photo.java (1)
  • Entity (12-72)
src/main/java/com/cheeeese/album/application/AlbumService.java (2)
src/main/java/com/cheeeese/album/infrastructure/mapper/AlbumMapper.java (1)
  • AlbumMapper (12-138)
src/main/java/com/cheeeese/album/infrastructure/mapper/UserAlbumMapper.java (1)
  • UserAlbumMapper (8-30)
🔇 Additional comments (5)
src/main/java/com/cheeeese/album/infrastructure/mapper/AlbumMapper.java (5)

17-43: 호스트 → 제작자 모델 전환이 잘 적용되었습니다.

hostId에서 makerId로의 파라미터 및 필드 변경이 일관되게 적용되어 있으며, 로직상 문제가 없습니다.


61-71: isExpired 필드 추가가 적절합니다.

활성 초대장에 대해 isExpired(false)를 설정하는 것이 의도대로 구현되었습니다.


73-86: 만료된 앨범에 대한 응답 처리가 명확합니다.

만료된 앨범의 경우 호스트 정보를 null로 설정하고 isExpired(true)를 반환하는 로직이 명확하게 구현되었습니다. 만료 시 호스트 정보를 노출하지 않는 것이 의도된 동작으로 보입니다.


88-97: 기존 참여자에 대한 응답 매핑이 잘 구현되었습니다.

ExistingEnterResponse 생성 로직이 명확하며, AlbumJoinStatusAlbumMakerInfo를 포함한 응답 구조가 적절합니다.


99-115: 신규 참여자 응답 매핑이 일관되게 수정되었습니다.

호스트 → 제작자 용어 변경이 일관되게 적용되었으며, joinStatus를 명시적으로 NEW로 설정하여 코드 명확성이 향상되었습니다.

Copy link
Member

@zyovn zyovn left a comment

Choose a reason for hiding this comment

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

수고하셨습니다! 🎸🧀

코드가 많이 바뀌엇네요.. 짱

@dahyun24 dahyun24 merged commit 35e1b93 into develop Oct 31, 2025
1 check was pending
@dahyun24 dahyun24 self-assigned this Oct 31, 2025
@dahyun24 dahyun24 added ✨feature New feature or request 🐛bug Something isn't working labels Oct 31, 2025
@dahyun24 dahyun24 linked an issue Oct 31, 2025 that may be closed by this pull request
3 tasks
@zyovn zyovn deleted the fix/#29-album-enter branch November 1, 2025 04:30
@coderabbitai coderabbitai bot mentioned this pull request Jan 5, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working ✨feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 앨범 참여 로직 수정

3 participants