Data Layer low complexity backend
0
Dependencies
1
Dependents
0
Entities
0
Integrations

Description

PostgreSQL repository for persisted annual summary records, one row per user per year. Stores the aggregated payload as structured columns to enable year-over-year querying and trend analysis without re-computation.

Feature: Annual Summary (Wrapped)

annual-summaries-table

Responsibilities

  • Persist and retrieve annual summary records keyed by (user_id, year)
  • Enforce unique constraint on (user_id, year) with upsert on regeneration
  • Expose query interface for year-over-year comparison reads

Interfaces

upsertSummary(record: AnnualSummaryRecord) → Promise<void>
findByUserAndYear(userId: string, year: number) → Promise<AnnualSummaryRecord | null>
findAllByUser(userId: string) → Promise<AnnualSummaryRecord[]>

Relationships

Dependents (1)

Components that depend on this component