import { dbForTenant } from "@/server/db"; import type { JobPayload } from "@/server/jobs/queues"; import type { ServiceCtx } from "@/server/services/context"; import { processTranscription } from "@/server/services/lotse/transcription"; /** * BullMQ processor for "transcription" (ARCHITEKTUR ยง4.4, lane L9). System context: tenant from the * payload (dbForTenant), no user permissions. Failures are recorded on the VoiceNote (status failed) * instead of being rethrown, so the queue does not re-send audio to the provider blindly. */ export async function process(payload: JobPayload): Promise { const ctx: ServiceCtx = { db: dbForTenant(payload.tenantId), tenantId: payload.tenantId, userId: payload.actorId ?? "", permissions: new Set(), }; await processTranscription(ctx, payload.entityId); }