OnlyBiggg commited on
Commit
e86e66c
·
1 Parent(s): 34c83f6
app/dialogflow/services/dialog_service.py CHANGED
@@ -55,15 +55,6 @@ class DialogService:
55
  except Exception as e:
56
  print(e)
57
  raise Exception("Error fetching seats data")
58
-
59
- async def is_valid_select_seat(self, seat: str,route_id: int, trip_id:int, departure_date: str, departure_time: str, kind: str):
60
- if seat is None:
61
- return False
62
- seats = await self.seats_trip(route_id, trip_id, departure_date, departure_time, kind)
63
- for seat_data in seats:
64
- if seat_data['chair'] == seat and seat_data['bookStatus'] == 'available':
65
- return True
66
- return False
67
 
68
  @staticmethod
69
  async def search_trip(from_time: int, to_time: int, route_ids: list[int], ticket_count: int = 1):
@@ -82,6 +73,16 @@ class DialogService:
82
  except Exception as e:
83
  print(e)
84
  raise Exception("Error fetching trip data")
 
 
 
 
 
 
 
 
 
 
85
  async def search_trip_by_id(self, trip_id: int, from_time: int, to_time: int, route_ids: list[int], ticket_count: int = 1):
86
  trip = await self.search_trip(from_time, to_time, route_ids, ticket_count)
87
  for item in trip:
 
55
  except Exception as e:
56
  print(e)
57
  raise Exception("Error fetching seats data")
 
 
 
 
 
 
 
 
 
58
 
59
  @staticmethod
60
  async def search_trip(from_time: int, to_time: int, route_ids: list[int], ticket_count: int = 1):
 
73
  except Exception as e:
74
  print(e)
75
  raise Exception("Error fetching trip data")
76
+
77
+ async def is_valid_select_seat(self, seat: str,route_id: int, trip_id:int, departure_date: str, departure_time: str, kind: str):
78
+ if seat is None:
79
+ return False
80
+ seats = await self.seats_trip(route_id, trip_id, departure_date, departure_time, kind)
81
+ for seat_data in seats:
82
+ if seat_data['chair'] == seat and seat_data['bookStatus'] == 'available':
83
+ return True
84
+ return False
85
+
86
  async def search_trip_by_id(self, trip_id: int, from_time: int, to_time: int, route_ids: list[int], ticket_count: int = 1):
87
  trip = await self.search_trip(from_time, to_time, route_ids, ticket_count)
88
  for item in trip: