|
|
@@ -1,3 +1,4 @@
|
|
|
+import csv
|
|
|
import os
|
|
|
import json
|
|
|
import secrets
|
|
|
@@ -211,6 +212,13 @@ async def printer_order(order: OrderWeb):
|
|
|
printer = PrinterUSB(0xfe6,0x811e)
|
|
|
print_order = Order(order.customerName,[Item(item.name, item.price, item.quantity) for item in items])
|
|
|
printer.print_order(print_order, table)
|
|
|
+ if not os.path.exists('logs.csv'):
|
|
|
+ with open('logs.csv', 'w', newline='') as f:
|
|
|
+ writer = csv.writer(f)
|
|
|
+ writer.writerow(['userName', 'table', 'orderDate', 'items'])
|
|
|
+ with open('logs.csv', 'a', newline='') as f:
|
|
|
+ writer = csv.writer(f)
|
|
|
+ writer.writerow([order.customerName, order.table, order.orderDate, items])
|
|
|
|
|
|
|
|
|
@app.post("/api/chat/completions",
|