Work on redoing orders and related. A lot of code clean up. I think it works pretty well.

This commit is contained in:
Scott Idem
2022-01-19 18:51:24 -05:00
parent 9dbbc26d06
commit d1d3b30ece
8 changed files with 281 additions and 102 deletions

View File

@@ -26,7 +26,7 @@ class Order_Line_Base(BaseModel):
order_id_random: Optional[str]
order_id: Optional[int]
product_id_random: str
product_id_random: str = None
product_id: Optional[int]
account_id_random: Optional[str]
@@ -48,7 +48,7 @@ class Order_Line_Base(BaseModel):
product_unit_price: Optional[int] # Copied from product record
product_recurring: Optional[bool] # Copied from product record
curr_product_id_random: str # Should be the same as product_id_random above
curr_product_id_random: Optional[str] # Should be the same as product_id_random above
curr_product_id: Optional[int] # Should be the same as product_id above
# NOTE: This is reversed with for_id_random
@@ -93,6 +93,8 @@ class Order_Line_Base(BaseModel):
order_created_on: Optional[datetime.datetime] = None
order_updated_on: Optional[datetime.datetime] = None
remove_line: bool = False
# Including other related objects
# product: Optional[Union[Product_Base, None]] # Future use?
# for_person: Optional[Union[Person_Base, None]] # Future use?