accounts
accounts copied to clipboard
Make AccountInfo.identifier.externalId more usable
Needed to add/link more data with a Corda Account. After looking at issues, i found https://github.com/corda/accounts/issues/77 where @roger3cev naturally makes the reasonable proposal of using the linearId's externalId to map with client application concerns.
However, an AccountInfo's externalId is impossible to use with the current version of master, mainly because:
CreateAccountflow doesn't allow setting an (optional) externalId.- The field is not available for queries in
PersistentAccountInfo.
This PR tries to accommodate users that need to utilise externalId accordingly with the following minimal changes:
- Added
PersistentAccountInfo.externalIdto allow creatingVaultCustomQueryCriteriawith it . - Added database migration changesets per RDBMS vendor for the above which seems somewhat redundant but in accordance to my understanding of current project conventions (without adding even more files though). Tested on CE 4.6.1.
- Added
AccountInfoByExternalIdflow on par withAccountInfoByXXflows that already exist. - Added an alternative constructor to
CreateAccountflow to setlinearId.externalIdwhen creating accounts. - Added an
AccountService.accountInfoByExternalIdmethod, had to break the convention and add a suffix as theaccountInfo(String)signature is already used for querying by name. - Added an
accountExternalIdCriteriautility method per what seems as a convention within the workflows module. - Added
Create and query accounts by externalIdinAccountInfoTests, to ensure users can query byexternalIdafter creating, receiving or requesting accounts. - Added
RequestHostedAccountInfoByExternalId...flow variants.
I state that this PR is in accordance with the Developer's Certificate of Origin.