Real-time updates for the staff module, backed by
PhoenixKit.PubSub.Manager (the shared in-process PubSub server).
Topics
"staff:departments"— any department mutation"staff:teams"— any team mutation"staff:people"— any person mutation"staff:department:<uuid>"— a single department"staff:team:<uuid>"— a single team"staff:person:<uuid>"— a single person
Events
Messages are {:staff, event_atom, payload_map} tuples. Payload always
includes :uuid at a minimum. Subscribers should pattern-match on the
event atom in handle_info/2.
Summary
Functions
Broadcasts a department event to the departments topic and the department's own topic.
Broadcasts a person event to the people topic and the person's own topic.
Broadcasts a team event to the teams, team, and (if present) parent-department topics.
Broadcasts a team-membership event to the teams, team, people, and person topics.
Subscribes the calling process to the given PubSub topic.
Topic scoped to a single department.
Topic for all department mutations.
Topic for all person mutations.
Topic scoped to a single person.
Topic scoped to a single team.
Topic for all team mutations.
Types
Functions
@spec broadcast_department(event(), %{ :uuid => UUIDv7.t() | String.t(), optional(any()) => any() }) :: :ok
Broadcasts a department event to the departments topic and the department's own topic.
@spec broadcast_person(event(), %{ :uuid => UUIDv7.t() | String.t(), optional(any()) => any() }) :: :ok
Broadcasts a person event to the people topic and the person's own topic.
@spec broadcast_team(event(), %{ :uuid => UUIDv7.t() | String.t(), optional(any()) => any() }) :: :ok
Broadcasts a team event to the teams, team, and (if present) parent-department topics.
@spec broadcast_team_membership(event(), %{ :team_uuid => UUIDv7.t() | String.t(), :staff_person_uuid => UUIDv7.t() | String.t(), optional(any()) => any() }) :: :ok
Broadcasts a team-membership event to the teams, team, people, and person topics.
Subscribes the calling process to the given PubSub topic.
Topic scoped to a single department.
@spec topic_departments() :: topic()
Topic for all department mutations.
@spec topic_people() :: topic()
Topic for all person mutations.
Topic scoped to a single person.
Topic scoped to a single team.
@spec topic_teams() :: topic()
Topic for all team mutations.