Files
sase.tr/apps
Semih Yesilyurt 1ecc00dfc3
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
feat(internal-admin): VIN cache-clear + delete endpoints
For the Süper Panel VIN management table — founder needs to be able to
flush a stale or wrong decode result and (rarely) blow away the shared
vehicles row so the next decode runs the full chain again.

POST /internal/admin/vehicles/:vin/cache-clear  { reason, founderId }
  Deletes vin:resolve:<vin>, vin:resolve:neg:<vin>, vin🔒<vin>.
  Returns { clearedKeys: [...], totalKeysChecked }. Safe no-op when
  nothing exists. Logs founder + reason.

DELETE /internal/admin/vehicles/:vin                { reason, founderId }
  Looks up the shared vehicles row by VIN; 404 if missing. Hard-deletes
  it — user_vehicles rows cascade via the existing FK on delete cascade.
  query_logs is intentionally NOT touched: it's audit history.
  Also clears the three Redis keys so the next decode starts fresh.
  Returns { vehicleId, brandName, model, source, cascadedUserLinks }.

Wired into InternalAdminModule. Reuses InternalTokenGuard + the public
decorator pattern the rest of the module uses.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 07:54:38 +03:00
..