feat: routes for auth, rent and catalog

#10
This commit is contained in:
2024-04-23 11:17:38 +02:00
parent 7fb8c37cea
commit df9efc759c
4 changed files with 100 additions and 0 deletions

29
src/routes/rent/router.ts Normal file
View File

@@ -0,0 +1,29 @@
import express, {type Router} from "express";
import JwtGuard from "@validators/JwtGuard";
const router: Router = express.Router();
// Get rent affected to the user
router.route('/affected').get(JwtGuard)
// Get all vehicle in rent (admin only)
router.route('/affected/all').get(JwtGuard)
// Add a new vehicle (admin only)
router.route('/veh/new').post(JwtGuard)
// Get all vehicles
router.route('/veh/all').get()
// Rent a specific vehicle
router.route('/veh/rent/:vehicleId').post(JwtGuard)
// Endpoint to get the data of a vehicle, data change if source is an admin
router.route('/veh/:vehicleId').get(JwtGuard)
// Endpoint to edit the data of a vehicle if source is an admin
router.route('/veh/:vehicleId').patch(JwtGuard)
// Endpoint to delete a vehicle if source is an admin
router.route('/veh/:vehicleId').delete(JwtGuard)