* 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
21 lines
796 B
TypeScript
21 lines
796 B
TypeScript
import type { OOOCreatedDTO } from "../../dto/types";
|
|
import type { WebhookPayload } from "../types";
|
|
import type { IOOOPayloadBuilder } from "../versioned/PayloadBuilderFactory";
|
|
|
|
/**
|
|
* Abstract base class for OOO (Out of Office) payload builders.
|
|
*
|
|
* This class defines the interface that all version-specific OOO 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}/OOOPayloadBuilder.ts
|
|
*/
|
|
export abstract class BaseOOOPayloadBuilder implements IOOOPayloadBuilder {
|
|
/**
|
|
* Build the OOO webhook payload.
|
|
* Each version must implement this method with its specific payload structure.
|
|
*/
|
|
abstract build(dto: OOOCreatedDTO): WebhookPayload;
|
|
}
|