feat(internal-admin): VIN cache-clear + delete #34

Merged
root merged 1 commits from dev into main 2026-05-19 07:54:42 +03:00
Owner

Two new endpoints for the Süper Panel VIN management table.

Two new endpoints for the Süper Panel VIN management table.
root added 1 commit 2026-05-19 07:54:39 +03:00
feat(internal-admin): VIN cache-clear + delete endpoints
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
1ecc00dfc3
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>
root added 1 commit 2026-05-19 07:54:40 +03:00
feat(internal-admin): VIN cache-clear + delete endpoints
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
1ecc00dfc3
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>
root merged commit 9af72bf33a into main 2026-05-19 07:54:42 +03:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: root/sase.tr#34