Top-level organizational unit containing teams.
Translations
name and description are translatable. The primary-language
values stay in the dedicated columns; secondary-language overrides
live in translations (JSONB) keyed by language code, e.g.
%{"es-ES" => %{"name" => "Ingeniería", "description" => "..."}}Reads use localized_name/2 and localized_description/2 with
primary-fallback semantics: an empty / missing override returns
the primary column value.
Summary
Types
JSONB map of secondary-language overrides. Same shape as the
projects module's translations.
Functions
Same as localized_name/2 for description.
Returns the department's name in the requested language. Empty /
missing override falls back to the primary name column.
DB-column field names that participate in the translations JSONB.
Types
@type t() :: %PhoenixKitStaff.Schemas.Department{ __meta__: term(), description: String.t() | nil, inserted_at: DateTime.t() | nil, name: String.t() | nil, teams: [PhoenixKitStaff.Schemas.Team.t()] | Ecto.Association.NotLoaded.t(), translations: translations_map(), updated_at: DateTime.t() | nil, uuid: UUIDv7.t() | nil }
JSONB map of secondary-language overrides. Same shape as the
projects module's translations.
Functions
@spec changeset(t() | Ecto.Changeset.t(t()), map()) :: Ecto.Changeset.t(t())
Same as localized_name/2 for description.
Returns the department's name in the requested language. Empty /
missing override falls back to the primary name column.
lang may be nil (multilang disabled) — in that case the primary
column is returned directly.
@spec translatable_fields() :: [String.t()]
DB-column field names that participate in the translations JSONB.