Spaces:
Sleeping
Sleeping
williamagyapong
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -5,7 +5,7 @@ from dotenv import load_dotenv
|
|
5 |
from heyoo import WhatsApp
|
6 |
import assemblyai as aai
|
7 |
import openai
|
8 |
-
from utility import parse_multiple_transactions, create_inventory,
|
9 |
from google.cloud import firestore
|
10 |
|
11 |
|
@@ -143,7 +143,7 @@ def hook():
|
|
143 |
firestore_msg = "Sorry, could not record transaction!"
|
144 |
|
145 |
elif trans_type == 'sale':
|
146 |
-
if
|
147 |
firestore_msg = "Transaction recorded successfully!"
|
148 |
else:
|
149 |
firestore_msg = "Sorry, could not record transaction!"
|
|
|
5 |
from heyoo import WhatsApp
|
6 |
import assemblyai as aai
|
7 |
import openai
|
8 |
+
from utility import parse_multiple_transactions, create_inventory, create_sale
|
9 |
from google.cloud import firestore
|
10 |
|
11 |
|
|
|
143 |
firestore_msg = "Sorry, could not record transaction!"
|
144 |
|
145 |
elif trans_type == 'sale':
|
146 |
+
if create_sale(user_phone, parsed_trans_data):
|
147 |
firestore_msg = "Transaction recorded successfully!"
|
148 |
else:
|
149 |
firestore_msg = "Sorry, could not record transaction!"
|