const express = require("express");
const router = express.Router();
const authenticate = require("../../middlewares/authenticate");
const authorize = require("../../middlewares/authorize");
const { getInvoiceStatement } = require("../../controllers/accounts/statementController");

/**
 * @swagger
 * tags:
 *   name: Statements
 *   description: Customer statement APIs
 */

router.get(
  "/invoice/:invoiceId/statement",
  authenticate,
  authorize(["admin", "manager"]),
  (req, res) => {
    /*
      #swagger.tags = ['Statements']
      #swagger.summary = 'Get invoice statement view'
      #swagger.security = [{ "bearerAuth": [] }]
    */
    getInvoiceStatement(req, res);
  }
);

module.exports = router;
