mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* add webhook version schema * version the code * update version from numeric to date val * migration * update schema and build factory * update string * move version picker * tooltip instead of infobadge * -- * fix type * -- * fix type * fix type * -- * fix messed up merge * improvements to payloadfactory * extract version off of DB and instead keep it in IWebhookRepository * fix webhookform * fix type safety and routing ambiguity * scalable with easier factory extensions and base definition * fix types * -- * -- * clean up prisma/client type imports * fix * type fix * type fix * cleanup * add tests and registry changes * unintended file inclusion * type-fix * select in repo * -- * explicit return type * -- * fix type * fixes * feedback 1 * feedback 2 * use enum instead of string * fixes
23 lines
678 B
TypeScript
23 lines
678 B
TypeScript
import type { OOOCreatedDTO } from "../../../dto/types";
|
|
import type { WebhookPayload } from "../../types";
|
|
import { BaseOOOPayloadBuilder } from "../../base/BaseOOOPayloadBuilder";
|
|
|
|
/**
|
|
* OOO (Out of Office) payload builder for webhook version 2021-10-20.
|
|
*
|
|
* This is the initial OOO webhook payload format.
|
|
* It includes the OOO entry data in the payload.
|
|
*/
|
|
export class OOOPayloadBuilder extends BaseOOOPayloadBuilder {
|
|
/**
|
|
* Build the OOO webhook payload for v2021-10-20.
|
|
*/
|
|
build(dto: OOOCreatedDTO): WebhookPayload {
|
|
return {
|
|
triggerEvent: dto.triggerEvent,
|
|
createdAt: dto.createdAt,
|
|
payload: { oooEntry: dto.oooEntry },
|
|
};
|
|
}
|
|
}
|