-
Notifications
You must be signed in to change notification settings - Fork 0
/
resultCodes.py
34 lines (29 loc) · 1.26 KB
/
resultCodes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
VEHICLE_RC_NOT_ACTIVE = 1
VEHICLE_REGISTRATION_EXPIRED = 2
VEHICLE_INSURANCE_EXPIRED = 3
VEHICLE_OVERLOADED = 4
VEHICLE_ALLOWED = 5
def vehicleNotAllowed(reason):
print("There seems to be a problem...")
print("Error:", reason)
print('Please wait until the officials arrive and ' + '\n' + 'resolve this manually...')
print('Thank you...')
def vehicleAllowed(price):
print('Your vehicle Toll price:', price)
print('The amount deducted from your FASTag-Wallet:', price)
print('Remaining Balance: Rs.', 200-price) # Check how to get current E-Toll-Balance
print('Wear seat belt and Drive Safe...')
def decideTollAction(tollDecision):
if tollDecision == VEHICLE_RC_NOT_ACTIVE:
return vehicleNotAllowed('Vehicle RC Status is not ACTIVE')
elif tollDecision == VEHICLE_RC_NOT_ACTIVE:
return vehicleNotAllowed('Vehicle Registration has expired')
elif tollDecision == VEHICLE_INSURANCE_EXPIRED:
return vehicleNotAllowed('Your vehicle Insurance has expired')
elif tollDecision == VEHICLE_OVERLOADED:
return vehicleNotAllowed('Vehicle is loaded above maximum capacity')
else:
return vehicleAllowed(tollDecision)