lnbits-legend/lnbits/extensions/splitpayments/models.py
Tiago Vasconcelos c8ab2859fd
Splitpayments: floating point percentage for split value (#690)
* allow for float in model

* recreate DB with float type

* remove rounding in UI

* black

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-07-17 20:00:06 +02:00

21 lines
406 B
Python

from typing import List, Optional
from fastapi.param_functions import Query
from pydantic import BaseModel
class Target(BaseModel):
wallet: str
source: str
percent: float
alias: Optional[str]
class TargetPutList(BaseModel):
wallet: str = Query(...)
alias: str = Query("")
percent: float = Query(..., ge=0.01)
class TargetPut(BaseModel):
__root__: List[TargetPutList]