feat: add view order history and filter by date

This commit is contained in:
2026-06-17 13:01:26 +03:00
parent 4bdf295007
commit 909f4d9298
20 changed files with 611 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
from __future__ import annotations
from urllib import response
from src.application.domain.entities.organization import (
LegalEntityEntity,
@@ -10,6 +11,9 @@ from src.application.domain.entities.organization import (
from src.application.domain.entities.user import (
UserEntity,
)
from src.application.domain.entities.order import (
OrderEntity,
)
from src.presentation.schemas.user import (
UserResponse,
)
@@ -25,6 +29,9 @@ from src.presentation.schemas.entity import (
SecretKeyResponse,
WalletResponse,
)
from src.presentation.schemas.order import (
OrderResponse,
)
def organization_to_response(entity: LegalEntityEntity) -> OrganizationResponse:
@@ -156,4 +163,17 @@ def user_to_response(entity: UserEntity) -> UserResponse:
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,
)
)
def order_to_response(entity: OrderEntity) -> OrderResponse:
return OrderResponse(
order_id=entity.id,
order_status=entity.status,
usdt_amount=str(entity.usdt_amount),
usdt_exchange_rate=str(entity.usdt_exchange_rate) if entity.usdt_exchange_rate is not None else None,
gas_fee=str(entity.gas_fee) if entity.gas_fee is not None else None,
total_price=str(entity.total_price) if entity.total_price is not None else None,
service_fee=str(entity.service_fee) if entity.service_fee is not None else None,
updated_at=entity.updated_at.isoformat() if entity.updated_at else None,
)