Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AccountInfo.identifier.externalId more usable #105

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

manosbatsis
Copy link

@manosbatsis manosbatsis commented Dec 22, 2020

Needed to add/link more data with a Corda Account. After looking at issues, i found #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:

  • CreateAccount flow 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.externalId to allow creating VaultCustomQueryCriteria with 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 AccountInfoByExternalId flow on par with AccountInfoByXX flows that already exist.
  • Added an alternative constructor to CreateAccount flow to set linearId.externalId when creating accounts.
  • Added an AccountService.accountInfoByExternalId method, had to break the convention and add a suffix as the accountInfo(String) signature is already used for querying by name.
  • Added an accountExternalIdCriteria utility method per what seems as a convention within the workflows module.
  • Added Create and query accounts by externalId in AccountInfoTests, to ensure users can query by externalId after creating, receiving or requesting accounts.
  • Added RequestHostedAccountInfoByExternalId... flow variants.

I state that this PR is in accordance with the Developer's Certificate of Origin.

Added PersistentAccountInfo.externalId, AccountInfoByExternalId flow, alternative constructor for the CreateAccount flow, AccountService.accountInfoByExternalId method, accountExternalIdCriteria utility method, database migration scripts for making externalId query-able
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