File size: 1,088 Bytes
34e0e37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os
import pandas as pd
import json

CUSTOMERS_FILE = "database/customers.xlsx"
MENU_FILE = "database/menu.xlsx"
ORDERS_FILE = "database/orders.xlsx"
CONFIG_FILE = "utils/config.json"

def initialize_files():
    if not os.path.exists(CUSTOMERS_FILE):
        pd.DataFrame(columns=["Name", "Email", "Password", "Preferences", "Allergies", "Occasion"]).to_excel(CUSTOMERS_FILE, index=False)
    if not os.path.exists(MENU_FILE):
        pd.DataFrame(columns=["Dish Name", "Price", "Allergens", "Ingredients", "Nutrition", "Image", "Spice Level"]).to_excel(MENU_FILE, index=False)
    if not os.path.exists(ORDERS_FILE):
        pd.DataFrame(columns=["Table ID", "Customer Email", "Order Details", "Total Cost"]).to_excel(ORDERS_FILE, index=False)
    if not os.path.exists(CONFIG_FILE):
        config = {
            "spice_levels": ["Mild", "Medium", "High"],
            "preferences": ["Vegetarian", "Vegan", "Halal", "Full Menu"],
            "occasions": ["Birthday", "Anniversary", "Other"]
        }
        with open(CONFIG_FILE, "w") as f:
            json.dump(config, f)