import { Router } from "express";
import authorize from "../middlewares/authorization.middleware";
import landlords from "../controllers/landlords.controller";
import landlordTransactions from "../controllers/landlordTransaction.controller";

const router = Router();

router.get("/dashboard", authorize, landlords.Dashboard);
router.post("/add", authorize, landlords.Add);
router.post("/edit/new", authorize, landlords.EditX);
router.post("/editx", authorize, landlords.EditDetail);
router.get("/list", authorize, landlords.ListForClient);
router.get("/list/new", authorize, landlords.ListForClientX);

router.post("/delete", authorize, landlords.Delete);

router.get(
  "/web/agreement-expiring",
  authorize,
  landlords.GetExpiringAgreementsForWeb
);

router.get(
  "/web/lockin-tracker",
  authorize,
  landlords.GetExpiringLockInPeriodForWeb
);

router.post(
  "/manage/paymentdetail",
  authorize,
  landlords.ManagePaymentDetails,
);

router.post(
  "/transaction/add",
  authorize,
  landlordTransactions.Add,
);

router.get(
  "/transaction/list",
  authorize,
  landlordTransactions.GetLandlordTransactions,
);

router.post(
  "/payment/init", 
  authorize, 
  landlords.InitiateLandlordPayment
);

router.get(
  "/unpaid/expenses/list",
  authorize,
  landlords.GetUnpaidRentsForClient,
);

router.get(
  "/payment/list/web",
  authorize,
  landlords.GetPaymentsForWeb,
);

router.post(
  "/edit",
  authorize,
  landlords.Edit,
);

router.get(
  "/records/list",
  authorize,
  landlords.ListRecords,
);

router.get(
  "/list/unPaidDues",
  authorize,
  landlords.GetUnPaidDuesByClientId,
);

router.get(
  "/list/properties",
  authorize,
  landlords.GetPropertyList,
);

router.get(
  "/list/staffs",
  authorize,
  landlords.GetPropertyStaffList,
);

router.get(
  "/list/clients",
  authorize,
  landlords.GetClientList,
);

router.get(
  "/list/collections",
  authorize,
  landlords.GetCollectionsByLandlordId,
);

router.get(
  "/list/dues",
  authorize,
  landlords.GetDuesByLandlordId,
);

router.get(
  "/list/leases",
  authorize,
  landlords.ListLeaseForLandlord,
);

router.get(
  "/client/summary",
  authorize,
  landlords.Summary,
);
export default router;
