* 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
28 lines
956 B
TypeScript
28 lines
956 B
TypeScript
import type {
|
|
MeetingStartedDTO,
|
|
MeetingEndedDTO,
|
|
AfterHostsNoShowDTO,
|
|
AfterGuestsNoShowDTO,
|
|
} from "../../dto/types";
|
|
import type { WebhookPayload } from "../types";
|
|
import type { IMeetingPayloadBuilder } from "../versioned/PayloadBuilderFactory";
|
|
|
|
/**
|
|
* Abstract base class for meeting payload builders.
|
|
*
|
|
* This class defines the interface that all version-specific meeting payload
|
|
* builders must implement. It does NOT contain any version-specific payload logic.
|
|
*
|
|
* Each webhook version should have its own concrete implementation in
|
|
* versioned/v{VERSION}/MeetingPayloadBuilder.ts
|
|
*/
|
|
export abstract class BaseMeetingPayloadBuilder implements IMeetingPayloadBuilder {
|
|
/**
|
|
* Build the meeting webhook payload.
|
|
* Each version must implement this method with its specific payload structure.
|
|
*/
|
|
abstract build(
|
|
dto: MeetingStartedDTO | MeetingEndedDTO | AfterHostsNoShowDTO | AfterGuestsNoShowDTO
|
|
): WebhookPayload;
|
|
}
|