Manufacturers — company directory used as the source of items.
Hard-deletes only (manufacturers are reference data, not user content).
Status field is "active" / "inactive"; inactive manufacturers
remain in the DB but are filtered from item dropdowns.
Public surface is re-exported from PhoenixKitCatalogue.Catalogue via
defdelegate, so callers can keep using the canonical context module.
Summary
Functions
Returns a changeset for tracking manufacturer changes.
Creates a manufacturer.
Hard-deletes a manufacturer from the database.
Fetches a manufacturer by UUID. Returns nil if not found.
Fetches a manufacturer by UUID. Raises Ecto.NoResultsError if not found.
Lists all manufacturers, ordered by name.
Updates a manufacturer with the given attributes.
Functions
@spec change_manufacturer(PhoenixKitCatalogue.Schemas.Manufacturer.t(), map()) :: Ecto.Changeset.t(PhoenixKitCatalogue.Schemas.Manufacturer.t())
Returns a changeset for tracking manufacturer changes.
@spec create_manufacturer( map(), keyword() ) :: {:ok, PhoenixKitCatalogue.Schemas.Manufacturer.t()} | {:error, Ecto.Changeset.t(PhoenixKitCatalogue.Schemas.Manufacturer.t())}
Creates a manufacturer.
Required attributes
:name— manufacturer name (1-255 chars)
Optional attributes
:description,:website,:contact_info,:logo_url,:notes:status—"active"(default) or"inactive":data— flexible JSON map
@spec delete_manufacturer( PhoenixKitCatalogue.Schemas.Manufacturer.t(), keyword() ) :: {:ok, PhoenixKitCatalogue.Schemas.Manufacturer.t()} | {:error, Ecto.Changeset.t(PhoenixKitCatalogue.Schemas.Manufacturer.t())}
Hard-deletes a manufacturer from the database.
@spec get_manufacturer(Ecto.UUID.t()) :: PhoenixKitCatalogue.Schemas.Manufacturer.t() | nil
Fetches a manufacturer by UUID. Returns nil if not found.
@spec get_manufacturer!(Ecto.UUID.t()) :: PhoenixKitCatalogue.Schemas.Manufacturer.t()
Fetches a manufacturer by UUID. Raises Ecto.NoResultsError if not found.
@spec list_manufacturers(keyword()) :: [PhoenixKitCatalogue.Schemas.Manufacturer.t()]
Lists all manufacturers, ordered by name.
Options
:status— filter by status (e.g."active","inactive"). When nil (default), returns all manufacturers.
@spec update_manufacturer( PhoenixKitCatalogue.Schemas.Manufacturer.t(), map(), keyword() ) :: {:ok, PhoenixKitCatalogue.Schemas.Manufacturer.t()} | {:error, Ecto.Changeset.t(PhoenixKitCatalogue.Schemas.Manufacturer.t())}
Updates a manufacturer with the given attributes.