feat: add withdraw
This commit is contained in:
36
src/application/contracts/i_mozen_sbp_service.py
Normal file
36
src/application/contracts/i_mozen_sbp_service.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from abc import ABC,abstractmethod
|
||||
from dataclasses import dataclass
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class SbpBank:
|
||||
id: str
|
||||
name: str
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class SbpPayoutResult:
|
||||
status: str
|
||||
mozen_order_id: str | None = None
|
||||
error: str | None = None
|
||||
|
||||
|
||||
class IMozenSbpService(ABC):
|
||||
@abstractmethod
|
||||
async def get_banks(self,trace_id: str) -> list[SbpBank]:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@abstractmethod
|
||||
async def make_withdrawal(
|
||||
self,
|
||||
*,
|
||||
user_id: str,
|
||||
withdraw_id: str,
|
||||
phone: str,
|
||||
bank_id: str,
|
||||
amount: Decimal,
|
||||
trace_id: str,
|
||||
) -> SbpPayoutResult:
|
||||
raise NotImplementedError
|
||||
Reference in New Issue
Block a user