
import { Router } from 'express';
import { authenticate } from '../middleware/authMiddleware.js';
import AdminController from '../controllers/adminController.js';

const router = Router();
const adminController = new AdminController();

// --- Chat Room Admin ---
router.get('/chat/room-types', authenticate, adminController.getRoomTypes);
router.get('/chat/gender-restrictions', authenticate, adminController.getGenderRestrictions);
router.get('/chat/user-rights', authenticate, adminController.getUserRights);
router.get('/chat/rooms', authenticate, adminController.getRooms);
router.post('/chat/rooms', authenticate, adminController.createRoom);
router.put('/chat/rooms/:id', authenticate, adminController.updateRoom);
router.delete('/chat/rooms/:id', authenticate, adminController.deleteRoom);

// --- Users Admin ---
router.get('/users/search', authenticate, adminController.searchUsers);
router.get('/users/statistics', authenticate, adminController.getUserStatistics);
router.get('/users/batch', authenticate, adminController.getUsers);
router.get('/users/:id', authenticate, adminController.getUser);
router.put('/users/:id', authenticate, adminController.updateUser);

// --- Rights Admin ---
router.get('/rights/types', authenticate, adminController.listRightTypes);
router.get('/rights/:id', authenticate, adminController.listUserRights);
router.post('/rights/:id', authenticate, adminController.addUserRight);
router.delete('/rights/:id', authenticate, adminController.removeUserRight);

router.get('/interests/open', authenticate, adminController.getOpenInterests);
router.post('/interest', authenticate, adminController.changeInterest);
router.post('/interest/translation', authenticate, adminController.changeTranslation);
router.delete('/interest/:id', authenticate, adminController.deleteInterest);
router.get('/opencontacts', authenticate, adminController.getOpenContacts);
router.post('/contacts/answer', authenticate, adminController.answerContact);
router.post('/falukant/searchuser', authenticate, adminController.searchUser);
router.get('/falukant/getuser/:id', authenticate, adminController.getFalukantUserById);
router.post('/falukant/edituser', authenticate, adminController.changeFalukantUser);
router.get('/falukant/branches/:falukantUserId', authenticate, adminController.getFalukantUserBranches);
router.put('/falukant/stock/:stockId', authenticate, adminController.updateFalukantStock);
router.post('/falukant/stock', authenticate, adminController.addFalukantStock);
router.get('/falukant/stock-types', authenticate, adminController.getFalukantStockTypes);
router.get('/falukant/regions', authenticate, adminController.getFalukantRegions);
router.put('/falukant/regions/:id/map', authenticate, adminController.updateFalukantRegionMap);
router.get('/falukant/region-distances', authenticate, adminController.getRegionDistances);
router.post('/falukant/region-distances', authenticate, adminController.upsertRegionDistance);
router.delete('/falukant/region-distances/:id', authenticate, adminController.deleteRegionDistance);
router.post('/falukant/npcs/create', authenticate, adminController.createNPCs);
router.get('/falukant/npcs/status/:jobId', authenticate, adminController.getNPCsCreationStatus);
router.get('/falukant/titles', authenticate, adminController.getTitlesOfNobility);
 
// --- Minigames Admin ---
router.get('/minigames/match3/campaigns', authenticate, adminController.getMatch3Campaigns);
router.get('/minigames/match3/campaigns/:id', authenticate, adminController.getMatch3Campaign);
router.post('/minigames/match3/campaigns', authenticate, adminController.createMatch3Campaign);
router.put('/minigames/match3/campaigns/:id', authenticate, adminController.updateMatch3Campaign);
router.delete('/minigames/match3/campaigns/:id', authenticate, adminController.deleteMatch3Campaign);

router.get('/minigames/match3/levels', authenticate, adminController.getMatch3Levels);
router.get('/minigames/match3/levels/:id', authenticate, adminController.getMatch3Level);
router.post('/minigames/match3/levels', authenticate, adminController.createMatch3Level);
router.put('/minigames/match3/levels/:id', authenticate, adminController.updateMatch3Level);
router.delete('/minigames/match3/levels/:id', authenticate, adminController.deleteMatch3Level);

// Objectives
router.get('/minigames/match3/objectives', authenticate, adminController.getMatch3Objectives);
router.get('/minigames/match3/objectives/:id', authenticate, adminController.getMatch3Objective);
router.post('/minigames/match3/objectives', authenticate, adminController.createMatch3Objective);
router.put('/minigames/match3/objectives/:id', authenticate, adminController.updateMatch3Objective);
router.delete('/minigames/match3/objectives/:id', authenticate, adminController.deleteMatch3Objective);

router.get('/minigames/match3/tile-types', authenticate, adminController.getMatch3TileTypes);
router.post('/minigames/match3/tile-types', authenticate, adminController.createMatch3TileType);
router.put('/minigames/match3/tile-types/:id', authenticate, adminController.updateMatch3TileType);
router.delete('/minigames/match3/tile-types/:id', authenticate, adminController.deleteMatch3TileType);

export default router;
