const { z } = require("zod")
const {
  optionalTrimmedString,
  optionalUrlString,
  optionalPrice,
} = require("./common")

const createDealPayloadSchema = z.object({
  title: z
    .string()
    .min(1, { message: "Başlık boş olamaz" })
    .transform((value) => value.trim()),
  description: optionalTrimmedString().optional(),
  url: optionalUrlString().optional(),
  price: optionalPrice().optional(),
  sellerName: optionalTrimmedString().optional(),
})

module.exports = {
  createDealPayloadSchema,
}
