const express = require('express');
const router = express.Router();
const guard = require('../helpers/guard');
const controllers = require('../controllers/chats');
const validation = require('../validation/chat');

router
	.get('/', guard, controllers.listChats)
	.get('/:companionId', guard, controllers.getChatById)
	.post('/', guard, validation.startChat, controllers.startChat)
	.patch('/mute/', guard, controllers.muteChat)
	.patch('/sort/', guard, controllers.sortChat)
	.patch('/seen/', guard, controllers.seenChat)
	.patch('/typing/', guard, validation.typingChat, controllers.typingChat)
	.delete('/both/:id', guard, controllers.removeChatForBoth);

module.exports = router;
