forked from CipherVector/Uwc-Dinnerware-Management
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckout.py
More file actions
26 lines (22 loc) · 689 Bytes
/
checkout.py
File metadata and controls
26 lines (22 loc) · 689 Bytes
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
from utils import FirebaseApi, camera
from dotenv import dotenv_values
config = dotenv_values(".env")
api = FirebaseApi(config['creds_file'],
config['db_url'])
oldUserId = 59250
while True:
if oldUserId:
userId = oldUserId
# oldUserId = None
# else:
# userId = camera("BARCODE")
# if not str(userId).isnumeric():
# print("something went wrong. wrong user id scanned")
# continue
itemId = camera("QR")
if not str(itemId).isnumeric():
print("something went wrong. invalid cup scanned")
oldUserId = userId
continue
print(userId, itemId)
api.checkOut(userId, itemId)