PhoenixKitWeb.Live.Settings.Organization (phoenix_kit v2.22.0)

Copy Markdown View Source

Organization settings management LiveView for PhoenixKit.

Provides a unified interface for company information shared between Legal and Billing modules. This includes company details and bank information.

Summary

Functions

Gets the list of bank accounts. A company can have more than one (a EUR operating account and a USD reserve account, say) — each entry carries "uuid", "label", "bank_name", "iban", "swift", "primary".

Gets bank details in the original single-account shape — the PRIMARY bank account's fields (falling back to whichever account comes first if none is marked primary, and to blank if there are no accounts at all).

Gets company info from consolidated key with fallback to legacy keys.

Callback implementation for Phoenix.LiveView.render/1.

Functions

get_bank_accounts()

Gets the list of bank accounts. A company can have more than one (a EUR operating account and a USD reserve account, say) — each entry carries "uuid", "label", "bank_name", "iban", "swift", "primary".

Falls back to migrating the legacy single-account "company_bank_details" setting (from before multi-account support) into a one-entry list marked primary. That migration is computed on every read, not persisted — it costs nothing until the operator actually saves an account, at which point the real list setting takes over.

get_bank_details()

Gets bank details in the original single-account shape — the PRIMARY bank account's fields (falling back to whichever account comes first if none is marked primary, and to blank if there are no accounts at all).

Kept for phoenix_kit_billing, which calls this exact function via a soft dependency (see its core_compat.ex) and has no notion of multiple accounts. New code wanting the full list should call get_bank_accounts/0.

get_company_info()

Gets company info from consolidated key with fallback to legacy keys.

handle_event(binary, params, socket)

Callback implementation for Phoenix.LiveView.handle_event/3.

handle_info(arg, socket)

Callback implementation for Phoenix.LiveView.handle_info/2.

handle_params(params, url, socket)

Callback implementation for Phoenix.LiveView.handle_params/3.

mount(params, session, socket)

Callback implementation for Phoenix.LiveView.mount/3.

render(assigns)

Callback implementation for Phoenix.LiveView.render/1.