Kaizen
Browse modulesInsightsinsights/serverClasses

Class: InsightsRepositories

Defined in: server/insights/repositories.ts:25

Holds the insights repositories and exposes a transaction() entry point.

Uses the ambient PRIMARY Prisma client (registered via registerPrismaClient / initPrismaClient). The engine's read path may run on an optional replica queryClient, but ALL writes — saved-report CRUD + audit columns — go through this primary client. Repositories route their handle through TransactionManager, so inside transaction(fn) every this.tx.* call resolves to the active transaction automatically.

Constructors

Constructor

new InsightsRepositories(options?: InsightsRepositoriesOptions): InsightsRepositories;

Defined in: server/insights/repositories.ts:31

Parameters

ParameterType
optionsInsightsRepositoriesOptions

Returns

InsightsRepositories

Properties

reportSchedules

readonly reportSchedules: ReportScheduleRepository;

Defined in: server/insights/repositories.ts:29


savedReports

readonly savedReports: SavedReportsRepository;

Defined in: server/insights/repositories.ts:28

Methods

transaction()

transaction<T>(fn: (repos: InsightsRepositories) => Promise<T>): Promise<T>;

Defined in: server/insights/repositories.ts:38

Type Parameters

Type Parameter
T

Parameters

ParameterType
fn(repos: InsightsRepositories) => Promise<T>

Returns

Promise<T>

On this page