// billdeskpg/controllers/billdeskController.js
const service = require('../services/billdeskService');

exports.createOrder = async (req, res) => {
  try {
    const data = await service.createOrder(req.body);
    return res.status(200).json({ success: true, message: 'Order created', data });
  } catch (err) {
    console.error('Controller error', err && err.stack || err);
    return res.status(err.statusCode || 500).json({
      success: false,
      message: err.message || 'Internal server error',
      detail: err.detail || null
    });
  }
};
