mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-25 15:10:41 +01:00
* small fastapi convertion * make tip add up to invoice * make tip add to invoice * display existing tpos * clean console logs * suggestion from @leesalminen * blacked
25 lines
485 B
Python
25 lines
485 B
Python
from sqlite3 import Row
|
|
from typing import Optional
|
|
|
|
from fastapi import Query
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class CreateTposData(BaseModel):
|
|
name: str
|
|
currency: str
|
|
tip_options: str = Query(None)
|
|
tip_wallet: str = Query(None)
|
|
|
|
|
|
class TPoS(BaseModel):
|
|
id: str
|
|
wallet: str
|
|
name: str
|
|
currency: str
|
|
tip_options: Optional[str]
|
|
tip_wallet: Optional[str]
|
|
|
|
@classmethod
|
|
def from_row(cls, row: Row) -> "TPoS":
|
|
return cls(**dict(row))
|