diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/models/order.py b/models/order.py new file mode 100644 index 0000000..3abc6cb --- /dev/null +++ b/models/order.py @@ -0,0 +1,13 @@ +from datetime import datetime + +class Order: + ''' + Constructor for an order object + ''' + def __init__(self): + self.id = 0 + self.sellerID = 0 + self.customerID = 0 + self.products = list() + self.totalCost = 0.0 + self.orderDate = datetime.now() \ No newline at end of file diff --git a/models/products/__init__.py b/models/products/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/models/products/carpart.py b/models/products/carpart.py new file mode 100644 index 0000000..3603f82 --- /dev/null +++ b/models/products/carpart.py @@ -0,0 +1,13 @@ +from product import Product + +class CarPart(Product): + ''' + Constructor for a car part + + Contains additional information that is only relevant for car parts + ''' + def __init__(self): + super().__init__() + self.make = "" + self.compatibleVehicles = list() + \ No newline at end of file diff --git a/models/products/product.py b/models/products/product.py new file mode 100644 index 0000000..1232618 --- /dev/null +++ b/models/products/product.py @@ -0,0 +1,22 @@ +from abc import ABC +from datetime import datetime + +class Product(ABC): + ''' + Base class for a product + ''' + def __init__(self): + self.productID = 0 + self.name = "" + self.cost = 0.0 + self.category = "" + self.sellerID = 0 + self.postedDate = datetime.now() + self.quantityAvailable = 0 + + def addToBasket(): + pass + + def buyProduct(): + pass + \ No newline at end of file diff --git a/models/users/__init__.py b/models/users/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/models/users/admin.py b/models/users/admin.py new file mode 100644 index 0000000..ea3f067 --- /dev/null +++ b/models/users/admin.py @@ -0,0 +1,25 @@ +from user import User + +class Admin(User): + ''' + Class constructor to instatiate an Admin object + ''' + def __init__(self): + super().__init__() + self.store = "" + + def login(): + print("Logging in as Admin") + + def signup(): + print("Signing up as Admin") + + def createProduct(): + pass + + def deleteProduct(): + pass + + def updateProduct(): + pass + diff --git a/models/users/customer.py b/models/users/customer.py new file mode 100644 index 0000000..afdf00d --- /dev/null +++ b/models/users/customer.py @@ -0,0 +1,17 @@ +from user import User + +class Customer(User): + ''' + Class constructor to instatiate a customer object + + No additional properties are assigned to the customer + ''' + def __init__(self): + super().__init__() + + def login(): + print("Logging in as Customer") + + def signup(): + print("Signing up as Customer") + diff --git a/models/users/seller.py b/models/users/seller.py new file mode 100644 index 0000000..28958d3 --- /dev/null +++ b/models/users/seller.py @@ -0,0 +1,25 @@ +from user import User + +class Seller(User): + ''' + Class constructor to instatiate a Seller object + ''' + def __init__(self): + super().__init__() + self.store = "" + + def login(): + print("Logging in as Seller") + + def signup(): + print("Signing up as Seller") + + def createProduct(): + pass + + def deleteProduct(): + pass + + def updateProduct(): + pass + diff --git a/models/users/user.py b/models/users/user.py new file mode 100644 index 0000000..95cd0c1 --- /dev/null +++ b/models/users/user.py @@ -0,0 +1,22 @@ +from abc import ABC, abstractmethod + +class User(ABC): + ''' + Class constructor to instatiate the base object + ''' + def __init__(self): + self.id = 0 + self.username = "" + self.email = "" + self.firstName = "" + self.lastName = "" + self.phone = "" + + @abstractmethod + def login(): + pass + + @abstractmethod + def signup(): + pass +