Parity PR 3b: desks implement :evoq_command_handler (#4) #14
Loading…
Reference in a new issue
No description provided.
Delete branch "mercurius/4-pr3b-evoq-command-handler"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (feature): every phoenix desk declares evoq's
:evoq_command_handlerbehaviour (evoq 1.31.1), as mcl-bookclub's do (macula-services/mcl-bookclub#4, PASS). The rule, the wiring and the dispatch read the same in every slice, and a miswired desk fails a test instead of its first command. This is PR 3b of #4. It was stacked on PR 3 (#13), which has landed (maincad2eb39), so its base is now main.Refs #4, reckon-db-org/evoq#3
What changes (in commit order)
0e345de, adoption.@behaviour :evoq_command_handler, with@imploncommand_module/0andhandle/2; the rule is unchanged.handle_from_map/2glue is gone.dispatch/1takes the BUILT command and is one call to:evoq_command_handler.dispatch/3, with timestamp metadata and the same store options. This closes §B's 9 "dispatch shape" rows.command_handlers/0, keyed by each command'scommand_type(), never the Elixir module name.execute/2keeps its lifecycle guard, then calls:evoq_command_handler.route/3.{:evoq, "~> 1.31.1"}; no other app's pin changes.5805cec,test/command_handlers_test.exs::evoq_command_handler.check_handlers/1asserts:okfor each of the 4 aggregates.c68681e, a §B row 1 one-liner:InitiateBookclubV1.from_map/1no longer passes a strayclub_name.Behaviour notes (as in mcl-bookclub#4)
:unknown_command, because the guard runs first.from_map/1is preferred overnew/1when it is exported.Checks (msi00, CI image @sha256:8219e637…, at this tip
c68681e, evoq 1.31.1 from hex.pm)--warnings-as-errors, credo--strict, dialyzer: all rc 0Mutants, each killed:
command_module/0: CommandHandlersTestcommand_handlers/0entry: 3 ProcureBookStoreTest casesLanded by fast-forward: main is
ac1fd97cb7(fromcad2eb39), PASS r=1, CI 6191, 6192. This repository does not allow the manually-merged style, so the PR is closed by hand.Pull request closed