const { body } = require("express-validator");
const {User} = require("../../db/models/index.js");

const validateCreateOrder = [
  body("total_harga")
    .notEmpty().withMessage("total_harga wajib diisi")
    .isInt({ min: 0 }).withMessage("total_harga harus berupa angka positif"),
];

const validateUpdateOrder = [
  body("status")
    .optional()
    .isIn(["pending", "diproses", "selesai", "dibatalkan"]).withMessage("status tidak valid"),
];

module.exports = {
  validateCreateOrder,
  validateUpdateOrder
};
