import { ok, type ReadonlyDB } from "@tailor-platform/erp-kit/core"; import type { DB } from "../generated/kysely-tailordb"; /** * Retrieves the currency designated as the base currency. * Returns null if no base currency has been set. */ export async function run(db: ReadonlyDB) { const currency = await db .selectFrom("Currency") .selectAll() .where("isBaseCurrency", "=", true) .executeTakeFirst(); return ok({ currency: currency ?? null }); }