Skip to content

feat: add example data loader and drop password minimum - #66

Closed
systemicdream wants to merge 1 commit into
feature/ticket_status_notificationfrom
feature/example-data-and-password-minimum
Closed

systemicdream wants to merge 1 commit into
feature/ticket_status_notificationfrom
feature/example-data-and-password-minimum

Conversation

@systemicdream

@systemicdream systemicdream commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Makes local testing easier: one command loads a ready-to-use example database, and accounts no longer need 12+ character passwords.

Related issue

Closes #64
Closes #65

What changed

  • Example data ([Feature]: Example Database #64): new pnpm db:example command (apps/api/src/database/example-data.ts, load-example-data.ts) loads:
    • users alice, bob (USER) and terry, tina (TECHNICIAN), all with password password
    • six tickets covering every status, including assigned/unassigned, anonymous, and no-creator tickets
    • replies, plus read and unread status notifications for ticket owners
    • Refuses to run on a database with existing users/tickets unless --reset is passed (which deletes all users, sessions, tickets, replies, and notifications first), and refuses when NODE_ENV=production.
  • Password minimum (Reduce minimum password requirements #65): passwords may be 1–128 characters (was 12–128) in the API schemas, the user:create CLI, and the web login/registration forms. Empty passwords are still rejected; the 128 max is kept to bound Argon2 hashing cost.
  • README and AGENTS.md document the new command.

Validation

  • Added or updated tests where behavior changed (short/empty password route test; example-data integration test)
  • Ran relevant local checks: format, lint, typecheck, migrate, API tests (111 passed), web tests
  • Verified the primary user flow: ran db:example locally — refuses on non-empty DB, loads with --reset

Not run: coverage, build, scripts/smoke.sh. One web test (TicketDetail "updates the timeline after a technician advances the ticket") failed once in a full run but passed on reruns with and without this change, so it appears flaky.

Screenshots or recordings

Not applicable.

Review notes

  • Stacked PR (draft): merges into feature/ticket_status_notification and ships as part of the larger notifications PR. The example data uses that branch's notifications table (migration 0005). Because this targets a non-default branch, Closes #64/#65 will not auto-close; carry them into the notifications PR.
  • The shared example password password is committed intentionally for local-only test data. This is an exception to the AGENTS.md "no passwords in tracked files" rule, which is aimed at provisioned credentials.

🤖 Generated with Claude Code

- Add `pnpm db:example` to load example users, tickets in every status,
  replies, and notifications for local testing. It refuses non-empty
  databases unless `--reset` is passed, and refuses NODE_ENV=production.
- Allow passwords of 1-128 characters in the API, user:create CLI, and
  web forms (previously 12-128).

Closes #64
Closes #65
@systemicdream
systemicdream marked this pull request as draft October 21, 2026 20:35
@systemicdream

Copy link
Copy Markdown
Contributor Author

Folding these changes into the ticket status notifications PR instead.

@systemicdream
systemicdream deleted the feature/example-data-and-password-minimum branch October 21, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant