Service Layer high complexity backend
2
Dependencies
1
Dependents
3
Entities
0
Integrations

Description

Aggregates events from multiple source tables (activities, expenses, event_registrations, audit_logs) and normalizes them into a unified FeedItem schema ordered by created_at descending with organization-scoped filtering. Implements cursor-based pagination for efficient large-dataset traversal and supports interval-based client refresh for near-real-time updates.

Feature: Activity Feed

activity-feed-service

Responsibilities

  • Aggregate events from activities, expenses, event_registrations, and audit_logs
  • Normalize disparate event types into a unified FeedItem schema
  • Apply organization-scoped filtering for multi-tenant data isolation
  • Execute cursor-based pagination for efficient dataset traversal
  • Support filtering by event type, date range, and user

Interfaces

getFeedItems(orgId: string, filters: FeedFilters, cursor?: string, limit?: number): Promise<FeedPage>
normalizeFeedEvents(rawEvents: RawEvent[]): FeedItem[]
applyFilters(query: FeedQuery, filters: FeedFilters): FeedQuery
resolveCursor(cursor: string): CursorPosition
buildFeedPage(items: FeedItem[], nextCursor?: string): FeedPage

Relationships

Dependencies (2)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (3)

Data entities managed by this component