Добавлен провайдер доставки CSE: SOAP-адаптер (Calc + SaveDocuments), маршрутизация init-payment по провайдеру, обобщение tariff_code до строки, география CSE в cities_map
Deploy / deploy (push) Failing after 52s

This commit is contained in:
Раис Юсупалиев
2026-05-31 20:13:52 +03:00
parent 6a2bf05ba5
commit 6c0f97adf6
41 changed files with 16113 additions and 4806 deletions
@@ -22,7 +22,7 @@ def map_cdek_response(payload: dict[str, Any]) -> list[DeliveryPrice]:
def map_cdek_response_for_tariff_code(
payload: dict[str, Any],
*,
tariff_code: int,
tariff_code: str,
) -> DeliveryPrice | None:
tariff_codes = payload.get("tariff_codes")
if not isinstance(tariff_codes, list):
@@ -84,19 +84,17 @@ def _get_tariffs(payload: dict[str, Any]) -> list[dict[str, Any]]:
return tariffs
def _tariff_code_matches(value: object, expected_tariff_code: int) -> bool:
if isinstance(value, bool) or value is None:
return False
try:
return int(value) == expected_tariff_code
except (TypeError, ValueError):
def _tariff_code_matches(value: object, expected_tariff_code: str) -> bool:
extracted = _extract_tariff_code(value)
if extracted is None:
return False
return extracted == expected_tariff_code
def _extract_tariff_code(value: object) -> int | None:
def _extract_tariff_code(value: object) -> str | None:
if isinstance(value, bool) or value is None:
return None
try:
return int(value)
return str(int(value))
except (TypeError, ValueError):
return None