Work on order and Strip related. Also general code clean up

This commit is contained in:
Scott Idem
2022-01-25 20:01:46 -05:00
parent 86b06226cb
commit 59b263e5b8
5 changed files with 19 additions and 8 deletions

View File

@@ -85,9 +85,9 @@ class Account_Cfg_Base(BaseModel):
hide_posts_after: Optional[int] # Should posts be singular?
delete_posts_after: Optional[int] # Should posts be singular?
stripe_api_key: Optional[str]
stripe_publishable_key: Optional[str]
stripe_account_id: Optional[str]
stripe_api_key: Optional[str] # Secret/Private
stripe_publishable_key: Optional[str] # Publish/Sharable
stripe_account_id: Optional[str] # Connected Stripe Account ID
created_on: Optional[datetime.datetime] = None
updated_on: Optional[datetime.datetime] = None

View File

@@ -31,6 +31,9 @@ class Order_Cfg_Base(BaseModel):
order_fundraising_thanks: Optional[str]
order_fundraising_message: Optional[str]
stripe_api_key: Optional[str] # Secret/Private
stripe_publishable_key: Optional[str] # Publish/Sharable
stripe_account_id: Optional[str] # Connected Stripe Account ID
_processed_at: datetime.datetime = PrivateAttr(default_factory=datetime.datetime.now)

View File

@@ -36,7 +36,7 @@ class Order_Base(BaseModel):
total_bill: Optional[int] = Field(0, ge=0, lt=1500000) # Set with triggers; matches total_amount in order_cart
total_paid: Optional[int] = Field(0, ge=0, lt=1500000)
balance: Optional[int] = Field(0, ge=-1500000, lt=1500000) # Calculated with trigger
status: Optional[str] # open, locked, reopened, closed, canceled, other
status: Optional[Union[list,str]] # open, locked, reopened, closed, canceled, other
# open = building or creating cart, payment failed and no partial payment already processed
# locked = processing payment, partial payment processed, admin lock? (no changes allowed)
# closed = successful payment(s) with no balance, complete (no changes allowed)
@@ -44,12 +44,16 @@ class Order_Base(BaseModel):
# other = other reasons (no changes allowed)
checkout_status: Optional[str] # canceled, waiting, success, failed, unknown
# none = no checkout attempted
# started = checkout session has started
# created = checkout session created
# canceled = checkout attempted but canceled for some reason
# waiting = the payment is processing or awaiting some type of authorization
# success = payment successful (their may still be a balance)
# failed = the payment failed for some reason
# unknown = unknown response...
stripe_checkout_session_id: Optional[str] # 67 characters long
notes: Optional[str]
created_on: Optional[datetime.datetime] = None
@@ -60,6 +64,7 @@ class Order_Base(BaseModel):
dollar_total_bill: Optional[str] # From SQL view
dollar_total_paid: Optional[str] # From SQL view
dollar_balance: Optional[str] # From SQL view
person_stripe_customer_id: Optional[str] # From SQL view
# Including other related objects
cfg: Optional[Order_Cfg_Base]