Files
parking_solution/package.json
T
julian d92b8d1e6a feat(db): gated training/demo database reset CLI
A site is sometimes run live to train operators/admins; afterwards the demo
data must go without an obvious self-serve button (the operator must not be
able to wipe history). Adds packages/db/scripts/reset-db.mjs, exposed as
`pnpm db:reset` (dev) and run via `docker exec ... node
node_modules/@parking/db/scripts/reset-db.mjs` on the booth (no pnpm there).

Category flags (combinable): --financial (ledger + telemetry + snapshots +
subscription instances + blocklist; keeps users/devices/config/tariffs/plans),
--config, --users, --all. Shifts/cash/payments live as event types inside the
hash-chained ledger_events, so --financial truncates the whole signed ledger
back to empty (re-seed starts a new chain under the SAME EVENT_SIGNING_KEY —
keys untouched).

Two safety gates: RESET_ALLOWED=1 env (a real booth never sets it) + typed
DB-filename confirmation (--yes skips for CI). Single transaction + VACUUM.

Verified on throwaway dev-DB copies: both gates refuse correctly; each flag
wipes/keeps the right tables; the real dev DB is never touched.

Claude-Session: https://claude.ai/code/session_01Xcm6ikLgGoCxxHrxtjkk5V
2026-06-30 17:58:34 +02:00

31 lines
661 B
JSON

{
"name": "parking-system",
"version": "0.0.0",
"private": true,
"packageManager": "pnpm@10.24.0",
"engines": {
"node": ">=22.12"
},
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev",
"lint": "turbo run lint",
"typecheck": "turbo run typecheck",
"test": "turbo run test",
"seed:admin": "pnpm --filter @parking/server seed-admin",
"db:reset": "pnpm --filter @parking/db db:reset"
},
"devDependencies": {
"turbo": "2.9.18",
"typescript": "6.0.3",
"@types/node": "25.9.3"
},
"pnpm": {
"onlyBuiltDependencies": [
"bcrypt",
"better-sqlite3",
"esbuild"
]
}
}