Add createdByUsername field and boot-time admin seed/backfill
Adds AdminTransaction.createdByUsername (default null) so future
permission-scoped views can attribute data to a user, plus a new
app/libs/adminBootstrap.js that seeds the first admin account from
ADMIN_USER/ADMIN_PASSWORD on boot and backfills any pre-existing
transaction lacking createdByUsername to that admin. Wired into
server.js's mongoose 'open' handler. Idempotent across repeated boots.
Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com>
Showing
app/libs/adminBootstrap.js
0 → 100644
Please
register
or
sign in
to comment