This PR fixes the bug where bank accounts where deleted before a new one was created, resulting in deleting all bank accounts when there was an error.
It's done by first getting all bank accounts for that customer, then creating a new account, then deleting all of the old ones (most of the time that should be just a single one).
Testing
Testing this is hard, so bring some time.
First, follow the steps lined out in this PR, to be able to do and bail out of the KYC flow
Then, create a bank account using USD
Then, update this bank account to use EUR instead of USD and fill all the forms (EUR will not work in the sandbox and produce an error similar to the one in the issue)
Then see that the bank details are not deleted
Diffs
New stuff ✨
Add a getExternalAccounts helper method in the bridgeXYZMutation
Changes 🏗
Create a new bank account first, then delete old ones
Delete all old accounts should there be more than one
Description
This PR fixes the bug where bank accounts where deleted before a new one was created, resulting in deleting all bank accounts when there was an error.
It's done by first getting all bank accounts for that customer, then creating a new account, then deleting all of the old ones (most of the time that should be just a single one).
Testing
Testing this is hard, so bring some time.
Diffs
New stuff ✨
getExternalAccounts
helper method in thebridgeXYZMutation
Changes 🏗
Resolves #2963