Skip to content
Shop

CommunityJoin Our PatreonDonate

Sponsored Ads

Sponsored Ads

Restaurant

Build a restaurant app with the following features.

UI/UX

Functional Requirements

  • Create,Read,Update,Delete an order
  • Create an customer
  • Update and remove 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

columndescription
idid of the item
namename of the item
namename of the item
namename of the item
namename of the item

OrderItem

columndescription
idid of the item
namename of the item
namename of the item
namename of the item
namename of the item

Customer

columndescription
idid of the item
namename of the item
namename of the item
namename of the item
namename of the item

Transaction

columndescription
idid of the item
namename of the item
namename of the item
namename of the item
namename 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)