Kaizen
Browse modulesInsightsinsights/schedulingInterfaces

Interface: DeliverScheduledReportDeps

Defined in: server/insights/scheduling/report-schedule-worker.ts:65

The deps of one delivery — everything except the BullMQ wiring.

Extended by

Properties

authorizeActor

authorizeActor: (actor: {
  organizationId: string;
  userId: string;
}) => Promise<void>;

Defined in: server/insights/scheduling/report-schedule-worker.ts:76

Revalidate that the persisted schedule owner is still an active, authorized member of the organization. Taproot does not require its optional auth schema, so the consumer must bridge its own identity source. Throwing fails the run before any report data is exported or emailed.

Parameters

ParameterType
actor{ organizationId: string; userId: string; }
actor.organizationIdstring
actor.userIdstring

Returns

Promise<void>


buildEmail?

optional buildEmail?: (input: BuildScheduleEmailInput) => ReportEmailMessage;

Defined in: server/insights/scheduling/report-schedule-worker.ts:91

Override the default plain-text email builder (branding, HTML, …).

Parameters

ParameterType
inputBuildScheduleEmailInput

Returns

ReportEmailMessage


createServices

createServices: () => ReportScheduleExecutionServices;

Defined in: server/insights/scheduling/report-schedule-worker.ts:69

Build per-fire services bound to the ambient Prisma client.

Returns

ReportScheduleExecutionServices


emailSender

emailSender: EmailSender;

Defined in: server/insights/scheduling/report-schedule-worker.ts:67

The consumer's mail transport.


now?

optional now?: () => Date;

Defined in: server/insights/scheduling/report-schedule-worker.ts:101

Clock, injected for deterministic tests.

Returns

Date


removeScheduler?

optional removeScheduler?: (scheduleId: string) => Promise<void>;

Defined in: server/insights/scheduling/report-schedule-worker.ts:99

Remove the BullMQ job scheduler for an orphaned schedule (its report was deleted). Without it the orphan's row is disabled but the Redis scheduler keeps enqueueing a no-op job every cadence. createReportScheduleWorker wires this from an internal queue; it is optional here so the pure core is testable in isolation.

Parameters

ParameterType
scheduleIdstring

Returns

Promise<void>


runInTenantContext?

optional runInTenantContext?: RunInReportScheduleTenantContext;

Defined in: server/insights/scheduling/report-schedule-worker.ts:89

Override tenant-context binding when the consumer owns its own ALS. It must be paired with tenancy.resolveBinding; omit both to use Taproot's context.


tenancy?

optional tenancy?: TenancyConfig;

Defined in: server/insights/scheduling/report-schedule-worker.ts:84

Optional RLS integration for the worker's database phases. Each phase gets its own short GUC-pinned transaction; email and Redis work stay outside.

On this page