Description:
scripts/seed.ts's header comment states "The script is safe to run multiple times (uses ON CONFLICT DO NOTHING)", and upsertImporter does use ON CONFLICT (user_id) DO UPDATE. But bond_id is computed fresh via Math.floor(Math.random() * ...) on every invocation and is part of the UPDATE-less INSERT columns, meaning any downstream test or fixture that hardcodes a demo bond_id will silently diverge across seed runs, contradicting the "idempotent" claim for anything beyond legal_name.
Acceptance Criteria:
Relevant Files:
scripts/seed.ts — upsertImporter computes bondId via Math.random() on every call despite the header's idempotency claim
Description:
scripts/seed.ts's header comment states "The script is safe to run multiple times (uses ON CONFLICT DO NOTHING)", and upsertImporter does use ON CONFLICT (user_id) DO UPDATE. But bond_id is computed fresh via Math.floor(Math.random() * ...) on every invocation and is part of the UPDATE-less INSERT columns, meaning any downstream test or fixture that hardcodes a demo bond_id will silently diverge across seed runs, contradicting the "idempotent" claim for anything beyond legal_name.
Acceptance Criteria:
Relevant Files:
scripts/seed.ts— upsertImporter computes bondId via Math.random() on every call despite the header's idempotency claim