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

Include custom metadata during command dispatch #85

Merged
merged 2 commits into from Oct 1, 2017

Conversation

slashdotdash
Copy link
Member

@slashdotdash slashdotdash commented Oct 1, 2017

Allow metadata to be provided when dispatching a command:

command = %OpenAccount{account_number: "ACC123", initial_balance: 1_000}
metadata = %{"user_id" => "user-12345", "ip_address" => "127.0.0.1"}

:ok = BankRouter.dispatch(command, metadata: metdata)

The optional metadata is recorded against all events created by the command. This is useful for additional auditing purposes, such as recording the user's identity, their source IP address, etc.

Fixes #61.

Thanks to @sammkj for implementing this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant