Staff Management

Staff

Path/staff
Statustodo
Drill-down pages/staff/:id/edit /staff/new
Pop-upsStaffInviteDialog (+5 inline)
Tabsโ€”
API routes/api/staff

Business rules

Written when this page is worked on (docs/BUSINESS-RULES.md).

Database tables & columns

TableColumns used
dh_user_accessaccess_key, position, user_id
dh_usersaccess, created_at, email, id, last_login_at, name, password_hash, role, staff_id, status, updated_at
email_sendsapp, error, lang, provider, recipients, ref, sent_by, status, subject, subject_encrypted, template_key, to_email, to_email_encrypted, to_email_hash
email_templatesactive, bcc_emails, body_en, body_es, from_email, key, reply_to, subject_en, subject_es, to_emails
stafffirst_name, id, last_name, onboarding_completed_at, work_email
staff_invitescreated_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

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
        • contexts/
          • AuthContext.tsx
        • hooks/
          • useDebounce.ts
        • services/
          • api.ts
    • 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