Skip to content

FINERACT-2730: add loan and savings transaction search - #6211

Open
AnvayKharb wants to merge 1 commit into
apache:developfrom
AnvayKharb:fix/FINERACT-2730-transaction-search
Open

FINERACT-2730: add loan and savings transaction search#6211
AnvayKharb wants to merge 1 commit into
apache:developfrom
AnvayKharb:fix/FINERACT-2730-transaction-search

Conversation

@AnvayKharb

Copy link
Copy Markdown
Contributor

Description

This PR extends the global search functionality to support searching loan repayment and savings transactions.

Users can now search transactions using existing transaction identifiers without changing the current search endpoint or affecting existing search behavior.

Supported searches

Loan repayments

  • Transaction ID
  • External ID

Savings deposits and withdrawals

  • Transaction ID
  • External ID
  • Reference Number (refNo)

Changes

  • Added loanTransactions and savingsTransactions search resources.
  • Extended the global search SQL to return matching loan repayment and savings transaction results.
  • Added transaction metadata to the search response, including transaction ID, transaction type, account ID, account number, account type, external ID, and reference number where applicable.
  • Preserved backward compatibility by adding nullable response fields without changing the existing API contract.
  • Added integration tests covering transaction searches by transaction ID, external ID, and reference number.

Related Issue

FINERACT-2730

Screenshots

N/A

Checklist

  • If you have multiple commits, they have been squashed into a single commit.
  • Read and understood the contribution guidelines.
  • Added or updated tests for the implemented functionality.
  • Verified that existing search functionality continues to work.

@AnvayKharb
AnvayKharb force-pushed the fix/FINERACT-2730-transaction-search branch from 179742a to e4305c4 Compare August 1, 2026 19:22
@AnvayKharb AnvayKharb changed the title fix(FINERACT-2730): add loan and savings transaction search FINERACT-2730: add loan and savings transaction search Aug 1, 2026
@AnvayKharb
AnvayKharb force-pushed the fix/FINERACT-2730-transaction-search branch from e4305c4 to 30895a4 Compare August 1, 2026 19:31
left join m_office o on o.id = coalesce(c.office_id, g.office_id) \
left join m_product_loan pl on pl.id=l.product_id \
where o.hierarchy like :hierarchy \
and lt.transaction_type_enum = 2 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is there a hardcoded filter for the repayment type?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @adamsaghy Thanks for pointing this out. I’ve updated the search SQL to avoid hardcoded transaction type enum values.

The loan transaction search now uses LoanTransactionType.REPAYMENT, and savings transaction search uses SavingsAccountTransactionType.DEPOSIT and SavingsAccountTransactionType.WITHDRAWAL as named SQL parameters.

The search scope is unchanged: loan repayments, savings deposits, and savings withdrawals only.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why to filter on these types?

@AnvayKharb AnvayKharb Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@adamsaghy I kept this filter because the current scope is limited to loan repayments, savings deposits, and savings withdrawals. If you'd prefer it to cover all transaction types, I can update it.

left join m_office o on o.id = coalesce(c.office_id, g.office_id) \
left join m_savings_product sp on sp.id=s.product_id \
where o.hierarchy like :hierarchy \
and st.transaction_type_enum in (1, 2) \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is there a hardcoded filter for the Deposit and Withdrawal type?

@AnvayKharb
AnvayKharb force-pushed the fix/FINERACT-2730-transaction-search branch from 30895a4 to 6e50790 Compare August 3, 2026 16:32
@AnvayKharb
AnvayKharb requested a review from adamsaghy August 3, 2026 16:41
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.

2 participants