feat: add user endpoints
This commit is contained in:
@@ -9,6 +9,7 @@ from src.application.abstractions.repositories import (
|
||||
IOrganizationWalletRepository,
|
||||
IPurchaseRequestRepository,
|
||||
IUserRepository,
|
||||
IWalletRepository,
|
||||
)
|
||||
|
||||
|
||||
@@ -37,3 +38,6 @@ class IUnitOfWork(Protocol):
|
||||
|
||||
@property
|
||||
def purchase_request_repository(self) -> IPurchaseRequestRepository: ...
|
||||
|
||||
@property
|
||||
def wallet_repository(self) -> IWalletRepository: ...
|
||||
@@ -4,3 +4,4 @@ from src.application.abstractions.repositories.i_admin_session_repository import
|
||||
from src.application.abstractions.repositories.i_legal_entity_repository import ILegalEntityRepository
|
||||
from src.application.abstractions.repositories.i_organization_wallet_repository import IOrganizationWalletRepository
|
||||
from src.application.abstractions.repositories.i_purchase_request_repository import IPurchaseRequestRepository
|
||||
from src.application.abstractions.repositories.i_wallets_repository import IWalletRepository
|
||||
|
||||
@@ -18,6 +18,14 @@ class IUserRepository(ABC):
|
||||
kyc_verified_at: datetime,
|
||||
) -> UserEntity:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def list_all(self, *, limit: int, offset: int, search: str | None = None) -> list[UserEntity]:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def get_by_id(self, user_id: str) -> UserEntity:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def get_user_by_email(self, email: str) -> UserEntity:
|
||||
@@ -35,6 +43,10 @@ class IUserRepository(ABC):
|
||||
async def count_individuals(self, *, query: str) -> int:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def count_all(self, *, search: str) -> int:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def set_password(self, user_id: str, password_hash: str) -> UserEntity:
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from src.application.domain.entities.user import WalletEntity
|
||||
|
||||
|
||||
class IWalletRepository(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def list_by_user(self, user_id: str) -> list[WalletEntity]:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def exists_for_user(self, user_id: str) -> bool:
|
||||
raise NotImplementedError
|
||||
Reference in New Issue
Block a user