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 bulk person-change to the people topic only (no single
uuid). Used by bulk_trash/bulk_restore/bulk_delete where many
rows change at once — list views reload, and per-person show views
re-fetch via their catch-all {:staff, _, _} clause.
Broadcasts a person event to the people topic and the person's own topic.
Broadcasts a person-skill event to the skills, skill, people, and person topics.
Broadcasts a skill event to the skills topic and the skill'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 skill.
Topic for all skill mutations.
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_people_bulk(event()) :: :ok
Broadcasts a bulk person-change to the people topic only (no single
uuid). Used by bulk_trash/bulk_restore/bulk_delete where many
rows change at once — list views reload, and per-person show views
re-fetch via their catch-all {:staff, _, _} clause.
@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_person_skill(event(), %{ :skill_uuid => UUIDv7.t() | String.t(), :staff_person_uuid => UUIDv7.t() | String.t(), optional(any()) => any() }) :: :ok
Broadcasts a person-skill event to the skills, skill, people, and person topics.
@spec broadcast_skill(event(), %{ :uuid => UUIDv7.t() | String.t(), optional(any()) => any() }) :: :ok
Broadcasts a skill event to the skills topic and the skill'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 skill.
@spec topic_skills() :: topic()
Topic for all skill mutations.
Topic scoped to a single team.
@spec topic_teams() :: topic()
Topic for all team mutations.