commanded_messaging
commanded_messaging copied to clipboard
Validation done in commanded middleware
Main changes:
- commands are created with
ExConstructor(similarly how its done with eventsnew/1) without validation and any casting at that point - commands have validate function which takes struct data and validates it
- commands do not import all
Ecto.Changeset, but only needed functions - validation done in middleware (seems to be more idiomatic way how to integrate with commanded)
-
- on failure: halts command execution, returns changeset
-
- on success: applies changes and updates command values, proceeds
- removed event version specific handling as it can be done manually for those who please.
- events have explicit test for default values
- contains: https://github.com/trbngr/commanded_messaging/pull/3