Skip to content

feat: delete account holders in the account and bank cascades - #2960

Closed
hongwei1 wants to merge 2 commits into
OpenBankProject:developfrom
hongwei1:feature/cascade-delete-account-holders
Closed

hongwei1 wants to merge 2 commits into
OpenBankProject:developfrom
hongwei1:feature/cascade-delete-account-holders

Conversation

@hongwei1

@hongwei1 hongwei1 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

The account cascade (DELETE /obp/v4.0.0/management/cascading/banks/{BANK_ID}/accounts/{ACCOUNT_ID}) now also deletes the account holder rows (MapperAccountHolders) of the deleted bank_id/account_id, and the bank cascade removes them for every account of the bank, since it deletes each account through the account cascade. Holders of an account with the same ACCOUNT_ID at another bank are kept. With the holder gone, a later refresh of the former holder's accounts (AuthUser.refreshUser, which runs for example when that user creates another account) no longer grants the owner, ManageCustomViews and Berlin Group system views on the deleted account.

DeleteAccountCascadeTest covers the holder removal, the other-bank holder being kept, and that neither reading the deleted account as the former holder nor creating another account brings its account access back; DeleteBankCascadeTest covers the holders of a deleted bank's accounts. Not covered yet: holder rows left behind by accounts deleted before this change.

DeleteAccountCascade now removes the MapperAccountHolders rows of the
deleted bank_id/account_id, and DeleteBankCascade removes them for every
account of the bank through it. A holder row that outlived its account was
read back by AuthUser.refreshUser (for example when the former holder
created another account) and the five system views were granted on the
deleted account again.
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@hongwei1

hongwei1 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Combined with #2959, #2960 and #2961 into #2962, which carries the same commits as one change.

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