013 add price multiplier

This commit is contained in:
Раис Юсупалиев
2026-03-09 16:14:49 +03:00
parent da301d4bc4
commit 2bd884c8d5
20 changed files with 312 additions and 25 deletions
@@ -10,6 +10,7 @@ from app.adapters.delivery_providers.cdek.client import (
CDEKProvider,
CDEKRequestError,
)
from app import config as config_module
from app.config import AdapterConfig, Settings
from app.schemas.request import DeliveryEntity, DeliveryRequest
@@ -299,6 +300,22 @@ def test_provider_uses_adapter_yaml_config_for_timeout_and_cache_ttl(
config_file = tmp_path / "config.yaml"
config_file.write_text(
"""
controller:
api_prefix: "/api/v1"
request_id_header: "X-Request-ID"
service:
provider_timeout_seconds: 10.0
max_parallel_providers: 8
business_logic:
weight_round_scale: 2
provider_price_multiplier: 1.0
repository:
redis_dsn: "redis://localhost:6379/0"
price_cache_ttl_seconds: 900
adapter:
cdek_base_url: "https://api.cdek.test/v2"
cdek_client_id: "yaml-id"
@@ -310,7 +327,7 @@ adapter:
""".strip(),
encoding="utf-8",
)
monkeypatch.setenv("G2S_CONFIG_FILE", str(config_file))
monkeypatch.setattr(config_module, "_resolve_runtime_config_file", lambda: str(config_file))
settings = Settings()
http_client = RecordingHTTPClient()
provider = CDEKProvider.from_adapter_config(