Skip to content

[Feat] 공유 앨범 초대 API 구현 - #440

Merged
yeonie0309 merged 1 commit into
developfrom
feat/436-travel-record-invitation
Nov 3, 2026
Merged

yeonie0309 merged 1 commit into
developfrom
feat/436-travel-record-invitation

Conversation

@yeonie0309

@yeonie0309 yeonie0309 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

📌 PR 설명

  • 공유 앨범 생성자와 현재 참여자의 친구 초대 API를 추가했습니다.
  • 대상 전체 검증 후 초대를 함께 저장하고 중복 요청을 방지했습니다.
  • 초대 생성만으로 참여 권한을 부여하지 않습니다.

🔗 연관된 이슈

Resolves: #436

📝 리뷰 요구사항

  • 초대 권한, 친구 관계 검증과 동시 요청 처리 확인 부탁드립니다.
  • 거절, 나가기 후 재초대 처리는 PM 확인이 필요한 검토안입니다.

💻 테스트 결과

  • API 테스트 완료
  • 정상 동작 확인
참여자 초대 성공 중복 초대 수락 대기자 권한 거부
초대 성공 중복 초대 권한 거부

Summary by CodeRabbit

  • New Features
    • Added the ability to invite friends to travel records shared with friends. Record owners and members can send invitations to eligible friends.
    • Invitation requests now report the created invitations, including each invitee’s status and creation time.
    • Requests are checked for valid invitees and existing pending invitations, helping prevent duplicate invitations.

@yeonie0309 yeonie0309 self-assigned this Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Adds a POST endpoint to create invitations for FRIENDS-visible travel records. The service validates the record, inviter, and invitees, then saves invitations and returns their details.

Changes: Invitation creation

Layer / File(s) Summary
Invitation API contract and endpoint
src/main/java/com/yeogido/backend/domain/travel/dto/request/TravelRecordInvitationReqDTO.java, src/main/java/com/yeogido/backend/domain/travel/dto/response/TravelRecordInvitationResDTO.java, src/main/java/com/yeogido/backend/domain/travel/service/TravelRecordInvitationService.java, src/main/java/com/yeogido/backend/domain/travel/controller/TravelRecordInvitationController.java, src/main/java/com/yeogido/backend/domain/travel/converter/TravelRecordInvitationConverter.java
Adds validated invitee IDs as the request, invitation details as the response, and a POST endpoint that delegates invitation creation to the service.
Invitation validation and persistence
src/main/java/com/yeogido/backend/domain/travel/exception/TravelRecordErrorCode.java, src/main/java/com/yeogido/backend/domain/travel/repository/TravelRecordInvitationRepository.java, src/main/java/com/yeogido/backend/domain/travel/service/TravelRecordInvitationServiceImpl.java, src/test/java/com/yeogido/backend/domain/travel/service/TravelRecordInvitationIntegrationTest.java
Validates record visibility, inviter permissions, invitee eligibility, and existing invitations. Saves new invitations without granting membership. Integration tests cover validation, persistence, concurrent requests, and HTTP responses.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant TravelRecordInvitationController
  participant TravelRecordInvitationServiceImpl
  participant TravelRecordInvitationRepository
  Client->>TravelRecordInvitationController: POST invitation request
  TravelRecordInvitationController->>TravelRecordInvitationServiceImpl: createInvitations
  TravelRecordInvitationServiceImpl->>TravelRecordInvitationRepository: find invitations for requested invitees
  TravelRecordInvitationRepository-->>TravelRecordInvitationServiceImpl: matching invitations
  TravelRecordInvitationServiceImpl->>TravelRecordInvitationRepository: save new invitations
  TravelRecordInvitationServiceImpl-->>TravelRecordInvitationController: creation response
  TravelRecordInvitationController-->>Client: CREATED response
Loading

Possibly related PRs

  • yeogido/backend#419: Defines FRIENDS visibility and current-member access, which the invitation service checks.
  • yeogido/backend#423: Adds the active-record locking query used to serialize invitation creation with deletion and leaving.
  • yeogido/backend#424: Adds the accepted-friendship query used to validate invitation targets.

