Skip to content

feature: transaction search on Primary and Savings account pages (UserFront) - #632

Open
matthewguerra-cog wants to merge 2 commits into
masterfrom
devin/task-12-transaction-search
Open

matthewguerra-cog wants to merge 2 commits into
masterfrom
devin/task-12-transaction-search

Conversation

@matthewguerra-cog

@matthewguerra-cog matthewguerra-cog commented Nov 16, 2026 •

Copy link
Copy Markdown

Summary

Adds a filter panel above the transaction table on /account/primaryAccount and /account/savingsAccount: date range, type (deposit / withdraw / transfer), min / max amount, and free text on description. Filtering runs in the database, the form is a plain GET so the filters live in the query string (reload and links keep them), and there's a Clear filters link plus an empty state. No schema change.

GET /account/primaryAccount?from=2026-11-01&to=2026-11-16&type=transfer&minAmount=50&maxAmount=500&q=jane
  • TransactionFilter (form object, bound with @ModelAttribute("filter") + BindingResult, so a bad value like minAmount=abc is ignored instead of a 400).
  • TransactionSpecifications.forAccount(accountField, account, filter) builds one JPA Specification used for both entities; Primary/SavingsTransactionDao now also extend JpaSpecificationExecutor. Results are ordered by date, id.
  • Type is matched on description, not the type column. The app stores deposits, withdrawals and Primary→Savings transfers all as type = "Account", so the column can't tell them apart. deposit → description LIKE 'deposit%', withdraw → 'withdraw%', transfer → '%transfer%' (case-insensitive).
  • from / to bind as LocalDate and become midnight in the server's zone, so the selected day is kept on servers west of UTC (a java.util.Date bound with ISO format parses at UTC midnight and shifted back a day; TransactionFilterDateTest binds under America/Los_Angeles to cover it). Date range is inclusive of the whole to day; amount range is inclusive; free text is case-insensitive with %/_ escaped.
  • Shared Thymeleaf fragment common/transactionFilter.html (filterForm, emptyState), Bootstrap 3 panel styling to match the pages. DataTables' own client-side search box is turned off (searching: false) so there's one search, not two; its sorting and paging are unchanged.
  • TransactionSearchTest (@DataJpaTest on H2, test-scope dependency only) covers each filter, combinations, account scoping and the empty result.

mvn -B package is green on JDK 8 (9 tests). Note: UserFrontApplicationTests.contextLoads needs the MySQL from application.properties; against a current MySQL 5.7 the old connector needs ?useSSL=false on the URL (pre-existing, not changed here).

Out of scope

The test-scope h2 inherits 1.4.195 from Boot 1.5.4, which has CVE-2021-42392 (H2 Console RCE). It is only on the test classpath, not in the packaged jar, and no console is started; left for the Boot upgrade.

Overlapping open PRs

No open PR adds transaction search. These touch the same files and will need a rebase depending on merge order: #360 (paginate transaction history, same handlers/templates), #357 (load User once in the same handlers), #352 / #350 (remove the DAOs' findAll()), #343 (@GetMapping in AccountController). Clear of the Boot 3 upgrade PRs (#605, #623–#625).

Screenshot (sample data, type=transfer on Primary)

Primary account filtered to transfers

Devin-Org: engineering


Product Engineer opened this PR for Matthew
Implemented in session Build transaction search in Online Banking UserFront
Review with Devin · Open in Devin Desktop


…count pages

Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@socket-security

socket-security Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedmaven/​com.h2database/​h2@​1.4.19536259010070

View full report

@socket-security

socket-security Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Priority Alert  (click "▶" to expand/collapse) Action
Medium priority
Critical CVE: Arbitrary code execution in H2 Console in maven com.h2database:h2

CVE: GHSA-45hx-wfhj-473x Arbitrary code execution in H2 Console (CRITICAL)

Affected versions: < 2.1.210

Patched version: 2.1.210

From: UserFront/pom.xml → maven/com.h2database/h2@1.4.195

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/com.h2database/h2@1.4.195. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Medium priority
Critical CVE: RCE in H2 Console in maven com.h2database:h2

CVE: GHSA-h376-j262-vhq6 RCE in H2 Console (CRITICAL)

Affected versions: >= 1.1.100 < 2.0.206

Patched version: 2.0.206

From: UserFront/pom.xml → maven/com.h2database/h2@1.4.195

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/com.h2database/h2@1.4.195. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 4 potential issues.

Custom reviewers

  • 🧪 Test 2 reviewer: no findings · View
  • 🚩 TD Enterprise Architecture: no findings · View
  • 👁️ TD Information Security: 1 finding · View
  • 🧠 TD French Language (Bill 96): 2 findings · View
  • ⏱️ TD API Contracts: no findings · View

Devin Review

Comment thread UserFront/pom.xml
Comment on lines +58 to +61
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👁️ TD Information Security: Critically vulnerable H2 test dependency

h2 inherits version 1.4.195 from Spring Boot 1.5.4.RELEASE, introducing critical CVE-2021-42392 against the Dependencies criterion. The vulnerability permits remote code execution when an H2 Console accepts untrusted remote connections. Test scope excludes production packaging; these tests do not expose that console.

View in Devin Review · Custom reviewer

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.


<div th:fragment="filterForm(actionUrl)" class="panel panel-default transaction-filter">
<div class="panel-heading">
<strong><i class="fa fa-filter" aria-hidden="true"></i> Search transactions</strong>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧠 TD French Language (Bill 96): Transaction search copy stays English

On both account pages, filterForm displays “Search transactions” and other English labels without locale keys. emptyState and result counts also stay English. Add transactionSearch.title with fr-CA “Rechercher des opérations” and localize the remaining filter, count, and empty-state copy.

View in Devin Review · Custom reviewer

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

<div class="form-group col-sm-4 col-md-2">
<label for="minAmount">Min amount</label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-usd" aria-hidden="true"></i></span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧠 TD French Language (Bill 96): French amount filters show leading dollars

For fr-CA, minAmount and maxAmount display a dollar sign before the value. Place the sign after the input for French currency order, as in 1 250,00 $.

View in Devin Review · Custom reviewer

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration

Copy link
Copy Markdown

Ran it in the browser against the built jar on MySQL 5.7 with sample users only. Every filter on Primary and Savings, all six combined, reload keeping the query params, Clear filters, both empty states, malformed values (minAmount=abc), and cross-user isolation behave as expected; the SQL log shows the filter running server-side and scoped to the account. Not covered: multi-page pagination (largest sample account had 5 rows) and mobile layout.

Primary, type = Transfer
Primary filtered to transfers

Primary, all six filters combined
Primary with combined filters

Savings
Savings filtered

Recording (first 2 min, 4 fps)
Browser run

Written by Devin

…st of UTC

Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

Date fix 71c9d58 checked in the browser with the JVM on America/Los_Angeles, MySQL 5.7 sample data.

Primary — Nov 3 only Savings — Nov 3 only
Primary single-day Savings single-day
  • Single-day filter keeps the selected day's 00:30 and 23:30 rows and excludes Nov 2 23:30 / Nov 4 00:30, on both pages; a Nov 3–4 range returns exactly the expected rows.
  • Reload keeps the selected dates (no shift); Clear filters resets; type/amount/description filters still work; no errors in the log.
  • Not exercised: other zones and DST-change dates.

Recording

Written by Devin

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