import { body } from 'express-validator';

export const createPurchaseValidator = [
  body('product').isMongoId().withMessage('Valid product ID is required'),
  body('quantity').isInt({ min: 1 }).withMessage('Quantity must be at least 1'),
  body('purchasePrice').isFloat({ min: 0 }).withMessage('Purchase price must be a non-negative number'),
  body('purchaseDate').optional().isISO8601().withMessage('Valid date is required'),
  body('supplier').optional().trim(),
  body('size').optional().isString().withMessage('Size must be a string'),
  body('variant').optional().isString().withMessage('Variant must be a string'),
];
