diff --git a/src/main/java/com/moneymong/domain/ledger/api/response/ledger/LedgerInfoViewV2.java b/src/main/java/com/moneymong/domain/ledger/api/response/ledger/LedgerInfoViewV2.java index dd78076..67ebf2f 100644 --- a/src/main/java/com/moneymong/domain/ledger/api/response/ledger/LedgerInfoViewV2.java +++ b/src/main/java/com/moneymong/domain/ledger/api/response/ledger/LedgerInfoViewV2.java @@ -15,17 +15,20 @@ public class LedgerInfoViewV2 { final Integer totalBalance; final List ledgerInfoViewDetails; final long ledgerDetailTotalCount; + final String agencyName; public static LedgerInfoViewV2 from( Ledger ledger, List ledgerInfoViewDetails, - long ledgerDetailTotalCount + long ledgerDetailTotalCount, + String agencyName ) { return LedgerInfoViewV2.builder() .id(ledger.getId()) .totalBalance(ledger.getTotalBalance()) .ledgerInfoViewDetails(ledgerInfoViewDetails) .ledgerDetailTotalCount(ledgerDetailTotalCount) + .agencyName(agencyName) .build(); } } diff --git a/src/main/java/com/moneymong/domain/ledger/service/reader/LedgerReader.java b/src/main/java/com/moneymong/domain/ledger/service/reader/LedgerReader.java index 9745159..5d0f832 100644 --- a/src/main/java/com/moneymong/domain/ledger/service/reader/LedgerReader.java +++ b/src/main/java/com/moneymong/domain/ledger/service/reader/LedgerReader.java @@ -67,8 +67,9 @@ public LedgerInfoViewV2 searchLedgersByPeriod( List 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( @@ -100,8 +101,9 @@ public LedgerInfoViewV2 searchLedgersByPeriodAndFundType( List 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(