Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-cloud/apps/web/app/services/automation/automation.producer-events.server.ts
T

32 lines
978 B
TypeScript

import { buildWorkflowTriggerOutboxEvent } from "@hivegrid/queue";
export function buildCalendarCreatedWorkflowEvent(input: {
readonly tenantId: string;
readonly calendarEventId: string;
readonly userId: string | null;
readonly calendarKey: string;
readonly eventKind: string;
readonly source: string;
readonly sourceEntityId: string;
readonly startsAt: Date;
readonly endsAt: Date;
}) {
return buildWorkflowTriggerOutboxEvent({
tenantId: input.tenantId,
event: "calendar.event_created",
data: {
calendarEventId: input.calendarEventId,
calendarKey: input.calendarKey,
kalender: input.calendarKey,
eventKind: input.eventKind,
ereignisart: input.eventKind,
source: input.source,
sourceEntityId: input.sourceEntityId,
startsAt: input.startsAt.toISOString(),
endsAt: input.endsAt.toISOString(),
},
userId: input.userId,
sourceId: `calendar:${input.calendarEventId}:created`,
});
}