Summary
Functions
Return the allowed collections map (jsonb) for policy checks
Return true if this member type can renew loans
Return true if this member type can make reservations
Compute ends_at given a start_date (DateTime) and the member type's
membership_period_days. Returns {:ok, DateTime} or :no_period.
Compute next renewal datetime using recurrence_unit and recurrence_interval.
Return a map summarizing entitlements / quotas for UI or checks
Return true if member type is institutional
Max number of items this member type can borrow
Use for patch-style updates where not all fields are present
Functions
Return the allowed collections map (jsonb) for policy checks
Return true if this member type can renew loans
@spec can_reserve?( t :: %Voile.Schema.Master.MemberType{ __meta__: term(), allowed_collections: term(), auto_renew: term(), can_renew: term(), can_reserve: term(), currency: term(), description: term(), digital_access: term(), exhibition_preview_access: term(), fine_per_day: term(), id: term(), inserted_at: term(), institutional: term(), is_active: term(), max_concurrent_loans: term(), max_days: term(), max_event_bookings_per_year: term(), max_fine: term(), max_items: term(), max_renewals: term(), max_reserves: term(), membership_fee: term(), membership_period_days: term(), metadata: term(), name: term(), priority_level: term(), publicly_listed: term(), recurrence_interval: term(), recurrence_unit: term(), shop_discount_percent: term(), slug: term(), ticket_discount_percent: term(), updated_at: term() } ) :: boolean()
Return true if this member type can make reservations
Compute ends_at given a start_date (DateTime) and the member type's
membership_period_days. Returns {:ok, DateTime} or :no_period.
Example: MemberType.compute_ends_at(member_type, ~U[2025-01-01 00:00:00Z])
Compute next renewal datetime using recurrence_unit and recurrence_interval.
- Supports
recurrence_unit: "days"out of the box. - For
"months"or"years"we recommend using Timex or Calendar operations in your application code because months/years are variable-length. Returns{:ok, DateTime}|:not_applicable|{:error, reason}.
Return a map summarizing entitlements / quotas for UI or checks
Return true if member type is institutional
Max number of items this member type can borrow
Use for patch-style updates where not all fields are present