The contact ↔ company link (many-to-many), carrying free-form
role_in_company and department on the edge, plus an is_primary flag.
The v1 UI presents a single primary membership per contact (a company + role + department block), but the schema is M:N so a contact can relate to several companies without a later reshape.
Summary
Types
@type t() :: %PhoenixKitCRM.Schemas.CompanyMembership{ __meta__: term(), company: PhoenixKitCRM.Schemas.Company.t() | Ecto.Association.NotLoaded.t() | nil, company_uuid: UUIDv7.t() | nil, contact: PhoenixKitCRM.Schemas.Contact.t() | Ecto.Association.NotLoaded.t() | nil, contact_uuid: UUIDv7.t() | nil, department: String.t() | nil, inserted_at: DateTime.t() | nil, is_primary: boolean(), position: integer(), role_in_company: String.t() | nil, updated_at: DateTime.t() | nil, uuid: UUIDv7.t() | nil }
Functions
@spec changeset(t() | Ecto.Changeset.t(t()), map()) :: Ecto.Changeset.t(t())