Interface: ReportScheduleWorkerDeps
Defined in: server/insights/scheduling/report-schedule-worker.ts:104
The deps of one delivery — everything except the BullMQ wiring.
Extends
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
| Parameter | Type |
|---|---|
actor | { organizationId: string; userId: string; } |
actor.organizationId | string |
actor.userId | string |
Returns
Promise<void>
Inherited from
DeliverScheduledReportDeps.authorizeActor
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
| Parameter | Type |
|---|---|
input | BuildScheduleEmailInput |
Returns
Inherited from
DeliverScheduledReportDeps.buildEmail
concurrency?
optional concurrency?: number;Defined in: server/insights/scheduling/report-schedule-worker.ts:109
Max concurrent deliveries. Defaults to 1 (see createWorker).
connection
connection: ConnectionOptions;Defined in: server/insights/scheduling/report-schedule-worker.ts:105
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
Inherited from
DeliverScheduledReportDeps.createServices
emailSender
emailSender: EmailSender;Defined in: server/insights/scheduling/report-schedule-worker.ts:67
The consumer's mail transport.
Inherited from
DeliverScheduledReportDeps.emailSender
now?
optional now?: () => Date;Defined in: server/insights/scheduling/report-schedule-worker.ts:101
Clock, injected for deterministic tests.
Returns
Date
Inherited from
DeliverScheduledReportDeps.now
prefix?
optional prefix?: string;Defined in: server/insights/scheduling/report-schedule-worker.ts:107
Redis key prefix. MUST match the queue's (defaults to "taproot").
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
| Parameter | Type |
|---|---|
scheduleId | string |
Returns
Promise<void>
Inherited from
DeliverScheduledReportDeps.removeScheduler
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.
Inherited from
DeliverScheduledReportDeps.runInTenantContext
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.