const express = require("express");
const router = express.Router();
const { authorize, callback, receivables, payables, payments } = require("../accounting/qbo/qbo");
const validateFirebaseIdTokenMiddleware = require("../middleware/validateFirebaseIdTokenMiddleware");
const withUserGraphQLClientMiddleware = require("../middleware/withUserGraphQLClientMiddleware"); // Assuming you have a qbo module for handling QuickBooks Online related functionalities

// Define the routes for QuickBooks Online
router.post("/authorize", validateFirebaseIdTokenMiddleware, authorize);
router.get("/callback", callback);
router.post("/receivables", validateFirebaseIdTokenMiddleware, withUserGraphQLClientMiddleware, receivables);
router.post("/payables", validateFirebaseIdTokenMiddleware, withUserGraphQLClientMiddleware, payables);
router.post("/payments", validateFirebaseIdTokenMiddleware, withUserGraphQLClientMiddleware, payments);

module.exports = router;
