Clean up Member leftovers: unused field-visibility helper and cycle-log initiator #588

Closed
opened 2026-10-14 00:38:34 +02:00 by moritz · 0 comments
Owner

Motivation

The Member resource split (#537) kept two pre-existing quirks unchanged on purpose, because that issue
was limited to behavior-preserving moves. Both are small and touch the extracted Member modules, so they
are bundled here.

Scope (ordered steps, CI green each)

  • Step 1: remove the unused field-visibility helper.
    Mv.Membership.Member.FieldVisibility.show_in_overview?/1
    (lib/mv/membership/member/field_visibility.ex) has no production caller; only its own doctests and
    test/mv/membership/member/field_visibility_test.exs call it. The live overview reads the visibility
    setting through MvWeb.MemberLive.Index.FieldVisibility, so there are now two modules named
    FieldVisibility with overlapping responsibility. Delete the module and its test file, and remove its
    entry from the CODE_GUIDELINES §1.1 tree. Keep the update_single_member_field_visibility/3 tests in
    test/mv/membership/member_field_visibility_test.exs – they cover live Settings code.
  • Step 2: log the real initiator of cycle generation.
    Mv.Membership.Member.Changes.GenerateCyclesAfterTransaction reads the initiator from the top-level
    :actor key of changeset.context. Nothing sets that key – Ash keeps the action's actor under
    context.private.actor – so the cycle-generation log always says initiator: system, even when an
    admin created or edited the member. Take the actor from the change/3 context (context.actor) and
    update the module doc that currently documents the workaround.

Acceptance criteria

  • show_in_overview?/1 and its module are gone; no other FieldVisibility module than the overview one
    remains in lib/; the Settings visibility tests still run.
  • Creating a member with a fee type and join date as a given actor logs
    Successfully generated cycles for member (initiator: <actor email>); a call without an actor still
    logs system. Covered by a test that captures the log.
  • just ci-dev green after each step.

Dependencies

Run after #537 (the modules are only at these paths once the Member split is merged).

## Motivation The Member resource split (#537) kept two pre-existing quirks unchanged on purpose, because that issue was limited to behavior-preserving moves. Both are small and touch the extracted Member modules, so they are bundled here. ## Scope (ordered steps, CI green each) - Step 1: remove the unused field-visibility helper. `Mv.Membership.Member.FieldVisibility.show_in_overview?/1` (`lib/mv/membership/member/field_visibility.ex`) has no production caller; only its own doctests and `test/mv/membership/member/field_visibility_test.exs` call it. The live overview reads the visibility setting through `MvWeb.MemberLive.Index.FieldVisibility`, so there are now two modules named `FieldVisibility` with overlapping responsibility. Delete the module and its test file, and remove its entry from the CODE_GUIDELINES §1.1 tree. Keep the `update_single_member_field_visibility/3` tests in `test/mv/membership/member_field_visibility_test.exs` – they cover live Settings code. - Step 2: log the real initiator of cycle generation. `Mv.Membership.Member.Changes.GenerateCyclesAfterTransaction` reads the initiator from the top-level `:actor` key of `changeset.context`. Nothing sets that key – Ash keeps the action's actor under `context.private.actor` – so the cycle-generation log always says `initiator: system`, even when an admin created or edited the member. Take the actor from the `change/3` context (`context.actor`) and update the module doc that currently documents the workaround. ## Acceptance criteria - `show_in_overview?/1` and its module are gone; no other `FieldVisibility` module than the overview one remains in `lib/`; the Settings visibility tests still run. - Creating a member with a fee type and join date as a given actor logs `Successfully generated cycles for member (initiator: <actor email>)`; a call without an actor still logs `system`. Covered by a test that captures the log. - `just ci-dev` green after each step. ## Dependencies Run after #537 (the modules are only at these paths once the Member split is merged).
simon closed this issue 2026-10-14 16:51:37 +02:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
local-it/mitgliederverwaltung#588
No description provided.