import { Router } from "express";

import { assetsController } from "../controllers/assetsController.js";
import { asyncHandler } from "../utils/asyncHandler.js";

const router = Router();

router.get("/", asyncHandler(assetsController.list));
router.post("/", asyncHandler(assetsController.create));
router.get("/:id/depreciation-schedule", asyncHandler(assetsController.getDepreciationSchedule));
router.post("/:id/generate-depreciations", asyncHandler(assetsController.generateDepreciations));
router.post("/:id/dispose", asyncHandler(assetsController.dispose));
router.get("/:id", asyncHandler(assetsController.getById));
router.put("/:id", asyncHandler(assetsController.update));
router.delete("/:id", asyncHandler(assetsController.remove));

export default router;
