update dataypes
This commit is contained in:
parent
04cafd0bf2
commit
07cc192854
1 changed files with 11 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
from dataclasses import dataclass, asdict
|
||||
|
||||
|
||||
@dataclass
|
||||
class Customer:
|
||||
customer_id: int
|
||||
|
@ -16,13 +17,15 @@ class Customer:
|
|||
def dict(self):
|
||||
return {k: str(v) for k, v in asdict(self).items()}
|
||||
|
||||
|
||||
@dataclass
|
||||
class Order:
|
||||
order_id: int
|
||||
customer_id: int
|
||||
customer: Customer
|
||||
invoice_amount: int
|
||||
order_date: str # Assuming timestamp as a string for simplicity
|
||||
|
||||
|
||||
@dataclass
|
||||
class Ingredient:
|
||||
ingredient_id: int
|
||||
|
@ -34,6 +37,7 @@ class Ingredient:
|
|||
calories: int
|
||||
protein: int
|
||||
|
||||
|
||||
@dataclass
|
||||
class Supplier:
|
||||
supplier_id: int
|
||||
|
@ -45,15 +49,17 @@ class Supplier:
|
|||
house_number: str
|
||||
postal_code: int
|
||||
|
||||
|
||||
@dataclass
|
||||
class SupplierContainsIngredients:
|
||||
supplier_id: int
|
||||
ingredient_id: int
|
||||
supplier: Supplier
|
||||
ingredient: Ingredient
|
||||
delivery_cost: int
|
||||
delivery_time: int
|
||||
|
||||
|
||||
@dataclass
|
||||
class OrderContainsIngredients:
|
||||
order_id: int
|
||||
ingredient_id: int
|
||||
order: Order
|
||||
ingredient: Ingredient
|
||||
quantity: int
|
||||
|
|
Loading…
Add table
Reference in a new issue