Suggested reviewers: yangjiae12, chans20

Merge Risk: Minimal · up to 29889

No actionable invitation or album-deletion failure remains identified; the change is mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: implementing the shared album invitation API.
Description check Passed The description includes the change summary, linked issue, review requests, and test results. It also documents invitation validation, duplicate prevention, and permission behavior.
Linked Issues check Passed #436의 코딩 요구사항을 충족합니다. 요청·응답 DTO, 컨트롤러, 서비스, 변환 로직을 추가했습니다. 서비스는 앨범 행에 PESSIMISTIC_WRITE 잠금을 적용하고, 생성자 또는 현재 참여자 권한, 활성 사용자, ACCEPTED 친구 관계, 자기 자신, 중복 대상, 대기 초대, 현재 참여자를 검증합니다. 전체 검증 후 종료 초대를 정리하고 …
Out of Scope Changes check Passed 변경 사항은 #436의 공유 앨범 친구 초대 API 범위에 있습니다. DTO, API 계층, 도메인 검증, 저장소 조회, 오류 코드, 변환 로직, 관련 통합 테스트만 추가하거나 변경했습니다. 종료 초대 후 재초대 처리는 #436에 명시된 검토안과 직접 연결됩니다. 관련 없는 기능 변경은 확인되지 않습니다.
Docstring Coverage Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Full details: Linked Issues check

Explanation

#436의 코딩 요구사항을 충족합니다. 요청·응답 DTO, 컨트롤러, 서비스, 변환 로직을 추가했습니다. 서비스는 앨범 행에 PESSIMISTIC_WRITE 잠금을 적용하고, 생성자 또는 현재 참여자 권한, 활성 사용자, ACCEPTED 친구 관계, 자기 자신, 중복 대상, 대기 초대, 현재 참여자를 검증합니다. 전체 검증 후 종료 초대를 정리하고 초대를 함께 저장합니다. 초대 생성 시 참여 관계를 만들지 않습니다. 기존 앨범 잠금 경로와 동시 초대 통합 테스트도 포함합니다. 권한, 롤백, 중복, 상태, HTTP 응답을 검증하는 자동화 테스트가 있습니다. 로컬 Swagger 확인은 수동 검증 항목이므로 코딩 판정에서 제외합니다.

Full details: Docstring Coverage

Explanation

Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 9 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/javascript/security/hardcoded-hmac-key.yml

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
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: 03a26201-1c45-4a77-99a6-d1e95737a760
Commits

Reviewing files that changed from the base of the PR and between 29a3839 and 298896a.

Files selected for processing: 9
  • src/main/java/com/yeogido/backend/domain/travel/controller/TravelRecordInvitationController.java
  • src/main/java/com/yeogido/backend/domain/travel/converter/TravelRecordInvitationConverter.java
  • src/main/java/com/yeogido/backend/domain/travel/dto/request/TravelRecordInvitationReqDTO.java
  • src/main/java/com/yeogido/backend/domain/travel/dto/response/TravelRecordInvitationResDTO.java
  • src/main/java/com/yeogido/backend/domain/travel/exception/TravelRecordErrorCode.java
  • src/main/java/com/yeogido/backend/domain/travel/repository/TravelRecordInvitationRepository.java
  • src/main/java/com/yeogido/backend/domain/travel/service/TravelRecordInvitationService.java
  • src/main/java/com/yeogido/backend/domain/travel/service/TravelRecordInvitationServiceImpl.java
  • src/test/java/com/yeogido/backend/domain/travel/service/TravelRecordInvitationIntegrationTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@yangjiae12 yangjiae12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

초대 권한과 친구 관계 검증, 중복 초대 방지 처리 확인했습니다! 재초대 정책은 확정되는 방향에 맞춰 추후 반영 부탁드립니다. 우선 승인하겠습니다. 수고하셨습니다~!

@yeonie0309
yeonie0309 merged commit ca363bf into develop Nov 3, 2026
2 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.

[FEAT] 공유 앨범 초대 API 구현

2 participants