import express from 'express'
import analyticsController from '../controller/analyticsController.js'
import authMiddleware from '../middleware/authMiddleware.js'
import garageController from '../controller/garageController.js'
import uploadLogo from '../middleware/upload.js'
const router = express.Router()

// Read - Get dashboard analytics for user
router.get('',authMiddleware, garageController.getGarageDetails)
router.get('/dashboard', authMiddleware, analyticsController.getDashboardAnalytics)
router.get('/analytics', authMiddleware, analyticsController.getAnalysis)
router.post('/employee', authMiddleware, garageController.addEmployee)
router.put('/employee', authMiddleware, garageController.updateEmployee)
router.get('/employee', authMiddleware, garageController.getEmployees)

router.post('/profile',uploadLogo.single('logo'), authMiddleware, garageController.addGarageDetail)
router.put('/settings', uploadLogo.single('logo'), authMiddleware, garageController.updateSettings)
export default router
