update dataypes s
This commit is contained in:
parent
07cc192854
commit
166c3ff202
1 changed files with 16 additions and 0 deletions
|
@ -25,6 +25,9 @@ class Order:
|
||||||
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
|
||||||
|
|
||||||
|
def dict(self):
|
||||||
|
return {k: str(v) for k, v in asdict(self).items()}
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Ingredient:
|
class Ingredient:
|
||||||
|
@ -37,6 +40,9 @@ class Ingredient:
|
||||||
calories: int
|
calories: int
|
||||||
protein: int
|
protein: int
|
||||||
|
|
||||||
|
def dict(self):
|
||||||
|
return {k: str(v) for k, v in asdict(self).items()}
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Supplier:
|
class Supplier:
|
||||||
|
@ -49,6 +55,9 @@ class Supplier:
|
||||||
house_number: str
|
house_number: str
|
||||||
postal_code: int
|
postal_code: int
|
||||||
|
|
||||||
|
def dict(self):
|
||||||
|
return {k: str(v) for k, v in asdict(self).items()}
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class SupplierContainsIngredients:
|
class SupplierContainsIngredients:
|
||||||
|
@ -57,9 +66,16 @@ class SupplierContainsIngredients:
|
||||||
delivery_cost: int
|
delivery_cost: int
|
||||||
delivery_time: int
|
delivery_time: int
|
||||||
|
|
||||||
|
def dict(self):
|
||||||
|
return {k: str(v) for k, v in asdict(self).items()}
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class OrderContainsIngredients:
|
class OrderContainsIngredients:
|
||||||
order: Order
|
order: Order
|
||||||
ingredient: Ingredient
|
ingredient: Ingredient
|
||||||
quantity: int
|
quantity: int
|
||||||
|
|
||||||
|
def dict(self):
|
||||||
|
return {k: str(v) for k, v in asdict(self).items()}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue