import { ok, type ReadonlyDB } from "@tailor-platform/erp-kit/core"; import type { DB } from "../generated/kysely-tailordb"; export interface GetOutgoingPaymentInput { id: string; } /** Returns the AP payment facts required by downstream cash reconciliation. */ export async function run(db: ReadonlyDB, input: GetOutgoingPaymentInput) { const outgoingPayment = await db .selectFrom("OutgoingPayment") .selectAll() .where("id", "=", input.id) .executeTakeFirst(); return ok({ outgoingPayment: outgoingPayment ?? null }); }