You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PR adds an API for recipients to accept or decline travel-record invitations. It links pending invitations to accepted friendships, applies validation and membership updates during responses, and updates the pending-invitation query.
Changes: Travel invitation lifecycle
Layer / File(s)
Summary
Link invitations to friendships src/main/java/com/yeogido/backend/domain/travel/entity/TravelRecordInvitation.java, src/main/java/com/yeogido/backend/domain/travel/service/TravelRecordInvitationServiceImpl.java, src/main/resources/db/migration/V43__link_pending_travel_invitations_to_friendship.sql
Invitations now store an optional friendship association. The migration links eligible pending invitations to accepted friendships and removes pending invitations without a matching link. Invitation creation validates friendships in sorted invitee order and stores them with the invitations.
Respond to an invitation src/main/java/com/yeogido/backend/domain/travel/controller/TravelRecordInvitationController.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/converter/TravelRecordInvitationConverter.java, src/main/java/com/yeogido/backend/domain/travel/entity/TravelRecordInvitation.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/repository/TravelRecordMemberRepository.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/TravelRecordInvitationResponseIntegrationTest.java
A PATCH endpoint accepts validated ACCEPTED or DECLINED responses. The service checks invitation and user state, handles repeated responses, adds membership on acceptance, and reserves the travel-record version. Integration tests cover authorization, lifecycle, validation, and concurrent operations.
yeogido/backend#436 — The PR changes how invitations behave after a response or after leaving, but does not implement invitation creation.
yeogido/backend#442 — The PR updates the pending-invitation query and changes whether responded invitations remain in its results.
Possibly related PRs
yeogido/backend#440 — Adds invitation creation and the invitation records that this PR accepts or declines.
yeogido/backend#443 — Adds the received-invitation list, which this PR updates through response status changes and query filters.
yeogido/backend#424 — Adds accepted friendship behavior used by this PR’s invitation creation and response checks.
Suggested reviewers:yangjiae12, chans20
Merge Risk: Low · previous review 7c9de
A narrow concurrency window can allow an invitation response after a user is deactivated. Use current status reads before merging, or accept this bounded risk.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: implementing APIs to accept or decline shared album invitations.
Description check
The description includes the requested change, linked issue, review focus, dependency note, test results, and API test evidence. It matches the required template and provides sufficient implementation…
Linked Issues check
직접 연결된 활성 이슈 #445의 코딩 요구사항을 충족합니다. PATCH /api/v1/travel-records/invitations/{invitationId}와 수신자·상태 검증을 구현했습니다. respondToInvitation은 트랜잭션에서 앨범, 친구 관계, 초대를 잠그고 수락 시 참여 관계와 버전을 함께 변경합니다. 동일 응답, 반대 응답…
Out of Scope Changes check
변경 범위는 #445와 연결됩니다. 컨트롤러, DTO, 변환기, 서비스, 저장소, 엔티티 변경은 초대 응답 API와 동시성 처리를 지원합니다. 초대 생성 시 친구 관계를 저장하고 대기 초대 조회를 제한하는 변경은 친구 해제 시 대기 초대 삭제 및 복구 방지 요구사항을 구현합니다. V43 마이그레이션과 통합 테스트도 해당 기능의 지원 변경입니다. 확인된 un…
Full details: Description check
Explanation
The description includes the requested change, linked issue, review focus, dependency note, test results, and API test evidence. It matches the required template and provides sufficient implementation context.
Full details: Linked Issues check
Explanation
직접 연결된 활성 이슈 #445의 코딩 요구사항을 충족합니다. PATCH /api/v1/travel-records/invitations/{invitationId}와 수신자·상태 검증을 구현했습니다. respondToInvitation은 트랜잭션에서 앨범, 친구 관계, 초대를 잠그고 수락 시 참여 관계와 버전을 함께 변경합니다. 동일 응답, 반대 응답, 나간 뒤 재가입 시도를 처리합니다. V43 마이그레이션은 대기 초대를 친구 관계에 연결하고 ON DELETE CASCADE를 적용합니다. 통합 테스트는 중복 수락, 수락·거절 경합, 앨범 삭제·나가기 경합, 친구 해제, 재친구 관계, 인증 및 입력 검증을 검증합니다. Swagger 확인과 #443 병합 후 base 변경은 수동 또는 관리 작업이므로 코딩 요구사항으로 평가하지 않습니다.
Full details: Out of Scope Changes check
Explanation
변경 범위는 #445와 연결됩니다. 컨트롤러, DTO, 변환기, 서비스, 저장소, 엔티티 변경은 초대 응답 API와 동시성 처리를 지원합니다. 초대 생성 시 친구 관계를 저장하고 대기 초대 조회를 제한하는 변경은 친구 해제 시 대기 초대 삭제 및 복구 방지 요구사항을 구현합니다. V43 마이그레이션과 통합 테스트도 해당 기능의 지원 변경입니다. 확인된 unrelated 변경은 없습니다.
Full details: Docstring Coverage
Explanation
Docstring coverage is 40.00% which is insufficient. 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 10 functions across 13 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
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
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.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 PR 설명
PATCH /api/v1/travel-records/invitations/{invitationId}를 추가했습니다. 수락하면 참여 관계를 생성하고, 거절하면 대기 폴더 목록에서 제외합니다.TRAVEL_RECORD4094를 반환합니다.🔗 연관된 이슈
Resolves: #445
📝 리뷰 요구사항
💻 테스트 결과
Summary by CodeRabbit