const {
  getNews,
  getAnnualReport,
  getOtherPub,
  getBOD,
  getBudget,
  getPort,
} = require("../utils/getQuery");

const router = require("express").Router();

// Shippers News
router.get("/news", async (req, res) => {
  try {
    const data = await getNews();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

// Annual Report
router.get("/annual", async (req, res) => {
  try {
    const data = await getAnnualReport();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

// Other Publications
router.get("/others", async (req, res) => {
  try {
    const data = await getOtherPub();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

// Budget Recom
router.get("/budget", async (req, res) => {
  try {
    const data = await getBudget();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

// Port Recom
router.get("/port", async (req, res) => {
  try {
    const data = await getPort();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

module.exports = router;
