get_wallet_payments with more fine-grained, explicit filters.

This commit is contained in:
fiatjaf
2020-08-31 22:16:19 -03:00
parent d09e624eb6
commit fadddc995a
4 changed files with 34 additions and 14 deletions
+4 -2
View File
@@ -34,10 +34,12 @@ class Wallet(NamedTuple):
return get_wallet_payment(self.id, checking_id)
def get_payments(self, *, include_all_pending: bool = False) -> List["Payment"]:
def get_payments(
self, *, complete: bool = True, pending: bool = False, outgoing: bool = True, incoming: bool = True
) -> List["Payment"]:
from .crud import get_wallet_payments
return get_wallet_payments(self.id, include_all_pending=include_all_pending)
return get_wallet_payments(self.id, complete=complete, pending=pending, outgoing=outgoing, incoming=incoming)
def delete_expired_payments(self, seconds: int = 86400) -> None:
from .crud import delete_wallet_payments_expired