Skip to content

Commit

Permalink
fix: Adjust model for Balance.reference_date to be None if not passed…
Browse files Browse the repository at this point in the history
… (field is optional) (#100)

Fix model for Balance.reference_date to be None if not passed (optional). The  from gocardless seems to be missing the "referenceDate" in the two elements in "balances", as this item seems to be optional for some transactions.

This can be confirmed on their official API: https://developer.gocardless.com/bank-account-data/balance

---------

Co-authored-by: Brunno Vanelli <[email protected]>
  • Loading branch information
Aeosium and bvanelli authored Jan 14, 2025
1 parent 9cf1ab5 commit 7f065dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actual/api/bank_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Balance(BaseModel):

balance_amount: BankSyncAmount = Field(..., alias="balanceAmount")
balance_type: BalanceType = Field(..., alias="balanceType")
reference_date: Optional[str] = Field(..., alias="referenceDate", description="The date of the balance")
reference_date: Optional[str] = Field(None, alias="referenceDate", description="The date of the balance")


class TransactionItem(BaseModel):
Expand Down

0 comments on commit 7f065dd

Please sign in to comment.