8 Commits

Author SHA1 Message Date
jason
95d56b5018 feat: custom violation types — persist, manage, and use in violation form
Adds a full CRUD system for user-defined violation types stored in a new
violation_types table. Custom types appear in the violation dropdown alongside
hardcoded types, grouped by category, with ✦ marker and a green Custom badge.

- db/database.js: auto-migration adds violation_types table on startup
- server.js: GET/POST/PUT/DELETE /api/violation-types; type_key auto-generated
  as custom_<slug>; DELETE blocked if any violations reference the type
- ViolationTypeModal.jsx: create/edit modal with name, category (datalist
  autocomplete from existing categories), handbook chapter reference,
  description/reference text, fixed vs sliding point toggle, context field
  checkboxes; delete with usage guard
- ViolationForm.jsx: fetches custom types on mount; merges into dropdown via
  mergedGroups memo; resolveViolation() checks hardcoded then custom; '+ Add
  Type' button above dropdown; 'Edit Type' button appears when a custom type is
  selected; newly created type auto-selects; all audit calls flow through
  existing audit() helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 16:23:21 -05:00
8944cc80e0 feat: add auto-migration for acknowledged_by/acknowledged_date columns 2026-03-07 21:31:05 -06:00
be2d1fa68e feat(db): add notes column to employees table 2026-03-07 09:41:50 -06:00
9b6f2353be feat(db): add violation_amendments and audit_log tables 2026-03-07 09:22:01 -06:00
accb24a286 Upload files to "db" 2026-03-06 14:59:55 -06:00
821192e879 Update db/database.js 2026-03-06 13:56:36 -06:00
333cad41d7 Phase 4 2026-03-06 12:53:40 -06:00
45d785964d Initial commit of Docker project 2026-03-06 11:33:32 -06:00