Work on updating order and order line models. Some code clean up.
This commit is contained in:
@@ -10,6 +10,7 @@ from app.lib_general import log, logging
|
||||
from .common_field_schema import base_fields, default_num_bytes
|
||||
|
||||
|
||||
# Updated 2022-01-20
|
||||
class Order_Line_Base(BaseModel):
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
@@ -77,7 +78,8 @@ class Order_Line_Base(BaseModel):
|
||||
name: Optional[str] # Should be the same as product_name above
|
||||
quantity: int = Field(0, ge=0, lt=150)
|
||||
amount: int = Field(0, ge=0, lt=1500000)
|
||||
dollar_amount: Optional[str]
|
||||
total: int = Field(0, ge=0, lt=1500000) # Calculated with trigger
|
||||
|
||||
recurring: Optional[bool] = False
|
||||
message: Optional[str]
|
||||
|
||||
@@ -88,6 +90,9 @@ class Order_Line_Base(BaseModel):
|
||||
|
||||
# Including convenience data
|
||||
# This is only for convenience. Probably going to keep unless it causes a problem.
|
||||
dollar_amount: Optional[str] # From SQL view
|
||||
dollar_total: int = Optional[str] # From SQL view
|
||||
|
||||
order_status: Optional[str]
|
||||
order_notes: Optional[str]
|
||||
order_created_on: Optional[datetime.datetime] = None
|
||||
|
||||
Reference in New Issue
Block a user