Skip to content

fix: 가족 목록 양방향 조회 지원 (#112) - #113

Merged
LATE-BL00MER merged 1 commit into
developfrom
fix/112-bidirectional-family-members
Aug 25, 2026
Merged

fix: 가족 목록 양방향 조회 지원 (#112)#113
LATE-BL00MER merged 1 commit into
developfrom
fix/112-bidirectional-family-members

Conversation

@LATE-BL00MER

@LATE-BL00MER LATE-BL00MER commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

📋 작업 내용

  • GET /api/v1/family/members가 보호자 기준으로만 가족 연결을 조회하던 문제를 수정했습니다.
  • 로그인 사용자가 보호자 또는 피보호자로 참여한 활성 가족 연결을 모두 조회하도록 변경했습니다.
  • 가족 연결 행을 중복 생성하지 않고 기존 family_links 한 행을 양쪽에서 조회하도록 구현했습니다.
  • 로그인 사용자의 상대 가족 정보를 나타내는 다음 필드를 응답에 추가했습니다.
    • memberId
    • memberName
    • memberPhone
    • memberRole (PROTECTOR, WARD)
  • 기존 보호자 화면과의 호환성을 위해 wardId, wardName, wardPhone 필드는 유지했습니다.
  • 초대 생성 → 수락 → 보호자 목록 조회 → 피보호자 목록 조회 흐름을 통합 테스트에 반영했습니다.

🧪 테스트 결과

  • 가족 초대 및 양방향 목록 조회 통합 테스트 통과
  • 전체 BE 테스트 179개 통과
  • 실패 0개, 오류 0개, 스킵 0개

🔗 관련 이슈

Closes #112

✅ 체크리스트

  • 관련 이슈를 연결했습니다.
  • 구현 범위와 변경 이유를 설명했습니다.
  • 로컬 테스트를 통과했습니다.
  • API 변경 사항을 Swagger에 반영했습니다.
  • DB 변경 사항과 마이그레이션을 포함했습니다. (DB 변경 없음)
  • 민감 정보가 코드·로그·테스트 데이터에 포함되지 않았습니다.
  • 프론트엔드에 영향을 주는 응답 스키마 변경을 공유했습니다.
  • 병합 전 작업 브랜치를 삭제하지 않았습니다.

Summary by CodeRabbit

  • New Features

    • Family members can now view active family connections they belong to, whether they are a protector or ward.
    • Member details now identify the connected person’s name, phone number, ID, and role.
    • Family connections are listed with the connected person’s role clearly indicated.
  • Bug Fixes

    • Improved family member retrieval to support both sides of a family connection.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bcf28a71-42b1-4268-a5fe-70aec22891a8

📥 Commits

Reviewing files that changed from the base of the PR and between 0315111 and 1f09f84.

📒 Files selected for processing (6)
  • src/main/java/com/gold/safefam/domain/family/controller/FamilyController.java
  • src/main/java/com/gold/safefam/domain/family/dto/FamilyMemberResponse.java
  • src/main/java/com/gold/safefam/domain/family/enums/FamilyMemberRole.java
  • src/main/java/com/gold/safefam/domain/family/repository/FamilyLinkRepository.java
  • src/main/java/com/gold/safefam/domain/family/service/FamilyService.java
  • src/test/java/com/gold/safefam/domain/family/controller/FamilyFlowTest.java

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


📝 Walkthrough

Walkthrough

The family member endpoint now returns active connections for protectors and wards. Responses identify the counterparty and role relative to the authenticated user while retaining legacy ward fields. Integration coverage verifies both lookup directions.

Changes

Family member lookup

Layer / File(s) Summary
Member-relative response contract
src/main/java/com/gold/safefam/domain/family/dto/FamilyMemberResponse.java, src/main/java/com/gold/safefam/domain/family/enums/FamilyMemberRole.java
The response adds counterparty identity and role fields. The mapper derives them from the requester’s participant role and retains the existing ward fields.
Participant query and endpoint flow
src/main/java/com/gold/safefam/domain/family/repository/FamilyLinkRepository.java, src/main/java/com/gold/safefam/domain/family/service/FamilyService.java, src/main/java/com/gold/safefam/domain/family/controller/FamilyController.java
The active-link query matches users as protectors or wards. The service and controller pass the authenticated user ID through the lookup flow.
Protector and ward flow validation
src/test/java/com/gold/safefam/domain/family/controller/FamilyFlowTest.java
The integration test verifies ward and protector member responses, then continues with the existing revoke and status checks.

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

Merge Risk: ⚪ Minimal · up to 1f09f

The API now supports family-member lookup from either relationship direction while preserving existing guardian fields. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: ch0412

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes support for bidirectional family-list retrieval and matches issue #112.
Linked Issues check ✅ Passed The changes implement the linked issue objectives: both participants can retrieve active family links, responses include relative member details and role, legacy ward fields remain, and integration co…
Out of Scope Changes check ✅ Passed All modified production files and tests directly support bidirectional family-list retrieval, response compatibility, role reporting, active-link filtering, and integration verification. No unrelated …
Full details: Linked Issues check

Explanation

The changes implement the linked issue objectives: both participants can retrieve active family links, responses include relative member details and role, legacy ward fields remain, and integration coverage verifies both directions. The active-status repository filter excludes non-active links.

Full details: Out of Scope Changes check

Explanation

All modified production files and tests directly support bidirectional family-list retrieval, response compatibility, role reporting, active-link filtering, and integration verification. No unrelated changes are evident.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/112-bidirectional-family-members

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.

@LATE-BL00MER
LATE-BL00MER merged commit a267865 into develop Aug 25, 2026
4 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.

[Fix]: 가족 목록을 보호자·피보호자 양쪽에서 조회할 수 있도록 수정

1 participant