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: uuidv5(NS, "currency:USD"),
  EUR: uuidv5(NS, "currency:EUR"),
  GBP: uuidv5(NS, "currency:GBP"),
  JPY: uuidv5(NS, "currency:JPY"),
  CNY: uuidv5(NS, "currency:CNY"),
} as const;

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