docs: Update domain Public API documentation

This commit is contained in:
Moritz 2026-01-20 15:38:06 +01:00
parent 4fe30d9546
commit 9c2cff6307
Signed by: moritz
GPG key ID: 1020A035E5DD0824
8 changed files with 36 additions and 7 deletions

View file

@ -1,6 +1,15 @@
defmodule Mv.Accounts do defmodule Mv.Accounts do
@moduledoc """ @moduledoc """
AshAuthentication specific domain to handle Authentication for users. AshAuthentication specific domain to handle Authentication for users.
## Resources
- `User` - User accounts with authentication methods (password, OIDC)
- `Token` - Session tokens for authentication
## Public API
The domain exposes these main actions:
- User CRUD: `create_user/1`, `list_users/0`, `update_user/2`, `destroy_user/1`
- Authentication: `create_register_with_rauthy/1`, `read_sign_in_with_rauthy/1`
""" """
use Ash.Domain, use Ash.Domain,
extensions: [AshAdmin.Domain, AshPhoenix] extensions: [AshAdmin.Domain, AshPhoenix]

View file

@ -1,6 +1,10 @@
defmodule Mv.Accounts.Token do defmodule Mv.Accounts.Token do
@moduledoc """ @moduledoc """
AshAuthentication specific ressource AshAuthentication Token Resource for session management.
This resource is used by AshAuthentication to manage authentication tokens
for user sessions. Tokens are automatically created and managed by the
authentication system.
""" """
use Ash.Resource, use Ash.Resource,
data_layer: AshPostgres.DataLayer, data_layer: AshPostgres.DataLayer,

View file

@ -12,8 +12,8 @@ defmodule Mv.Membership do
The domain exposes these main actions: The domain exposes these main actions:
- Member CRUD: `create_member/1`, `list_members/0`, `update_member/2`, `destroy_member/1` - Member CRUD: `create_member/1`, `list_members/0`, `update_member/2`, `destroy_member/1`
- Custom field value management: `create_custom_field_value/1`, `list_custom_field_values/0`, etc. - Custom field value management: `create_custom_field_value/1`, `list_custom_field_values/0`, etc.
- Custom field management: `create_custom_field/1`, `list_custom_fields/0`, etc. - Custom field management: `create_custom_field/1`, `list_custom_fields/0`, `list_required_custom_fields/0`, etc.
- Settings management: `get_settings/0`, `update_settings/2` - Settings management: `get_settings/0`, `update_settings/2`, `update_member_field_visibility/2`, `update_single_member_field_visibility/3`
## Admin Interface ## Admin Interface
The domain is configured with AshAdmin for management UI. The domain is configured with AshAdmin for management UI.

View file

@ -11,6 +11,8 @@ defmodule Mv.MembershipFees do
- MembershipFeeType CRUD: `create_membership_fee_type/1`, `list_membership_fee_types/0`, `update_membership_fee_type/2`, `destroy_membership_fee_type/1` - MembershipFeeType CRUD: `create_membership_fee_type/1`, `list_membership_fee_types/0`, `update_membership_fee_type/2`, `destroy_membership_fee_type/1`
- MembershipFeeCycle CRUD: `create_membership_fee_cycle/1`, `list_membership_fee_cycles/0`, `update_membership_fee_cycle/2`, `destroy_membership_fee_cycle/1` - MembershipFeeCycle CRUD: `create_membership_fee_cycle/1`, `list_membership_fee_cycles/0`, `update_membership_fee_cycle/2`, `destroy_membership_fee_cycle/1`
Note: LiveViews may use direct Ash calls instead of these domain functions for performance or flexibility.
## Overview ## Overview
This domain handles the complete membership fee lifecycle including: This domain handles the complete membership fee lifecycle including:
- Fee type definitions (monthly, quarterly, half-yearly, yearly) - Fee type definitions (monthly, quarterly, half-yearly, yearly)

View file

@ -7,7 +7,7 @@ defmodule Mv.Authorization do
## Public API ## Public API
The domain exposes these main actions: The domain exposes these main actions:
- Role CRUD: `create_role/1`, `list_roles/0`, `update_role/2`, `destroy_role/1` - Role CRUD: `create_role/1`, `list_roles/0`, `get_role/1`, `update_role/2`, `destroy_role/1`
## Admin Interface ## Admin Interface
The domain is configured with AshAdmin for management UI. The domain is configured with AshAdmin for management UI.

View file

@ -303,7 +303,9 @@ defmodule Mv.Membership.Import.MemberCSV do
{inserted, failed, errors, _collected_error_count, truncated?} = {inserted, failed, errors, _collected_error_count, truncated?} =
Enum.reduce(chunk_rows_with_lines, {0, 0, [], 0, false}, fn {line_number, row_map}, Enum.reduce(chunk_rows_with_lines, {0, 0, [], 0, false}, fn {line_number, row_map},
{acc_inserted, acc_failed, acc_errors, acc_error_count, acc_truncated?} -> {acc_inserted, acc_failed,
acc_errors, acc_error_count,
acc_truncated?} ->
current_error_count = existing_error_count + acc_error_count current_error_count = existing_error_count + acc_error_count
case process_row(row_map, line_number, custom_field_lookup) do case process_row(row_map, line_number, custom_field_lookup) do
@ -325,7 +327,13 @@ defmodule Mv.Membership.Import.MemberCSV do
end end
end) end)
{:ok, %{inserted: inserted, failed: failed, errors: Enum.reverse(errors), errors_truncated?: truncated?}} {:ok,
%{
inserted: inserted,
failed: failed,
errors: Enum.reverse(errors),
errors_truncated?: truncated?
}}
end end
@doc """ @doc """

View file

@ -1,4 +1,10 @@
defmodule MvWeb.PageController do defmodule MvWeb.PageController do
@moduledoc """
Controller for rendering the homepage.
This controller handles the root route and renders the application's
homepage view.
"""
use MvWeb, :controller use MvWeb, :controller
def home(conn, _params) do def home(conn, _params) do

View file

@ -13,7 +13,7 @@ defmodule MvWeb.MemberLive.Form do
## Form Sections ## Form Sections
- Personal Data: Name, address, contact information, membership dates, notes - Personal Data: Name, address, contact information, membership dates, notes
- Custom Fields: Dynamic fields in uniform grid layout (displayed sorted by name) - Custom Fields: Dynamic fields in uniform grid layout (displayed sorted by name)
- Payment Data: Mockup section (not editable) - Membership Fee: Selection of membership fee type with interval validation
## Events ## Events
- `validate` - Real-time form validation - `validate` - Real-time form validation