feat(internal-admin): VIN cache-clear + delete #34
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two new endpoints for the Süper Panel VIN management table.
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>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>