Adds user settings for the Castle extension
Adds functionality to configure the Castle extension, including a wallet ID. This allows administrators to customize the extension's behavior by specifying a dedicated wallet for castle operations.
This commit is contained in:
parent
ceabf96f79
commit
29983cedb7
7 changed files with 199 additions and 2 deletions
17
models.py
17
models.py
|
|
@ -102,3 +102,20 @@ class RevenueEntry(BaseModel):
|
|||
payment_method_account: str # e.g., "Cash", "Bank", "Lightning"
|
||||
reference: Optional[str] = None
|
||||
currency: Optional[str] = None # If None, amount is in satoshis. Otherwise, fiat currency code
|
||||
|
||||
|
||||
class CastleSettings(BaseModel):
|
||||
"""Settings for the Castle extension"""
|
||||
|
||||
castle_wallet_id: Optional[str] = None # The wallet ID that represents the Castle
|
||||
updated_at: datetime = Field(default_factory=lambda: datetime.now())
|
||||
|
||||
@classmethod
|
||||
def is_admin_only(cls) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
class UserCastleSettings(CastleSettings):
|
||||
"""User-specific settings (stored with user_id)"""
|
||||
|
||||
id: str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue