Skip to content

Commit

Permalink
🩹 fix: update missed trips calculation in lambda_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
LokoMoloko98 committed Jan 25, 2025
1 parent 370d4c6 commit 2e89abb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions swift-lift-fare-calculation/swift-lift-fare-calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ def lambda_handler(event, context):

# Fetch trips for the passenger
weekly_trips = get_weekly_trips(passenger_id, target_week)
missed_trips = [trip for trip in weekly_trips if trip['status'] == 'missed']
total_trips = len(weekly_trips)
missed_trips_list = [trip for trip in weekly_trips if trip['status'] == 'missed']
missed_trips = len(missed_trips_list)
total_trips = 10 # Expected Total trips in a week
print(f"Total trips: {total_trips}, Missed trips: {missed_trips}")

# Calculate the discount threshold
Expand Down

0 comments on commit 2e89abb

Please sign in to comment.