Рефактор
Deploy / deploy (push) Successful in 18m5s

This commit is contained in:
Раис Юсупалиев
2026-06-26 19:29:11 +03:00
parent c6c37640fd
commit 843175f12e
36 changed files with 795 additions and 461 deletions
+23
View File
@@ -1,7 +1,9 @@
"""Base interface for delivery providers."""
from abc import ABC, abstractmethod
from typing import Protocol, runtime_checkable
from app.schemas.payment import InitPaymentRequest
from app.schemas.request import DeliveryCalculationRequest
from app.schemas.response import DeliveryPrice
@@ -18,6 +20,27 @@ class DeliveryProvider(ABC):
raise NotImplementedError
@runtime_checkable
class PaymentPriceValidationProvider(Protocol):
name: str
async def get_payment_price(
self,
request: InitPaymentRequest,
) -> DeliveryPrice | None: ...
@runtime_checkable
class OrderRegistrationProvider(Protocol):
name: str
async def register_order(
self,
request: InitPaymentRequest,
order_uuid: str,
) -> object: ...
class ProviderClientError(RuntimeError):
"""Raised when a provider call fails for temporary or provider-side reasons."""