import { ok, type ReadonlyDB } from "@tailor-platform/erp-kit/core";
import type { DB } from "../generated/kysely-tailordb";

export interface GetPartnerIdentificationInput {
  id: string;
}

export async function run(db: ReadonlyDB<DB>, input: GetPartnerIdentificationInput) {
  const partnerIdentification = await db
    .selectFrom("PartnerIdentification")
    .selectAll()
    .where("id", "=", input.id)
    .executeTakeFirst();

  return ok({ partnerIdentification: partnerIdentification ?? null });
}
