Restaurant
Build a restaurant app with the following features.
UI/UX
Functional Requirements
- Create,Read,Update,Delete an
order
- Create an
customer
Update
andremove
from an order
Sample below:
python
class Order(x):
print("do bank stuff")
class Customer(x):
print("do account stuff")
class Menu(x):
print("do client stuff")
Non Functional Requirements
- Item
- Item
Schema
Order
column | description |
---|---|
id | id of the item |
name | name of the item |
name | name of the item |
name | name of the item |
name | name of the item |
OrderItem
column | description |
---|---|
id | id of the item |
name | name of the item |
name | name of the item |
name | name of the item |
name | name of the item |
Customer
column | description |
---|---|
id | id of the item |
name | name of the item |
name | name of the item |
name | name of the item |
name | name of the item |
Transaction
column | description |
---|---|
id | id of the item |
name | name of the item |
name | name of the item |
name | name of the item |
name | name of the item |
Business Rules
Rules about how things should work...
Solution
py
class Order:
def __init__(self,name="New Bank"):
self.name = name
self.accounts = []
def add_account(self,x):
self.accounts.append(x)
class Customer:
def __init__(self,name="New Account",account_holder=None):
self.amount = 0
self.name = name
self.account_holder = account_holder
def withdraw(self,x):
self.amount -= x
def deposit(self,x):
self.amount += x
def __repr__(self):
return str({
"name": self.name,
"amount": self.amount,
"account_holder": self.account_holder
})
class OrderItem:
def __init__(self,name="New Bank"):
self.name = name
self.accounts = []
def add_account(self,x):
self.accounts.append(x)