const express = require('express');
const router = express.Router();
const cafeOrderController = require('../controllers/cafeOrderController');

// Order CRUD endpoints
router.post('/', cafeOrderController.createOrder); // Create a new order
router.get('/', cafeOrderController.getAllOrders); // Fetch all orders
router.post('/update-order', cafeOrderController.updateOrder); // Update an existing order
router.post('/serve-order', cafeOrderController.serveOrder); // Serve an order
router.post('/pay-order', cafeOrderController.payOrder);
router.post('/cancel-order', cafeOrderController.cancelOrder);
router.post('/resume-order', cafeOrderController.resumeOrder);
router.get('/get-bono', cafeOrderController.getBono); // Get
router.get('/get-sales', cafeOrderController.getDailySales); // Get
router.get('/get-orders-admin', cafeOrderController.fetchOrders); // Get
router.get('/log-activity', cafeOrderController.getLogActivity); // Fetch all orders
router.post('/delete-all-orders',cafeOrderController.deleteAllOrders); // Delete an order with
router.post('/updateOrderTable', cafeOrderController.updateOrderTable); // Update
// Serve an order
// Attachment-specific endpoints
router.get('/get-attachment', cafeOrderController.getAllOrdersForAttachment); // Fetch orders requiring attachment
router.post('/serve-attachment', cafeOrderController.serveAttachment); // Serve attachment for an order

module.exports = router;
