import { uuidv5 } from "../../../shared/uuidv5";
import type { CurrencyCreate, Schema } from "../lib/types";

const NS = "erp-kit:primitives";

type SeedRow = Omit<CurrencyCreate<Schema>, "id">;

export const currencyIds = {
  USD: await uuidv5(NS, "currency:USD"),
  EUR: await uuidv5(NS, "currency:EUR"),
  GBP: await uuidv5(NS, "currency:GBP"),
  JPY: await uuidv5(NS, "currency:JPY"),
  CNY: await uuidv5(NS, "currency:CNY"),
} as const;

export const currencies: Record<string, SeedRow> = {
  [currencyIds.USD]: { code: "USD", name: "US Dollar", symbol: "$", decimalPlaces: 2, isBaseCurrency: true, status: "ACTIVE" as const },
  [currencyIds.EUR]: { code: "EUR", name: "Euro", symbol: "€", decimalPlaces: 2, isBaseCurrency: false, status: "ACTIVE" as const },
  [currencyIds.GBP]: { code: "GBP", name: "British Pound", symbol: "£", decimalPlaces: 2, isBaseCurrency: false, status: "ACTIVE" as const },
  [currencyIds.JPY]: { code: "JPY", name: "Japanese Yen", symbol: "¥", decimalPlaces: 0, isBaseCurrency: false, status: "ACTIVE" as const },
  [currencyIds.CNY]: { code: "CNY", name: "Chinese Yuan", symbol: "¥", decimalPlaces: 2, isBaseCurrency: false, status: "ACTIVE" as const },
};
