Feed Events Table
Component Detail
Data Layer
low complexity
backend
0
Dependencies
2
Dependents
0
Entities
0
Integrations
Description
Dedicated PostgreSQL table (feed_events) storing normalized event rows generated by the Feed Service. Each row captures the organization context, actor identity, action type, a reference to the target record type and ID, and a creation timestamp to support cursor-based pagination and retention pruning.
feed-events-table
Responsibilities
- Persist normalized feed event rows with organization_id, actor_id, action_type, target_type, target_id, and created_at
- Support cursor-based pagination queries ordered by created_at descending
- Enforce organization-level row isolation via organization_id foreign key
- Enable efficient retention pruning via indexed created_at column
Interfaces
insert(event: FeedEventRow): Promise<FeedEventRow>
findByOrg(orgId: string, cursor?: string, limit?: number): Promise<FeedEventRow[]>
deleteOlderThan(orgId: string, cutoff: Date): Promise<number>
Relationships
Dependents (2)
Components that depend on this component