food-market/src/food-market.infrastructure/Integrations/MoySklad
nurdotnet 05553bdc3d fix(moysklad): trailing slash on BaseUrl so HttpClient keeps /1.2/ in path
Logs showed every outbound MoySklad call was hitting
  https://api.moysklad.ru/api/remap/entity/organization
instead of the intended
  https://api.moysklad.ru/api/remap/1.2/entity/organization

Cause: per RFC 3986 §5.3, when HttpClient resolves a relative URI against
a base URI whose path does not end with '/', the last segment of the base
path is discarded. So BaseAddress "…/api/remap/1.2" + relative "entity/…"
produced "…/api/remap/entity/…". MoySklad returned 503 and we translated
it into a useless "401 сессия истекла" for the user.

Fixes:
- Append trailing slash to BaseUrl.
- Surface the real upstream status + body: MoySkladApiResult<T> wrapper,
  and the controller now maps 401/403 → "invalid token", 502/503 →
  "MoySklad unavailable", anything else → "MoySklad returned {code}: {body}".
  No more lying-as-401.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 23:26:32 +05:00
..
MoySkladClient.cs fix(moysklad): trailing slash on BaseUrl so HttpClient keeps /1.2/ in path 2026-04-21 23:26:32 +05:00
MoySkladDtos.cs phase1e: MoySklad import integration (admin-only, per-request token, no persistence) 2026-04-21 21:07:58 +05:00
MoySkladImportService.cs fix(moysklad): trailing slash on BaseUrl so HttpClient keeps /1.2/ in path 2026-04-21 23:26:32 +05:00