Create and Test User and Farm Routes

This commit is contained in:
2025-02-22 17:03:24 +05:30
parent 1fdb739950
commit 330589bdf1
14 changed files with 617 additions and 27 deletions
+24
View File
@@ -0,0 +1,24 @@
import express from "express";
import {
createFinanceRecord,
getFinanceRecords,
getFinanceById,
updateFinance,
deleteFinance,
addTransaction,
} from "../controllers/financeController.js";
import { checkAuthenticated } from "../Middlewares/authentication.js";
const router = express.Router();
// Routes for finance management
router.post("/", checkAuthenticated, createFinanceRecord); // Create a new finance record
router.get("/", checkAuthenticated, getFinanceRecords); // Get all finance records
router.get("/:financeId", checkAuthenticated, getFinanceById); // Get a finance record by ID
router.put("/:financeId", checkAuthenticated, updateFinance); // Update finance record
router.delete("/:financeId", checkAuthenticated, deleteFinance); // Delete a finance record
// Add transactions (Expense/Revenue) to a finance record
router.post("/:financeId/transaction", checkAuthenticated, addTransaction);
export default router;