feat: add user endpoints
This commit is contained in:
@@ -7,15 +7,19 @@ from src.application.domain.entities.organization import (
|
||||
PartySearchEntity,
|
||||
PurchaseRequestEntity,
|
||||
)
|
||||
from src.application.domain.entities.user import (
|
||||
UserEntity,
|
||||
)
|
||||
from src.presentation.schemas.user import (
|
||||
UserResponse,
|
||||
)
|
||||
from src.presentation.schemas.organization import (
|
||||
DocumentResponse,
|
||||
OrganizationResponse,
|
||||
)
|
||||
from src.presentation.schemas.entity import (
|
||||
CreateWalletsResponse,
|
||||
DocumentResponse,
|
||||
MnemonicResponse,
|
||||
OrganizationResponse,
|
||||
PartySearchResponse,
|
||||
PurchaseRequestResponse,
|
||||
SecretKeyResponse,
|
||||
@@ -133,3 +137,23 @@ def purchase_request_to_response(entity: PurchaseRequestEntity) -> PurchaseReque
|
||||
updated_at=entity.updated_at.isoformat() if entity.updated_at else None,
|
||||
completed_at=entity.completed_at.isoformat() if entity.completed_at else None,
|
||||
)
|
||||
|
||||
def user_to_response(entity: UserEntity) -> UserResponse:
|
||||
return UserResponse(
|
||||
id=entity.id,
|
||||
email=entity.email,
|
||||
first_name=entity.first_name,
|
||||
middle_name=entity.middle_name,
|
||||
last_name=entity.last_name,
|
||||
birth_date=entity.birth_date,
|
||||
phone=entity.phone,
|
||||
passport_data=entity.passport_data,
|
||||
inn=entity.inn,
|
||||
avatar_link=entity.avatar_link,
|
||||
account_type=entity.account_type,
|
||||
kyc_verified=entity.kyc_verified,
|
||||
is_deleted=entity.is_deleted,
|
||||
created_at=entity.created_at.isoformat() if entity.created_at else None,
|
||||
updated_at=entity.updated_at.isoformat() if entity.updated_at else None,
|
||||
kyc_verified_at=entity.kyc_verified_at.isoformat() if entity.kyc_verified_at else None,
|
||||
)
|
||||
Reference in New Issue
Block a user