Suppliers — delivery companies linked to manufacturers via the
many-to-many phoenix_kit_cat_manufacturer_suppliers table.
Same lifecycle as manufacturers: hard-delete only, "active" /
"inactive" status.
Public surface is re-exported from PhoenixKitCatalogue.Catalogue.
Summary
Functions
Returns a changeset for tracking supplier changes.
Creates a supplier.
Hard-deletes a supplier from the database.
Fetches a supplier by UUID. Returns nil if not found.
Fetches a supplier by UUID. Raises Ecto.NoResultsError if not found.
Lists all suppliers, ordered by name.
Updates a supplier with the given attributes.
Functions
@spec change_supplier(PhoenixKitCatalogue.Schemas.Supplier.t(), map()) :: Ecto.Changeset.t(PhoenixKitCatalogue.Schemas.Supplier.t())
Returns a changeset for tracking supplier changes.
@spec create_supplier( map(), keyword() ) :: {:ok, PhoenixKitCatalogue.Schemas.Supplier.t()} | {:error, Ecto.Changeset.t(PhoenixKitCatalogue.Schemas.Supplier.t())}
Creates a supplier.
Required attributes
:name— supplier name (1-255 chars)
Optional attributes
:description,:website,:contact_info,:notes:status—"active"(default) or"inactive":data— flexible JSON map
@spec delete_supplier( PhoenixKitCatalogue.Schemas.Supplier.t(), keyword() ) :: {:ok, PhoenixKitCatalogue.Schemas.Supplier.t()} | {:error, Ecto.Changeset.t(PhoenixKitCatalogue.Schemas.Supplier.t())}
Hard-deletes a supplier from the database.
@spec get_supplier(Ecto.UUID.t()) :: PhoenixKitCatalogue.Schemas.Supplier.t() | nil
Fetches a supplier by UUID. Returns nil if not found.
@spec get_supplier!(Ecto.UUID.t()) :: PhoenixKitCatalogue.Schemas.Supplier.t()
Fetches a supplier by UUID. Raises Ecto.NoResultsError if not found.
@spec list_suppliers(keyword()) :: [PhoenixKitCatalogue.Schemas.Supplier.t()]
Lists all suppliers, ordered by name.
Options
:status— filter by status (e.g."active","inactive").
@spec update_supplier(PhoenixKitCatalogue.Schemas.Supplier.t(), map(), keyword()) :: {:ok, PhoenixKitCatalogue.Schemas.Supplier.t()} | {:error, Ecto.Changeset.t(PhoenixKitCatalogue.Schemas.Supplier.t())}
Updates a supplier with the given attributes.