Contract-compatible точки входа

В MyWoolbridge должен меняться base URL, а provider path остается таким же, как у реального API. Данные разделяются через X-Fake-Project.

CDEK

Base: http://localhost:3035/api/cdek или http://cdek-fake.mywoolbridge.local

POST /v2/oauth/token
GET /v2/deliverypoints
POST /v2/calculator/tariff
POST /v2/calculator/tarifflist
POST /v2/orders
GET /v2/orders/:uuid

Почта РФ

Base: http://localhost:3035/api/rupost или http://rupost-fake.mywoolbridge.local

POST /1.0/clean/address
POST /1.0/tariff
GET /1.0/user/shipping-points
GET /1.0/postoffice
PUT /1.0/user/backlog
GET /1.0/backlog/:id

Т-Банк

Base: http://localhost:3035/api/tbank или http://tbank-fake.mywoolbridge.local

POST /v2/Init
POST /v2/GetState
POST /v2/CheckOrder
POST /v2/Cancel
POST /v2/Confirm
POST /v2/FinishAuthorize

Route scenarios

Служебное управление: /api/_control/scenarios

route:GET:/v2/deliverypoints
route:POST:/v2/calculator/tariff
route:GET:/1.0/postoffice
route:POST:/1.0/tariff

Strict auth и credentials

Служебное управление fake credentials: /api/_control/credentials

CDEK: key=client_id, secret=client_secret
RUPOST: key=AccessToken, secret=Basic user token
TBANK: key=TerminalKey, secret=terminal password

Для проверки включить FAKE_STRICT_AUTH=1.

Lifecycle и события

Служебное управление статусами: /api/_control/lifecycle

Журнал запросов и callback-уведомлений: /api/_control/events и /ui/events

TBANK: NEW → CONFIRMED / CANCELED / REJECTED
CDEK: ACCEPTED → DELIVERED / INVALID
RUPOST: CREATED → IN_TRANSIT → DELIVERED

UI control panel

/ui/scenarios — редактор route-сценариев.

/ui/lifecycle — смена статусов и ручная отправка callbacks/webhooks.

/ui/fixtures — редактор provider fixtures по проекту.

/ui/credentials — fake credentials и helper для T-Bank Token.

/ui/captures — capture/replay управление.

/ui/events — журнал inbound/outbound событий.

Testing, Winston logs, capture/replay

Winston JSON logs: runtime/logs/fake-services.log

Scenario suites: tests/scenario-suites/*.json

Reports: runtime/test-reports/*.json

Capture/replay API: /api/_control/captures and /ui/captures

docker compose run --rm fake_services_test_runner
pnpm test:scenarios:all