fix: rename minmal total sum

This commit is contained in:
2026-06-17 21:03:26 +03:00
parent 20e0dc6db6
commit 8f60637e8d
2 changed files with 11 additions and 5 deletions

View File

@@ -7,8 +7,9 @@ from src.application.contracts import ILogger
from src.application.contracts import IItPayService
from src.application.domain.entities.order import OrderEntity
from src.application.domain.enums import OrderStatus
from src.application.domain.exceptions import ApplicationException, ForbiddenException, PriceChangedException
from src.application.domain.exceptions import ApplicationException, ForbiddenException, OrderTotalOutOfRangeException, PriceChangedException
from src.application.services import PaymentQuoteService
from src.application.services.payment_quote_service import MIN_TOTAL_RUB
from src.infrastructure.database.decorators import transactional
from src.presentation.schemas.order import CreateOrder
@@ -39,7 +40,12 @@ class CreateOrderCommand:
client_payment_id = str(ULID())
quote = await self._payment_quote_service.get_quote(payment_data.usdt_amount)
if payment_data.total_price < MIN_TOTAL_RUB:
raise OrderTotalOutOfRangeException(
message='Order total is below minimum allowed amount',
)
quote = await self._payment_quote_service.get_reference_quote(payment_data.usdt_amount)
actual_gas_fee = quote.gas_fee
actual_usdt_exchange_rate = quote.usdt_exchange_rate
actual_service_fee = quote.service_fee