Skip to content

[#7] FEAT: 파트너 관계 조회 API에서, 하위 파트너 인센티브 합계 응답 추가#70

Merged
Hwan0518 merged 1 commit intodevelopfrom
feature/partner/refactor
Jan 27, 2026
Merged

[#7] FEAT: 파트너 관계 조회 API에서, 하위 파트너 인센티브 합계 응답 추가#70
Hwan0518 merged 1 commit intodevelopfrom
feature/partner/refactor

Conversation

@Hwan0518
Copy link
Contributor

Issue ✨

변경점 👍

  • 파트너 관계 조회 API에서, 하위 파트너 인센티브 합계 응답 추가

Copilot AI review requested due to automatic review settings January 27, 2026 08:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

파트너 관계 조회 API 응답에 1차/2차 하위 파트너별 “총 인센티브 합계”를 포함시키기 위해, 인센티브 합계 조회용 Port/Repository 쿼리와 응답 DTO를 확장한 PR입니다.

Changes:

  • 하위 파트너 UUID 목록에 대한 총 인센티브 합계를 조회하는 Port 및 Querydsl 집계 쿼리 추가
  • 파트너 관계 조회 Facade에서 1차/2차 하위 파트너 데이터에 totalIncentive 매핑 추가
  • 컨트롤러 응답 매핑을 ModelMapper 대신 Response.from(...) 방식으로 변경 및 관련 테스트 추가

Reviewed changes

Copilot reviewed 6 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/greenfirst/be/user/application/port/out/incentive/IncentiveTotalQueryPort.java 하위 파트너별 인센티브 합계 조회 Port 신규 추가
src/main/java/greenfirst/be/user/adapter/out/persistence/repository/incentive/IncentiveTotalQueryPortImpl.java Port 구현체로 IncentiveQueryRepository 집계 조회 위임
src/main/java/greenfirst/be/incentive/application/port/out/IncentiveQueryRepository.java 파트너 UUID 목록별 합계 조회 메서드 시그니처 추가
src/main/java/greenfirst/be/incentive/adapter/out/persistence/repository/IncentiveQueryRepositoryImpl.java Querydsl repository로 합계 조회 위임 구현 추가
src/main/java/greenfirst/be/incentive/adapter/out/persistence/querydsl/IncentiveQuerydslRepository.java partnerUuid 기준 totalIncentive SUM 집계 쿼리 구현 추가
src/main/java/greenfirst/be/user/application/facade/PartnerRelationshipFacade.java 1/2차 하위 파트너 목록에 totalIncentive를 조회/주입하도록 로직 확장
src/main/java/greenfirst/be/user/application/dto/out/PartnerData.java 응답에 포함될 totalIncentive 필드 추가
src/main/java/greenfirst/be/user/adapter/in/web/response/PartnerRelationshipResponse.java 응답 DTO에 builder/from 매핑 로직 추가
src/main/java/greenfirst/be/user/adapter/in/web/controller/GetRelationshipDataController.java ModelMapper 제거 후 PartnerRelationshipResponse.from 사용으로 매핑 변경
src/test/java/greenfirst/be/users/fake/FakeIncentiveTotalQueryPort.java Facade 테스트용 IncentiveTotalQueryPort fake 구현 추가
src/test/java/greenfirst/be/user/application/facade/PartnerRelationshipFacadeUnitTest.java 1/2차 하위 파트너 totalIncentive 포함 및 기본값(0) 테스트 추가
src/test/java/greenfirst/be/incentive/application/IncentiveJobManagementServiceUnitTest.java IncentiveQueryRepository 인터페이스 확장에 따른 스텁 메서드 추가

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 33 to 36
public void setTotals(Map<UUID, BigDecimal> totals) {
this.totals.clear();
this.totals.putAll(totals);
}
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

setTotals will throw a NullPointerException if the caller passes null (because of putAll). Since this is a reusable test fake, it should either guard against null (treat as empty) or enforce non-null via Objects.requireNonNull(totals) with a clear message.

Copilot uses AI. Check for mistakes.
Comment on lines 34 to 37
public static PartnerRelationshipResponse from(PartnerRelationshipOutDto outDto) {
if (outDto == null) {
return null;
}
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

from(...) is the only *Response.from mapper in the codebase that returns null on null input; other mappers (e.g., IncentiveListResponse.from in src/main/java/greenfirst/be/incentive/adapter/in/web/response/IncentiveListResponse.java:26) assume non-null and fail fast. Consider removing the null-branch (or returning an empty response) to keep mapper behavior consistent.

Copilot uses AI. Check for mistakes.
@Hwan0518 Hwan0518 force-pushed the feature/partner/refactor branch from 9d4360f to 660ca56 Compare January 27, 2026 09:07
@Hwan0518 Hwan0518 merged commit 305e7d4 into develop Jan 27, 2026
@Hwan0518 Hwan0518 deleted the feature/partner/refactor branch January 27, 2026 09:08
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.

1 participant