Created a set of base models to begin fleshing out the data aspect of the application

This commit is contained in:
2023-12-31 16:27:39 +00:00
parent 213fc9c503
commit 54877495f0
10 changed files with 137 additions and 0 deletions

View File

View File

@ -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()

View File

@ -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