Report Templates Repository
Component Detail
Data Layer
low complexity
backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Data access layer for saved custom report configurations. Persists query parameter sets (dimensions, metrics, filters) as JSON documents linked to an organization, enabling template reuse across sessions and users within the same org.
report-templates-repository
Responsibilities
- Create, read, update, and delete saved report template records
- Scope all template queries to the requesting organization for tenant isolation
- Store report configuration as JSON in the database
Interfaces
create(orgId: string, name: string, config: ReportQueryParams): Promise<ReportTemplate>
findById(templateId: string): Promise<ReportTemplate | null>
findByOrg(orgId: string): Promise<ReportTemplate[]>
update(templateId: string, data: Partial<ReportTemplate>): Promise<ReportTemplate>
delete(templateId: string): Promise<void>