const express = require('express');
const Router = express.Router();
const controller = require("../app/controllers/User.Controller");
const validator = require("../app/validator/userValidator");
const authorize = require('../app/service/authorize');
const autintiation = require("../app/middleware/authMiddleware");
const AuthController = require('../app/controllers/Auth.Controller');
// --------------------------------------------------- user/club
Router.get(`/login`, AuthController.genaretpass);
Router.post(`/login`, AuthController.user);
Router.delete(`/logout`, autintiation, AuthController.logout);
Router.get("/clubs", controller.clubs);
Router.post("/add", validator.adduser, validator.error, controller.add);
Router.get("/profile", autintiation, authorize("user", "club"), controller.profile);
Router.get("/mysponser", autintiation, authorize("user", "club"), controller.mysponser);
Router.patch("/club/update", autintiation, authorize("user"), controller.clubchenge);
Router.post("/pass/update", autintiation, authorize("user","admin"), controller.passupdate);
Router.patch("/transfer", autintiation, authorize("user", "club"), controller.transfer);
// ---------------------------------------------------- admin
Router.get("/", autintiation, authorize("admin"), controller.getUser);
Router.patch("/to-club", autintiation, authorize("admin"), controller.usertoclub);
Router.get("/club", autintiation, authorize("admin"), controller.getClubholder);
Router.patch("/cut-taka/:id", autintiation, authorize("admin"), controller.cuttaka);
Router.patch("/commition/:id", autintiation, authorize("admin"), controller.commition);
Router.patch("/parmition/:id", autintiation, authorize("admin"), controller.parmition);
Router.patch("/block/:id", autintiation, authorize("admin"), controller.block);
Router.patch("/trash/:id", autintiation, authorize("admin"), controller.parmition);
Router.post("/login-id/:id", autintiation, authorize("admin"), controller.loginid);


module.exports = Router;