Interface: ReportSchedule
Defined in: server/insights/report-schedule-repository.ts:72
Repository for savedReportSchedules rows — the same shape as
file://./saved-reports-repository.ts: org-scoped CRUD, per-call
userId owner checks on writes, and config normalize-on-read against the
shared reportScheduleConfigSchema.
AUTHORIZATION MODEL: saved-report list/get are ORG-scoped — any member of
the org may see a schedule, because it is an operational artifact of a shared
report, not private content. Dashboard listing is owner-scoped because its
result includes recipient addresses. Every request-path mutation is
authorized against the parent report by ReportScheduleService and
re-checks schedule ownership in this repository. Worker status/orphan writes
are the only system-actor mutations and carry no userId.
Extends BaseRepository so this.tx resolves to the active transaction when
a mutation is wrapped in TransactionManager.startOrUseTransaction
(ownership check + write ride one transaction) and the raw client otherwise.
Properties
cadence
cadence: "custom" | "daily" | "weekly" | "monthly";Defined in: server/insights/report-schedule-repository.ts:78
config
config:
| {
cadence: "daily";
format: "pdf" | "csv" | "xlsx";
recipients: string[];
timeOfDay: string;
timezone: string;
}
| {
cadence: "weekly";
format: "pdf" | "csv" | "xlsx";
recipients: string[];
timeOfDay: string;
timezone: string;
weekdays: number[];
}
| {
cadence: "monthly";
dayOfMonth: number | "last";
format: "pdf" | "csv" | "xlsx";
recipients: string[];
timeOfDay: string;
timezone: string;
}
| {
cadence: "custom";
cron: string;
format: "pdf" | "csv" | "xlsx";
recipients: string[];
timezone: string;
};Defined in: server/insights/report-schedule-repository.ts:77
Union Members
Type Literal
{
cadence: "daily";
format: "pdf" | "csv" | "xlsx";
recipients: string[];
timeOfDay: string;
timezone: string;
}Type Literal
{
cadence: "weekly";
format: "pdf" | "csv" | "xlsx";
recipients: string[];
timeOfDay: string;
timezone: string;
weekdays: number[];
}cadence
cadence: "weekly";format
format: "pdf" | "csv" | "xlsx" = reportDeliveryFormatSchema;recipients
recipients: string[] = reportRecipientsSchema;timeOfDay
timeOfDay: string = timeOfDaySchema;timezone
timezone: string = timezoneSchema;weekdays
weekdays: number[];One or more weekdays; de-duplicated so [1,1] cannot double-fire.
Type Literal
{
cadence: "monthly";
dayOfMonth: number | "last";
format: "pdf" | "csv" | "xlsx";
recipients: string[];
timeOfDay: string;
timezone: string;
}Type Literal
{
cadence: "custom";
cron: string;
format: "pdf" | "csv" | "xlsx";
recipients: string[];
timezone: string;
}createdAt
createdAt: Date;Defined in: server/insights/report-schedule-repository.ts:84
createdBy
createdBy: string | null;Defined in: server/insights/report-schedule-repository.ts:86
enabled
enabled: boolean;Defined in: server/insights/report-schedule-repository.ts:79
id
id: string;Defined in: server/insights/report-schedule-repository.ts:73
lastRunAt
lastRunAt: Date | null;Defined in: server/insights/report-schedule-repository.ts:81
lastRunError
lastRunError: string | null;Defined in: server/insights/report-schedule-repository.ts:83
lastRunStatus
lastRunStatus: "success" | "failed" | null;Defined in: server/insights/report-schedule-repository.ts:82
mutationVersion
mutationVersion: number;Defined in: server/insights/report-schedule-repository.ts:80
name
name: string | null;Defined in: server/insights/report-schedule-repository.ts:76
organizationId
organizationId: string;Defined in: server/insights/report-schedule-repository.ts:74
savedReportId
savedReportId: string;Defined in: server/insights/report-schedule-repository.ts:75
updatedAt
updatedAt: Date;Defined in: server/insights/report-schedule-repository.ts:85
updatedBy
updatedBy: string | null;Defined in: server/insights/report-schedule-repository.ts:87