FINERACT-2618: Add originators to journal entry aggregation job and improve reports.#5898
Open
AshharAhmadKhan wants to merge 1 commit into
Conversation
66a379b to
19febc5
Compare
Contributor
Author
|
@adamsaghy Checked all 4 failing CI checks. None are related to this PR's changes. Please re-trigger those checks when youu get a chance. |
19febc5 to
de32e00
Compare
…mprove reports - Extend JournalEntryAggregationJobReader SQL with a loan_originators CTE (STRING_AGG/GROUP_CONCAT of originator external IDs from m_loan_originator_mapping + m_loan_originator), LEFT JOIN on loan.id, select originatorExternalIds, and add it to the GROUP BY clause - Wire originatorExternalIds through the full pipeline: JournalEntryAggregationSummaryData (DTO field), JournalEntrySummary (@column mapping), and JournalEntryAggregationWriterServiceImpl (convertToJournalEntrySummary) - Add Liquibase migration 0234: update the Trial Balance Summary Report (MySQL + PostgreSQL) so summary_snapshot_baseline_data reads COALESCE(ags.originator_external_ids, '') from the aggregation summary table instead of hardcoding NULL, eliminating the in-memory overhead described in the issue - Update unit tests: JournalEntryAggregationJobReaderTest and JournalEntryAggregationWriterServiceImplTest cover the new field - Add integration test (Order 6) in FeignTrialBalanceSummaryReportTest that runs the actual aggregation job and verifies originator_external_ids surfaces via the snapshot path (summary_snapshot_baseline_data)
de32e00 to
158b5b1
Compare
Contributor
Author
|
Hi @adamsaghy, I’ve investigated this further and verified the originator flow end-to-end (reader → DTO → entity → writer → report snapshot path), but I’m still missing the cause of the Shard 15 integration failure. Could you please point me in the right direction if there’s any Fineract-specific behavior around Journal Entry Aggregation / Trial Balance reporting that I may be overlooking? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The journal entry aggregation job was grouping entries only by asset owner, leaving
originator_external_idsalways NULL in the summary table even though the column existed. This meant the Trial Balance report had to re-derive originator data from raw journal entries for every historical row already in the snapshot, adding unnecessary memory overhead. It also meant originator never appeared via the snapshot path even when one was attached to the loan.This PR fixes both problems:
loan_originatorsCTE to the aggregation job reader query and wiresoriginator_external_idsthrough the full pipeline — DTO, JPA entity, and writer service — so it gets correctly persisted per summary row0236sosummary_snapshot_baseline_datareads the stored originator value directly instead of hardcoding NULL, letting the snapshot join cleanly on originator without re-hitting the mapping tables