docs: add @moduledoc to core membership resources
Add comprehensive module documentation to Member, Property, PropertyType, and Email. Improves code discoverability and enables ExDoc generation.
This commit is contained in:
parent
20af015da6
commit
409bc7bf2f
4 changed files with 141 additions and 0 deletions
|
|
@ -1,4 +1,36 @@
|
|||
defmodule Mv.Membership.Member do
|
||||
@moduledoc """
|
||||
Ash resource representing a club member.
|
||||
|
||||
## Overview
|
||||
Members are the core entity in the membership management system. Each member
|
||||
can have:
|
||||
- Personal information (name, email, phone, address)
|
||||
- Optional link to a User account (1:1 relationship)
|
||||
- Dynamic custom properties via PropertyType system
|
||||
- Full-text searchable profile
|
||||
|
||||
## Email Synchronization
|
||||
When a member is linked to a user account, emails are automatically synchronized
|
||||
bidirectionally. User.email is the source of truth on initial link.
|
||||
See `Mv.EmailSync` for details.
|
||||
|
||||
## Relationships
|
||||
- `has_many :properties` - Dynamic custom fields
|
||||
- `has_one :user` - Optional authentication account link
|
||||
|
||||
## Validations
|
||||
- Required: first_name, last_name, email
|
||||
- Email format validation (using EctoCommons.EmailValidator)
|
||||
- Phone number format: international format with 6-20 digits
|
||||
- Postal code format: exactly 5 digits (German format)
|
||||
- Date validations: birth_date and join_date not in future, exit_date after join_date
|
||||
- Email uniqueness: prevents conflicts with unlinked users
|
||||
|
||||
## Full-Text Search
|
||||
Members have a `search_vector` attribute (tsvector) that is automatically
|
||||
updated via database trigger. Search includes name, email, notes, and contact fields.
|
||||
"""
|
||||
use Ash.Resource,
|
||||
domain: Mv.Membership,
|
||||
data_layer: AshPostgres.DataLayer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue