2024-08-04 09:01:17 +02:00
|
|
|
from src.classes import product_classes
|
|
|
|
|
|
2024-08-04 10:23:58 +02:00
|
|
|
apple = product_classes.Product(name="Appel", price=1.0, barcode=1000 , image_url="https://i.etsystatic.com/16348658/r/il/380709/1340147432/il_570xN.1340147432_p3pc.jpg")
|
|
|
|
|
bubble_tea = product_classes.Product(name="Bubble Tea", price=5.0, barcode=1001 ,image_url="https://uxwing.com/wp-content/themes/uxwing/download/food-and-drinks/bubble-tea-icon.png")
|
2024-08-04 09:01:17 +02:00
|
|
|
|
2024-08-04 09:05:15 +02:00
|
|
|
product_list = [apple, bubble_tea]
|
2024-08-04 09:01:17 +02:00
|
|
|
|
|
|
|
|
def get_all_products() -> list[product_classes.Product]:
|
2024-08-04 10:23:58 +02:00
|
|
|
return product_list
|
|
|
|
|
|
|
|
|
|
def get_single_product(barcode: int) -> product_classes.Product:
|
|
|
|
|
for product in product_list:
|
|
|
|
|
if product.barcode == barcode:
|
|
|
|
|
return product
|