Member show: Vereinfacht link only, receipts table from API

- Show only 'Kontakt in Vereinfacht anzeigen' link (no Contact ID / Debug)
- Button loads receipts via get_contact_with_receipts, table with formatted columns
This commit is contained in:
Moritz 2026-02-23 19:21:24 +01:00
parent ede3df12ef
commit b60ab3f392
Signed by: moritz
GPG key ID: 1020A035E5DD0824
2 changed files with 172 additions and 32 deletions

View file

@ -256,7 +256,7 @@ defmodule MvWeb.MemberLive.Show do
id={"membership-fees-#{@member.id}"}
member={@member}
current_user={@current_user}
vereinfacht_debug_response={@vereinfacht_debug_response}
vereinfacht_receipts={@vereinfacht_receipts}
/>
<% end %>
</Layouts.app>
@ -268,7 +268,7 @@ defmodule MvWeb.MemberLive.Show do
{:ok,
socket
|> assign(:active_tab, :contact)
|> assign(:vereinfacht_debug_response, nil)}
|> assign(:vereinfacht_receipts, nil)}
end
@impl true
@ -320,14 +320,14 @@ defmodule MvWeb.MemberLive.Show do
{:noreply, assign(socket, :active_tab, :membership_fees)}
end
def handle_event("load_vereinfacht_debug", %{"contact_id" => contact_id}, socket) do
def handle_event("load_vereinfacht_receipts", %{"contact_id" => contact_id}, socket) do
response =
case Mv.Vereinfacht.Client.get_contact(contact_id) do
{:ok, body} -> {:ok, body}
case Mv.Vereinfacht.Client.get_contact_with_receipts(contact_id) do
{:ok, receipts} -> {:ok, receipts}
{:error, reason} -> {:error, reason}
end
{:noreply, assign(socket, :vereinfacht_debug_response, response)}
{:noreply, assign(socket, :vereinfacht_receipts, response)}
end
# Flash set in LiveComponent is not shown in parent layout; child sends this to display flash