mirror of
https://github.com/melgarafael/DeskcommCRM.git
synced 2026-10-02 01:28:34 +08:00
naOrgParada obrigatório no EventHandler; o dreno lê o status das orgs do lote numa consulta só e o dispatcher consome como skipped quem custa ou sai para fora. Leitura que falha adia o lote em vez de consumir às cegas. Invariante alterado sem afrouxar invariante da main — checar-invariantes-so-crescem.sh verde. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
21 lines
621 B
TypeScript
21 lines
621 B
TypeScript
/**
|
|
* Handler adapter exposing lgpd-export-worker to the event_log dispatcher.
|
|
*
|
|
* Consumed key: `lgpd-export-worker.v1` — recorded in
|
|
* `event_log.consumed_by[]` so retries skip already-completed runs.
|
|
*/
|
|
|
|
import type { EventHandler } from "@/lib/event-log/dispatcher";
|
|
import { processLgpdExport } from "@/workers/lgpd-export-worker";
|
|
|
|
export const LGPD_EXPORT_HANDLER_KEY = "lgpd-export-worker.v1";
|
|
|
|
export const lgpdExportHandler: EventHandler = {
|
|
key: LGPD_EXPORT_HANDLER_KEY,
|
|
naOrgParada: "roda",
|
|
events: ["lgpd.data_request_received"],
|
|
async handle(row) {
|
|
return processLgpdExport(row);
|
|
},
|
|
};
|