CRUD for teams.
Summary
Functions
Returns a changeset for the given team.
Total number of teams.
Inserts a team and broadcasts :team_created.
Deletes a team and broadcasts :team_deleted.
Fetches a team by uuid, or nil if not found.
Fetches a team by uuid. Raises if not found.
Lists teams. Accepts :preload and :department_uuid to filter by department.
Updates a team and broadcasts :team_updated.
Functions
@spec change(PhoenixKitStaff.Schemas.Team.t(), map()) :: Ecto.Changeset.t(PhoenixKitStaff.Schemas.Team.t())
Returns a changeset for the given team.
@spec count() :: non_neg_integer()
Total number of teams.
@spec create(map()) :: {:ok, PhoenixKitStaff.Schemas.Team.t()} | {:error, Ecto.Changeset.t(PhoenixKitStaff.Schemas.Team.t())}
Inserts a team and broadcasts :team_created.
@spec delete(PhoenixKitStaff.Schemas.Team.t()) :: {:ok, PhoenixKitStaff.Schemas.Team.t()} | {:error, Ecto.Changeset.t(PhoenixKitStaff.Schemas.Team.t())}
Deletes a team and broadcasts :team_deleted.
@spec get( UUIDv7.t() | String.t(), keyword() ) :: PhoenixKitStaff.Schemas.Team.t() | nil
Fetches a team by uuid, or nil if not found.
@spec get!( UUIDv7.t() | String.t(), keyword() ) :: PhoenixKitStaff.Schemas.Team.t()
Fetches a team by uuid. Raises if not found.
@spec list(keyword()) :: [PhoenixKitStaff.Schemas.Team.t()]
Lists teams. Accepts :preload and :department_uuid to filter by department.
@spec update(PhoenixKitStaff.Schemas.Team.t(), map()) :: {:ok, PhoenixKitStaff.Schemas.Team.t()} | {:error, Ecto.Changeset.t(PhoenixKitStaff.Schemas.Team.t())}
Updates a team and broadcasts :team_updated.