// const express = require('express');
// const router = express.Router();
// const db = require('../config/db');

// // Get all departments
// router.get('/departments', async (req, res) => {
//     try {
//         const [rows] = await db.query('SELECT * FROM department');
//         res.json(rows);
//     } catch (err) { res.status(500).json({ error: err.message }); }
// });

// // Get all employees with their department info
// router.get('/employees', async (req, res) => {
//     try {
//         const [rows] = await db.query(`
//             SELECT e.*, d.departmentname, s.netsalary 
//             FROM employee e 
//             LEFT JOIN department d ON e.departmentnumber = d.departmentnumber
//             LEFT JOIN salary s ON d.grosssalary = s.grosssalary
//         `);
//         res.json(rows);
//     } catch (err) { res.status(500).json({ error: err.message }); }
// });

// // Add new Employee
// router.post('/employees', async (req, res) => {
//     const { firstname, lastname, position, address, telephone, gender, hireddate, departmentnumber } = req.body;
//     try {
//         await db.query(
//             `INSERT INTO employee (firstname, lastname, position, address, telephone, gender, hireddate, departmentnumber) 
//              VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
//             [firstname, lastname, position, address, telephone, gender, hireddate, departmentnumber]
//         );
//         res.status(201).json({ message: "Employee registered digitally!" });
//     } catch (err) { res.status(500).json({ error: err.message }); }
// });

// module.exports = router;