PhoenixKitProjects.ProjectEvents (PhoenixKitProjects v0.21.1)

Copy Markdown View Source

Project events (Step 12): CRUD for the V6 phoenix_kit_project_events table — the Events extension tab's data layer. Every write logs activity and broadcasts on the project topic; there is no notification fan-out yet (events carry no target_uuid — deciding who an event should notify is a product call for daylight).

Summary

Functions

Creates an event for a project. opts[:actor_uuid] for the trail.

Deletes an event.

Fetches an event scoped to its project (nil on cross-project uuids).

Events for a project ordered by start. Options: :from/:until (DateTime bounds on starts_at), :limit.

Functions

create(project, attrs, opts \\ [])

@spec create(map(), map(), keyword()) ::
  {:ok, PhoenixKitProjects.Schemas.ProjectEvent.t()}
  | {:error, Ecto.Changeset.t()}

Creates an event for a project. opts[:actor_uuid] for the trail.

delete(event, opts \\ [])

@spec delete(
  PhoenixKitProjects.Schemas.ProjectEvent.t(),
  keyword()
) :: :ok | {:error, term()}

Deletes an event.

get(project_uuid, event_uuid)

Fetches an event scoped to its project (nil on cross-project uuids).

list_for_project(project_uuid, opts \\ [])

@spec list_for_project(
  binary(),
  keyword()
) :: [PhoenixKitProjects.Schemas.ProjectEvent.t()]

Events for a project ordered by start. Options: :from/:until (DateTime bounds on starts_at), :limit.

update(event, attrs, opts \\ [])

Updates an event.