Spaces:
Sleeping
Sleeping
anoderb
feat: implement chatbot service, active shift logic corrections, audit logs, and void transaction tool
48013ee | import { Router } from 'express'; | |
| import { OpsController } from '../controllers/ops.controller'; | |
| import { authenticate } from '../middlewares/auth.middleware'; | |
| import { validate } from '../middlewares/validate.middleware'; | |
| import { bukaShiftSchema, tutupShiftSchema, updatePengaturanSchema, laporanQuerySchema } from '../schemas/ops.schema'; | |
| const opsRouter = Router(); | |
| // ================= SHIFT KASIR ================= | |
| opsRouter.get('/shift/aktif', authenticate, OpsController.getActiveShift); | |
| opsRouter.post('/shift/buka', authenticate, validate(bukaShiftSchema), OpsController.openShift); | |
| opsRouter.post('/shift/tutup', authenticate, validate(tutupShiftSchema), OpsController.closeShift); | |
| // ================= REPORT & DASHBOARD ================= | |
| opsRouter.get('/dashboard/summary', authenticate, OpsController.getDashboardSummary); | |
| opsRouter.get('/laporan/penjualan', authenticate, validate(laporanQuerySchema), OpsController.getSalesReport); | |
| opsRouter.get('/laporan/laba', authenticate, validate(laporanQuerySchema), OpsController.getProfitLossReport); | |
| opsRouter.get('/laporan/ekspor', authenticate, OpsController.eksporLaporan); | |
| // ================= SETTINGS ================= | |
| opsRouter.get('/pengaturan', OpsController.getSettings); | |
| opsRouter.get('/pengaturan/:kunci', OpsController.getSettingByKey); | |
| opsRouter.put('/pengaturan/:kunci', authenticate, validate(updatePengaturanSchema), OpsController.updateSetting); | |
| // ================= NOTIFIKASI ================= | |
| opsRouter.get('/notifikasi', OpsController.listNotifications); | |
| opsRouter.get('/notifikasi/unread-count', OpsController.getUnreadNotificationCount); | |
| opsRouter.post('/notifikasi/read-all', OpsController.readAllNotifications); | |
| opsRouter.post('/notifikasi/:notif_id/read', OpsController.readNotification); | |
| export default opsRouter; | |