Skip to content

feat: cascade account deletion to transaction requests, challenges and double-entry rows - #2958

Merged
simonredfern merged 2 commits into
OpenBankProject:developfrom
hongwei1:feature/cascade-delete-double-entry-and-challenges
Nov 3, 2026
Merged

simonredfern merged 2 commits into
OpenBankProject:developfrom
hongwei1:feature/cascade-delete-double-entry-and-challenges

Conversation

@hongwei1

@hongwei1 hongwei1 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

DELETE /obp/v4.0.0/management/cascading/banks/{BANK_ID}/accounts/{ACCOUNT_ID} now also removes the account's payment records: every transaction request the account paid from (including requests that never produced a transaction, such as ones still waiting for a challenge answer), the expected challenge answers of those requests, and the double-entry book rows whose debit or credit side is on the account. Because a double-entry row describes both sides of one payment, deleting either account removes the row. DELETE /obp/v4.0.0/management/cascading/banks/{BANK_ID} deletes each account through the same code and so removes the same records.

New scenarios in DeleteAccountCascadeTest and DeleteBankCascadeTest make one payment below the challenge threshold (completed, booked in the double-entry book) and one above it (INITIATED, with a challenge), run the cascade, and check that no double-entry row, transaction request or challenge of the account is left. Not covered yet: transaction request attributes and reasons, and challenges of requests removed by the single-transaction cascade.

…llenges and double-entry rows

Deleting an account by cascade now removes the transaction requests it
paid from, including ones without a transaction yet, the expected
challenge answers of those requests, and the double-entry book rows on
either side of the account. Bank cascade deletion inherits this, since
it deletes each account through DeleteAccountCascade.
…into feature/cascade-delete-double-entry-and-challenges

# Conflicts:
#	obp-api/src/main/scala/deletion/DeleteAccountCascade.scala
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@simonredfern
simonredfern merged commit 6a4a13e into OpenBankProject:develop Nov 3, 2026
2 checks passed
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