import type { Locale } from "@/lib/i18n/config";

export type ProductTranslationValues = {
  name: string;
  shortDescription: string;
  description: string;
  materials: string;
  dimensions: string;
  origin: string;
  artisanName: string;
  artisanBio: string;
  care: string;
};

export type ProductFormValues = {
  id?: string;
  slug: string;
  sku: string;
  categoryId: string;
  price: string;
  compareAtPrice: string;
  costPrice: string;
  stock: string;
  lowStockThreshold: string;
  isPublished: boolean;
  isFeatured: boolean;
  translations: Record<Locale, ProductTranslationValues>;
  images: { url: string; alt: string }[];
  variants: { id?: string; sku: string; name: string; priceDelta: string; stock: string }[];
};

const emptyTranslation: ProductTranslationValues = {
  name: "",
  shortDescription: "",
  description: "",
  materials: "",
  dimensions: "",
  origin: "",
  artisanName: "",
  artisanBio: "",
  care: "",
};

export function emptyProductValues(): ProductFormValues {
  return {
    slug: "",
    sku: "",
    categoryId: "",
    price: "",
    compareAtPrice: "",
    costPrice: "",
    stock: "0",
    lowStockThreshold: "5",
    isPublished: true,
    isFeatured: false,
    translations: {
      fr: { ...emptyTranslation },
      en: { ...emptyTranslation },
      ar: { ...emptyTranslation },
    },
    images: [],
    variants: [],
  };
}
