Skip to content

Commit

Permalink
feat: 장부 내역 api의 응답에 소속 이름을 추가한다.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlarltj committed Oct 26, 2024
1 parent 812b7d7 commit 4157965
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ public class LedgerInfoViewV2 {
final Integer totalBalance;
final List<LedgerInfoViewDetail> ledgerInfoViewDetails;
final long ledgerDetailTotalCount;
final String agencyName;

public static LedgerInfoViewV2 from(
Ledger ledger,
List<LedgerInfoViewDetail> ledgerInfoViewDetails,
long ledgerDetailTotalCount
long ledgerDetailTotalCount,
String agencyName
) {
return LedgerInfoViewV2.builder()
.id(ledger.getId())
.totalBalance(ledger.getTotalBalance())
.ledgerInfoViewDetails(ledgerInfoViewDetails)
.ledgerDetailTotalCount(ledgerDetailTotalCount)
.agencyName(agencyName)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ public LedgerInfoViewV2 searchLedgersByPeriod(

List<LedgerDetail> ledgerDetails = ledgerDetailPage.getContent();
long totalCount = ledgerDetailPage.getTotalElements();
String agencyName = agencyUser.getAgency().getAgencyName();

return LedgerInfoViewV2.from(ledger, convertToLedgerInfoViewDetail(ledgerDetails), totalCount);
return LedgerInfoViewV2.from(ledger, convertToLedgerInfoViewDetail(ledgerDetails), totalCount, agencyName);
}

public LedgerInfoViewV2 searchLedgersByPeriodAndFundType(
Expand Down Expand Up @@ -100,8 +101,9 @@ public LedgerInfoViewV2 searchLedgersByPeriodAndFundType(

List<LedgerDetail> ledgerDetails = ledgerDetailPage.getContent();
long totalCount = ledgerDetailPage.getTotalElements();
String agencyName = agencyUser.getAgency().getAgencyName();

return LedgerInfoViewV2.from(ledger, convertToLedgerInfoViewDetail(ledgerDetails), totalCount);
return LedgerInfoViewV2.from(ledger, convertToLedgerInfoViewDetail(ledgerDetails), totalCount, agencyName);
}

public LedgerInfoView search(
Expand Down

0 comments on commit 4157965

Please sign in to comment.