Staff Management
Staff
| Path | /staff |
|---|---|
| Status | todo |
| Drill-down pages | /staff/:id/edit /staff/new |
| Pop-ups | StaffInviteDialog (+5 inline) |
| Tabs | โ |
| API routes | /api/staff |
Business rules
Written when this page is worked on (docs/BUSINESS-RULES.md).
Database tables & columns
| Table | Columns used |
|---|---|
dh_user_access | access_key, position, user_id |
dh_users | access, created_at, email, id, last_login_at, name, password_hash, role, staff_id, status, updated_at |
email_sends | app, error, lang, provider, recipients, ref, sent_by, status, subject, subject_encrypted, template_key, to_email, to_email_encrypted, to_email_hash |
email_templates | active, bcc_emails, body_en, body_es, from_email, key, reply_to, subject_en, subject_es, to_emails |
staff | first_name, id, last_name, onboarding_completed_at, work_email |
staff_invites | created_at, created_by, expires_at, revoked_at, staff_id, token_hash, used_at, user_id |
File structure
Its own files
- apps/
- web/
- src/
- pages/
- Staff.tsx
- pages/
- src/
- web/
Shared code it uses (followed through its imports and the helpers its API calls; sign-in/access plumbing and UI primitives left out)
- apps/
- web/
- src/
- components/
- reports/
- DentrixSourceNote.tsx
- HowItWorksNote.tsx
- ReportHeader.tsx
- TableLoading.tsx
- staff/
- StaffInviteDialog.tsx
- StaffLoginBadge.tsx
- users/
- access.tsx
- TablePagination.tsx
- reports/
- contexts/
- AuthContext.tsx
- hooks/
- useDebounce.ts
- services/
- api.ts
- components/
- src/
- worker/
- src/
- db/
- index.ts
- routes/
- staff.ts
- services/
- email-templates.ts
- phi-read.ts
- staff-onboarding.ts
- user-access.ts
- utils/
- crypto.ts
- email.ts
- phi-access.ts
- phi-crypto.ts
- db/
- src/
- web/