Skip to content

Role Entity

Last Updated: 2026-03-09 Version: 1.0

The Role entity represents a target audience for AI summaries. It replaced the hardcoded "Target Group" strings to allow dynamic audience management via Notion.

👥 Core Purpose

  • Audience Segmentation: Defines who the summary is for (e.g., "Developers", "Sales", "C-Level").
  • Prompt Routing: Acts as the primary key for resolving which PromptTemplate to use.
  • Slack Personalization: Stores icons and descriptions that are used in the Slack UI to help users choose the right summary.

🏗️ Data Architecture

Properties

  • Name: The unique identifier (e.g., developers).
  • Icon: The emoji used in Slack (e.g., 💻).
  • Description: A short explanation of what this audience cares about.
  • Is Active: Allows disabling a role without deleting its history or templates.

Relationships

  • PromptTemplates: A OneToMany relationship to the templates defined for this role.
  • AiSummaries: A OneToMany relationship to the generated summaries targeting this role.

⚖️ Business Logic

Default Roles

The system seeds several default roles on installation:

  • Global: The catch-all audience.
  • Developers: Technical deep-dives.
  • Management: High-level business impact.

Dynamic Resolution

When a new role is added to the Notion "Roles" database, the NotionSyncService automatically creates a corresponding local Role entity, making it immediately available for AI summary generation.


Technical Details

  • Location: src/Entity/Role.php
  • Repository: src/Repository/RoleRepository.php

TIP

Use RoleRepository::findActive() to get the list of audiences currently available for the end-user in Slack.