lnbits-legend/lnbits/extensions/tpos/models.py
Tiago Vasconcelos ff5b1189b5
Fix/tpos tips #697 (#713)
* small fastapi convertion

* make tip add up to invoice

* make tip add to invoice

* display existing tpos

* clean console logs

* suggestion from @leesalminen

* blacked
2022-07-25 11:19:03 +02:00

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))