Repository navigation
Conversation
Cascade-deleting an account or a bank must remove the account's own counterparties with their bespoke fields, metadata, attributes and limits, and must not touch counterparties of an account with the same ACCOUNT_ID at another bank or of another account at the same bank.
DeleteAccountCascade now removes the counterparties the account created, with their bespoke fields, attributes and limits, and the account's counterparty metadata with its locations. Rows are selected by both BANK_ID and ACCOUNT_ID, so another bank's account with the same ACCOUNT_ID keeps its counterparties. Bank and product cascades use the same code and get the same behaviour.
deleteCards looked the account up by ACCOUNT_ID alone, so deleting an account also deleted the cards of an account with the same ACCOUNT_ID at another bank. It now selects the account by BANK_ID and ACCOUNT_ID.
… BANK_ID too deleteEntitlements found the account's users by ACCOUNT_ID alone, so the users of an account with the same ACCOUNT_ID at another bank lost their entitlements at the deleted account's bank. It now selects the account access by BANK_ID and ACCOUNT_ID.
|
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.



Cascade-deleting an account (
DELETE /obp/v4.0.0/management/cascading/banks/BANK_ID/accounts/ACCOUNT_ID, and through it the bank and product cascades) now also removes the counterparties the account created, together with their bespoke fields, counterparty attributes and counterparty limits, and the account's counterparty metadata with its physical and corporate locations. Every step now selects the account by both BANK_ID and ACCOUNT_ID, including the card step and the step that picks the users whose entitlements are removed, so an account with the same ACCOUNT_ID at another bank keeps its counterparties and cards, and its users keep their entitlements. Counterparties of other accounts that point at the deleted account are left untouched.DeleteCascadeCounterpartiesTestcovers the account and bank cascades, asserting that every counterparty table is emptied for the deleted account while a same-ACCOUNT_ID account at another bank and a sibling account at the same bank keep all their rows;DeleteAccountCascadeTestgains scenarios for cards and entitlements across banks. The existing cascade, counterparty, counterparty limit, counterparty attribute and card suites pass. Not covered yet: transaction requests and direct debits that reference a deleted counterparty, and the bank-wide scope of the entitlement step, which is raised in #2954.