Parity PR 3: the *_api entry points, the policy slice, store cases (#4) #13
Loading…
Reference in a new issue
No description provided.
Delete branch "mercurius/4-pr3-entry-points"
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): phoenix's commands enter through the same
*_apientry points as mcl-bookclub's. The LiveView calls them instead of minting ids inline, the plan_party policy lives in its own slice and builds its command first, and every slice has store cases. This is PR 3 of #4, the entry-point, policy and store-case part of gap table H.3. The evoq_command_handler adoption follows in PR 3b, stacked on this one.Refs #4
What changes (in commit order)
7f9ed6b, the 9*_apientry points, one per slice folder, mirroring E's<slice>_api.erl.admin_live.excalls them. A blank id field is left out of the params, so the api mints it. The club-name enrichment stays in the admin, as in E'smcl_bookclub_admin.erl:100-108.test/admin_api_test.exs: one store case per entry point, plus empty-params refusals.8655afa, the policy slice.on_member_registered_v1_maybe_plan_party/is its own folder, as in E.PlanPartyV1before dispatching (E :52-62).interested_in/0readsMemberRegisteredV1.event_type().cad2eb3, store cases for member register/unregister, book procure/retire and reading start/finish, the §F rows. Each covers its own stream, a second command refused, the lifecycle guard, an unborn stream refused, and a rejected stream id never reaching the store.Closes gap rows: §B all 9 "API missing"; §C policy; §F register/unregister, procure/retire, start/finish, policy and admin API entry points.
Not closed here: H.3's "the handlers'
dispatch/1takes the built command and stamps the timestamp" and §B's 9 handler "dispatch shape" rows. They belong to PR 3b (#14).Where it differs from mcl-bookclub, and why
dispatch/1runs the struct back throughnew/1. Everynew/1reads fields by key, so it is accepted. PR 3b makesdispatch/1take the built command through:evoq_command_handler. Splitting there kept each PR within one review.handle_event/4directly. It calls it with registrations dispatched to the real store and read back, instead of starting E's subscription. It stopsHostBookclub.Application's own policy child while it runs and restarts it inon_exit. That child hears every registration from every test module, and it would plan parties of its own.Checks (msi00, CI image @sha256:8219e637…, at this tip
cad2eb3)format --check-formatted, compile--warnings-as-errors, credo--strict, dialyzer: all rc 0Mutants killed:
Landed by fast-forward: main is
cad2eb3948(fromcbe8061c), PASS r=1, CI 6176, 6177. This repository does not allow the manually-merged style, so the PR is closed by hand.Pull request closed