Files
craftvia/src/server/jobs/processors/transcription.ts
T
msolarczekandClaude Opus 5 ff5c57f276 L9 Lotse – KI-Assistent: Transkription, Berichtsentwurf, Vollständigkeitsprüfung, Freigabeprinzip (Services)
- OpenAI-kompatible Transkription + Processor transcription (done/failed/disabled, AiGeneration, Notiz aus Sprachnotiz)
- Claude-Lotse (strukturierte Ausgabe, Refusal/Fallback), Datenminimierung, Vorschläge in content.lotse
- Vollständigkeitsprüfung (Regeln + KI-Hinweise mit Deep-Link), Einstellungen, KI-Protokoll
- Freigabeprinzip: Submit eines Lotse-Entwurfs nur mit Prüfbestätigung (serverseitig)
- Migration lotse_address_form (TenantSettings)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 17:19:38 +02:00

20 lines
840 B
TypeScript

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<void> {
const ctx: ServiceCtx = {
db: dbForTenant(payload.tenantId),
tenantId: payload.tenantId,
userId: payload.actorId ?? "",
permissions: new Set<string>(),
};
await processTranscription(ctx, payload.entityId);
}