Adds settle receivable functionality

Implements a "Settle Receivable" feature for super users to record manual payments from users who owe money.

Introduces a dialog for inputting payment details (amount, method, description, reference), triggers an API call to record the transaction, and updates user balances and transaction history.

This is for non-lightning payments like cash, bank transfers, or checks.
This commit is contained in:
padreug 2025-10-23 02:57:21 +02:00
parent d06f46a63c
commit 1412359172
4 changed files with 278 additions and 1 deletions

View file

@ -181,6 +181,16 @@ class RecordPayment(BaseModel):
payment_hash: str
class SettleReceivable(BaseModel):
"""Manually settle a receivable (user pays castle in person)"""
user_id: str
amount: int # Amount in satoshis
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.)
class AssertionStatus(str, Enum):
"""Status of a balance assertion"""
PENDING = "pending" # Not yet checked