Убрали ПВЗ для КСЕ, и поправили формирование тарифа КСЕ
Deploy / deploy (push) Successful in 1m8s

This commit is contained in:
Раис Юсупалиев
2026-05-31 21:34:00 +03:00
parent 6c0f97adf6
commit c2757d24fc
8 changed files with 254 additions and 67 deletions
@@ -12,6 +12,16 @@ from app.cities import cities_map
# Provider name surfaced in unified DeliveryPrice/SystemDataTariff.
CSE_PROVIDER_NAME = "cse"
# Keywords in a DeliveryType name/label that imply a pickup point (PVZ) is
# required at registration (SenderPVZ/RecipientPVZ). PVZ is not yet supported,
# so such schemes are excluded from price calculation.
_PVZ_SCHEME_KEYWORDS = ("склад", "самовывоз", "почтов", "пвз")
def delivery_type_requires_pvz(name: str, label: str) -> bool:
haystack = f"{name} {label}".lower()
return any(keyword in haystack for keyword in _PVZ_SCHEME_KEYWORDS)
# CSE returns currency short names (e.g. "RUR"); normalize to ISO-4217.
_CURRENCY_NAME_TO_CODE = {
"RUR": "RUB",