import { ok, type ReadonlyDB } from "@tailor-platform/erp-kit/core"; import type { DB } from "../generated/kysely-tailordb"; export interface GetAppointmentInput { id: string; } export async function run(db: ReadonlyDB, input: GetAppointmentInput) { const appointment = await db .selectFrom("AppointmentHistory") .selectAll() .where("id", "=", input.id) .executeTakeFirst(); return ok({ appointment: appointment ?? null }); }