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
|
from dataclasses import dataclass, asdict
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Customer:
|
class Customer:
|
||||||
customer_id: int
|
customer_id: int
|
||||||
|
@ -16,13 +17,15 @@ class Customer:
|
||||||
def dict(self):
|
def dict(self):
|
||||||
return {k: str(v) for k, v in asdict(self).items()}
|
return {k: str(v) for k, v in asdict(self).items()}
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Order:
|
class Order:
|
||||||
order_id: int
|
order_id: int
|
||||||
customer_id: int
|
customer: Customer
|
||||||
invoice_amount: int
|
invoice_amount: int
|
||||||
order_date: str # Assuming timestamp as a string for simplicity
|
order_date: str # Assuming timestamp as a string for simplicity
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Ingredient:
|
class Ingredient:
|
||||||
ingredient_id: int
|
ingredient_id: int
|
||||||
|
@ -34,6 +37,7 @@ class Ingredient:
|
||||||
calories: int
|
calories: int
|
||||||
protein: int
|
protein: int
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Supplier:
|
class Supplier:
|
||||||
supplier_id: int
|
supplier_id: int
|
||||||
|
@ -45,15 +49,17 @@ class Supplier:
|
||||||
house_number: str
|
house_number: str
|
||||||
postal_code: int
|
postal_code: int
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class SupplierContainsIngredients:
|
class SupplierContainsIngredients:
|
||||||
supplier_id: int
|
supplier: Supplier
|
||||||
ingredient_id: int
|
ingredient: Ingredient
|
||||||
delivery_cost: int
|
delivery_cost: int
|
||||||
delivery_time: int
|
delivery_time: int
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class OrderContainsIngredients:
|
class OrderContainsIngredients:
|
||||||
order_id: int
|
order: Order
|
||||||
ingredient_id: int
|
ingredient: Ingredient
|
||||||
quantity: int
|
quantity: int
|
||||||
|
|
Loading…
Add table
Reference in a new issue