import { getCollection } from "@/lib/mongodb";
import { ObjectId } from "mongodb";

export type ProductDocument = {
  _id: ObjectId;
  title?: string;
  name?: string;
  description?: string;
  price?: number;
  stock?: number;
  quantity?: number;
  images?: string[];
  sku?: string;
  createdAt?: Date | string;
};

export async function getProductsCollection() {
  return await getCollection<ProductDocument>("products");
}
