import type { CurrencyRecord } from "@/types/master-data";

type SerializableCurrency = {
  id: bigint;
  code: string;
  name: string;
  description: string | null;
  status: string;
  createdAt: Date;
  updatedAt: Date;
};

export function serializeCurrency(currency: SerializableCurrency): CurrencyRecord {
  return {
    id: currency.id.toString(),
    code: currency.code,
    name: currency.name,
    description: currency.description,
    status: currency.status,
    created_at: currency.createdAt.toISOString(),
    updated_at: currency.updatedAt.toISOString()
  };
}
