Skip to main content

initializeGenerationWindow

API Docs


Function: initializeGenerationWindow()

initializeGenerationWindow(input, drizzleClient, logger): Promise<{ configurationNotes: string | null; createdAt: Date; createdById: string; currentWindowEndDate: Date; historyRetentionMonths: number; hotWindowMonthsAhead: number; id: string; isEnabled: boolean; lastProcessedAt: Date; lastProcessedInstanceCount: number; lastUpdatedById: string | null; maxInstancesPerRun: number; organizationId: string; processingPriority: number; retentionStartDate: Date; updatedAt: Date | null; }>

Defined in: src/services/eventGeneration/windowManager.ts:16

Initializes the Generation window for a given organization, setting up the time frame for which event instances will be generated and retained.

Parameters

input

CreateGenerationWindowInput

The input object containing the organization ID.

drizzleClient

NodePgDatabase<API Docs>

The Drizzle ORM client for database access.

logger

FastifyBaseLogger

The logger for logging debug and error messages.

Returns

Promise<{ configurationNotes: string | null; createdAt: Date; createdById: string; currentWindowEndDate: Date; historyRetentionMonths: number; hotWindowMonthsAhead: number; id: string; isEnabled: boolean; lastProcessedAt: Date; lastProcessedInstanceCount: number; lastUpdatedById: string | null; maxInstancesPerRun: number; organizationId: string; processingPriority: number; retentionStartDate: Date; updatedAt: Date | null; }>

  • A promise that resolves to the newly created Generation window configuration.