Enables manual settlement with fiat currencies
Adds support for settling receivables with fiat currencies like EUR and USD, in addition to sats. Updates the settlement dialog to handle fiat amounts and exchange rates, defaulting to cash payment when a fiat balance exists. Modifies the API to accept currency and amount_sats parameters and adjust the journal entry accordingly, converting the fiat amount to minor units (e.g., cents) for accounting purposes.
This commit is contained in:
parent
49f21da55a
commit
70013d1c29
4 changed files with 120 additions and 20 deletions
|
|
@ -186,10 +186,12 @@ class SettleReceivable(BaseModel):
|
|||
"""Manually settle a receivable (user pays castle in person)"""
|
||||
|
||||
user_id: str
|
||||
amount: int # Amount in satoshis
|
||||
amount: Decimal # Amount in the specified currency (or satoshis if currency is None)
|
||||
payment_method: str # "cash", "bank_transfer", "lightning", "other"
|
||||
description: str # Description of the payment
|
||||
reference: Optional[str] = None # Optional reference (receipt number, transaction ID, etc.)
|
||||
currency: Optional[str] = None # If None, amount is in satoshis. Otherwise, fiat currency code (EUR, USD, etc.)
|
||||
amount_sats: Optional[int] = None # Equivalent amount in sats (for reference/conversion tracking)
|
||||
|
||||
|
||||
class AssertionStatus(str, Enum):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue