const express = require("express");
const { body, param } = require("express-validator");
const isAuth = require("../../middlewares/authorization");

const {
  getCustomerCreditLimit,
  getCustomerCreditTerms,
  buildCreditSubmission1,
  buildCreditDraft1,
  buildCreditSubmission2,
  buildCreditSubmissionFiles2,
  buildCreditDraft2,
  buildCreditDraftFiles2,
  buildCreditSubmissionFiles3,
  buildCreditDraftFiles3,
  buildCreditFinalSubmission,
} = require("../../controllers/v3/buildcredit.controller");

const router = express.Router();

router.get("/credit-limit", isAuth, getCustomerCreditLimit);
router.get("/credit-date-limit", isAuth, getCustomerCreditTerms);
router.post("/form-1", isAuth, buildCreditSubmission1);
router.get("/form-1", isAuth, buildCreditDraft1);
router.post("/form-2", isAuth, buildCreditSubmission2);
router.post("/form-2-files", isAuth, buildCreditSubmissionFiles2);
router.get("/form-2", isAuth, buildCreditDraft2);
router.get("/form-2-files", isAuth, buildCreditDraftFiles2);
router.post("/form-3-files", isAuth, buildCreditSubmissionFiles3);
router.get("/form-3-files", isAuth, buildCreditDraftFiles3);
router.post("/final", isAuth, buildCreditFinalSubmission);

module.exports = router;
