0% found this document useful (0 votes)
273 views2 pages

Restaurant Management Code

The document contains source code for a Restaurant Management System, including classes for MenuItem and Order, which handle menu items and customer orders respectively. It features methods for calculating order totals and converting objects to dictionaries for easy data handling. The system also initializes with CSV files for menu, orders, and customers, although the complete implementation is truncated.

Uploaded by

mirza480455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
273 views2 pages

Restaurant Management Code

The document contains source code for a Restaurant Management System, including classes for MenuItem and Order, which handle menu items and customer orders respectively. It features methods for calculating order totals and converting objects to dictionaries for easy data handling. The system also initializes with CSV files for menu, orders, and customers, although the complete implementation is truncated.

Uploaded by

mirza480455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Restaurant Management System Source Code

import csv
import os
import datetime
from typing import List, Dict
import uuid

class MenuItem:
def __init__(self, item_id: str, name: str, category: str, price:
float, available: bool = True):
self.item_id = item_id
[Link] = name
[Link] = category
[Link] = price
[Link] = available

def to_dict(self) -> Dict:


return {
'item_id': self.item_id,
'name': [Link],
'category': [Link],
'price': str([Link]),
'available': str([Link])
}

class Order:
def __init__(self, order_id: str, customer_name: str, items:
List[Dict], status: str = 'Pending'):
self.order_id = order_id
self.customer_name = customer_name
[Link] = items
[Link] = status
self.order_date = [Link]().strftime('%Y-%m-%d %H:
%M:%S')

def calculate_total(self) -> float:


return sum(float(item['price']) * item['quantity'] for item in
[Link])

def to_dict(self) -> Dict:


return {
'order_id': self.order_id,
'customer_name': self.customer_name,
'items': [Link],
'status': [Link],
'order_date': self.order_date,
'total': str(self.calculate_total())
}

class RestaurantManagement:
def __init__(self):
self.menu_file = '[Link]'
self.orders_file = '[Link]'
self.customers_file = '[Link]'
[Link] = self.load_menu()
[Link] = self.load_orders()
[Link] = self.load_customers()

...
# (rest of the code truncated for brevity in this snippet)
...
if __name__ == "__main__":
main()

You might also like