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

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

export function serializeBank(bank: SerializableBank): BankRecord {
  return {
    id: bank.id.toString(),
    code: bank.code,
    name: bank.name,
    address: bank.address,
    status: bank.status,
    created_at: bank.createdAt.toISOString(),
    updated_at: bank.updatedAt.toISOString()
  };
}
