Adds fiat currency balances to user balances
Extends user balance information to include fiat currency balances, calculated based on entry line metadata and account types. This allows for a more comprehensive view of user balances, including both satoshi and fiat currency holdings. Updates the castle index template and API to display fiat balances.
This commit is contained in:
parent
be386f60ef
commit
b0705fc24a
5 changed files with 116 additions and 4 deletions
|
|
@ -68,6 +68,7 @@ class UserBalance(BaseModel):
|
|||
user_id: str
|
||||
balance: int # positive = castle owes user, negative = user owes castle
|
||||
accounts: list[Account] = []
|
||||
fiat_balances: dict[str, float] = {} # e.g. {"EUR": 250.0, "USD": 100.0}
|
||||
|
||||
|
||||
class ExpenseEntry(BaseModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue