Skip to content
Snippets Groups Projects
Commit 2eb18f59 authored by Sahu, Pratyush K (PG/T - Comp Sci & Elec Eng)'s avatar Sahu, Pratyush K (PG/T - Comp Sci & Elec Eng)
Browse files

Fixed small bugs in booking

parent 021cd805
No related branches found
No related tags found
No related merge requests found
import math
import os
import random
import sqlite3
from datetime import datetime
......
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from fastapi.middleware.cors import CORSMiddleware
from fastapi import FastAPI, HTTPException # type: ignore
from pydantic import BaseModel # type: ignore
from fastapi.middleware.cors import CORSMiddleware # type: ignore
from typing import List
import sqlite3
from pathlib import Path
......
......@@ -123,7 +123,7 @@ async def book_bike(booking: Booking):
raise HTTPException(status_code=400, detail="Bike not available at the specified location.")
# Calculate the amount to be blocked on the user's wallet
blocked_amount = price_per_hour * booking.duration_hours
blocked_amount = price_per_hour * 5
# Validate wallet balance
if wallet_balance < blocked_amount:
......
......@@ -32,3 +32,4 @@ uvicorn==0.29.0
uvloop==0.19.0
watchfiles==0.21.0
websockets==12.0
apscheduler==3.7.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment