"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const Authnetication_1 = require("../../Middlewares/Authnetication");
const CarMakeController_1 = require("../../controllers/Admin/CarMakeController");
const CarModelController_1 = require("../../controllers/Admin/CarModelController");
const CarController_1 = require("../../controllers/Admin/CarController");
const CarAvatarController_1 = require("../../controllers/Admin/CarAvatarController");
const CarColorController_1 = require("../../controllers/Admin/CarColorController");
const CarTypeController_1 = require("../../controllers/Admin/CarTypeController");
const multer = require("multer");
class CarRouter {
    constructor() {
        this.router = (0, express_1.Router)();
        this.post();
        this.get();
    }
    post() {
        const storage = multer.memoryStorage();
        const upload = multer({ storage });
        this.router.post("/add-edit/:id?", Authnetication_1.default.admin, CarController_1.CarController.addEdit);
        //start brand controller
        this.router.post("/add-edit-make/:id?", Authnetication_1.default.admin, upload.single("image"), CarMakeController_1.CarMakeController.addEdit);
        this.router.post("/edit-image/:id?", Authnetication_1.default.admin, upload.single("image"), CarMakeController_1.CarMakeController.editImage);
        //end brand controller
        this.router.post("/add-edit-model/:id?", Authnetication_1.default.admin, CarModelController_1.CarModelController.addEdit);
        this.router.post("/add-edit-avatar/:id?", Authnetication_1.default.admin, upload.single("image"), CarAvatarController_1.CarAvatarController.addEdit);
        this.router.post("/add-edit-color/:id?", Authnetication_1.default.admin, CarColorController_1.CarColorController.addEdit);
        this.router.post("/add-edit-type/:id?", Authnetication_1.default.admin, CarTypeController_1.CarTypeController.addEdit);
        this.router.post("/import-make", Authnetication_1.default.admin, CarMakeController_1.CarMakeController.importMake);
        this.router.post("/import-model", Authnetication_1.default.admin, CarModelController_1.CarModelController.importModel);
    }
    get() {
        this.router.get("/list", Authnetication_1.default.admin, CarController_1.CarController.list);
        this.router.get("/make", Authnetication_1.default.admin, CarMakeController_1.CarMakeController.list);
        this.router.get("/model", Authnetication_1.default.admin, CarModelController_1.CarModelController.list);
        this.router.get("/avatar", Authnetication_1.default.admin, CarAvatarController_1.CarAvatarController.list);
        this.router.get("/color", Authnetication_1.default.admin, CarColorController_1.CarColorController.list);
        this.router.get("/type", Authnetication_1.default.admin, CarTypeController_1.CarTypeController.list);
        this.router.get("/status/:id", Authnetication_1.default.admin, CarController_1.CarController.statusChange);
        this.router.get("/status-make/:id", Authnetication_1.default.admin, CarMakeController_1.CarMakeController.statusChange);
        this.router.get("/remove-image/:id", Authnetication_1.default.admin, CarMakeController_1.CarMakeController.removeImage);
        this.router.get("/status-model/:id", Authnetication_1.default.admin, CarModelController_1.CarModelController.statusChange);
        this.router.get("/status-avatar/:id", Authnetication_1.default.admin, CarAvatarController_1.CarAvatarController.statusChange);
        this.router.get("/status-color/:id", Authnetication_1.default.admin, CarColorController_1.CarColorController.statusChange);
        this.router.get("/status-type/:id", Authnetication_1.default.admin, CarTypeController_1.CarTypeController.statusChange);
        this.router.get("/view/:id", Authnetication_1.default.admin, CarController_1.CarController.view);
    }
}
exports.default = new CarRouter().router;
