Skip to content

Entities & Data Models ​

Last Updated: 2026-05-08

The Yappa Knowledge Hub has 5 entities managed by Doctrine ORM with SQLite.

Entity Relationship Diagram ​


Primary Entities ​

Category ​

Thematic lists that organise knowledge items. Each category has its own digest configuration.

FieldTypeDescription
idint (auto)Primary key
namestring (255)Display name, 2-100 chars, required
descriptionstring (255)Optional description
iconstring (50)Emoji icon, default :file_folder:
targetGroupsJSONAudience labels synced from Notion
notionIdstringNotion page reference
isActiveboolVisibility flag, default true
sortOrderintDisplay order, default 0
digestEnabledboolScheduled digest flag
digestFrequencyenumweekly/biweekly/monthly/quarterly
digestDayintDay of week
digestTimestringTime HH:MM
lastDigestAtdatetimeLast digest generation timestamp
createdAt/updatedAtdatetimeGedmo auto-managed

Relationships: OneToMany to Knowledge, Digest, Subscription (CASCADE).


Knowledge ​

The core data unit — user-submitted content enhanced with URL extraction and AI summaries.

FieldTypeDescription
idint (auto)Primary key
titlestring (255)Display title, 3-255 chars, required
contenttextUser text + extracted URL content
tagsJSONUser-defined tags
targetGroupsJSONAudience labels
userIdstringCreator's Slack user ID
statusstringpending/Not started/In progress/Done/approved/rejected/archived/draft/published
urlstring (500)Source URL
urlMetadataJSONExtraction details (title, length, type)
sourceMessageJSONOriginal Slack message data
highlighttextAI-generated 2-3 sentence Dutch summary
summariesJSONAI summary data from Notion sync
notionIdstringNotion page ID
notionUrlstring (2048)Direct Notion page link
createdAt/updatedAtdatetimeGedmo auto-managed

Relationships: ManyToOne to Category (nullable, SET NULL on delete).


Digest ​

Generated knowledge reports with AI summaries, persisted and synced to Notion.

FieldTypeDescription
idint (auto)Primary key
titlestring (255)Auto-generated: "Digest: {Category} ({dateRange})"
contenttextFull Dutch Markdown digest
periodstringDate range label
statusstringDone/sent
statisticsJSONhighlightCount, days, tokenCount, cost, durationMs
knowledgeHighlightsJSONImmutable snapshot of highlights at generation time
generatedBystringSlack user who triggered generation
notionIdstringNotion page ID
notionUrlstring (2048)Notion page link
createdAt/updatedAtdatetimeGedmo auto-managed

Relationships: ManyToOne to Category (required), ManyToMany to Knowledge via digest_knowledge join table.


DigestDelivery ​

Per-user delivery tracking for digest distribution with retry support.

FieldTypeDescription
idint (auto)Primary key
userIdstringRecipient Slack user ID
deliveryChannelstringslack/notion/email
statusstringpending/sent/failed
retryCountintRetry attempts (max 3)
errorMessagetextFailure details
sentAtdatetimeDelivery timestamp
createdAtdatetimeGedmo auto-managed

Relationships: ManyToOne to Digest (required, CASCADE). Domain methods: markAsSent(), markAsFailed(), canRetry(), resetForRetry().


Subscription ​

User opt-in to receive digest notifications for a category.

FieldTypeDescription
idint (auto)Primary key
userIdstringSubscriber Slack user ID
slackUserNamestringDisplay name
isActiveboolDefault true
subscribedAtdatetimeGedmo auto-managed
unsubscribedAtdatetimeSet on deactivation
notionIdstringNotion page reference

Relationships: ManyToOne to Category (required, CASCADE). Unique constraint: (userId, categoryId) — one subscription per user per category. Domain methods: deactivate(), reactivate().


Enums ​

EnumValuesUsed By
DigestFrequencyweekly, biweekly, monthly, quarterlyCategory.digestFrequency
KnowledgeStatuspending, Not started, In progress, Done, approved, rejected, archived, draft, publishedKnowledge.status (validation only)

Technical Details ​

  • Storage: SQLite via Doctrine ORM
  • Timestamps: Gedmo Timestampable (auto-managed, no manual setters)
  • Validation: Symfony Assert attributes on all entities
  • Serialization: Symfony Serializer groups (category:read, knowledge:read, digest:read)
  • Migrations: Schema created via doctrine:schema:create (no migration files in use)