One span in a staff person's employment history (core V136).
Each row records an employment period: the employment_type, a translatable
job_title, the org placement at the time (primary_department_uuid plus a
primary_team_uuid snapshot), the date range (employment_end_date nil =
the open/current span), work_location, and free-text notes.
The DB enforces at most one open span per person (partial unique index on
staff_person_uuid WHERE employment_end_date IS NULL); PhoenixKitStaff.Employments
is the sole write path and closes the prior open span when a new one starts,
then denormalizes the current span onto Person (sync_current/1).
job_title is translatable (same translations JSONB shape as Person/Skill).
Summary
Functions
Translated job_title in lang (primary-column fallback).
Whether this span is the open/current one (no end date).
DB-column field names that participate in the translations JSONB.
Types
@type t() :: %PhoenixKitStaff.Schemas.Employment{ __meta__: term(), department: PhoenixKitStaff.Schemas.Department.t() | Ecto.Association.NotLoaded.t() | nil, employment_end_date: Date.t() | nil, employment_start_date: Date.t() | nil, employment_type: String.t() | nil, inserted_at: DateTime.t() | nil, job_title: String.t() | nil, notes: String.t() | nil, person: PhoenixKitStaff.Schemas.Person.t() | Ecto.Association.NotLoaded.t() | nil, primary_department_uuid: UUIDv7.t() | nil, primary_team_uuid: UUIDv7.t() | nil, staff_person_uuid: UUIDv7.t() | nil, team: PhoenixKitStaff.Schemas.Team.t() | Ecto.Association.NotLoaded.t() | nil, translations: translations_map(), updated_at: DateTime.t() | nil, uuid: UUIDv7.t() | nil, work_location: String.t() | nil }
Functions
@spec changeset(t() | Ecto.Changeset.t(t()), map()) :: Ecto.Changeset.t(t())
Translated job_title in lang (primary-column fallback).
Whether this span is the open/current one (no end date).
@spec translatable_fields() :: [String.t()]
DB-column field names that participate in the translations JSONB.