Staff Management

Schedule

Path/staffing-schedule
Statustodo
Drill-down pages—
Pop-ups(+8 inline)
Tabs—
API routes/api/data/dental-day-offices:x
/api/data/van-routes/check
/api/data/vans:x
/api/staff
/api/staff/time-off/all
/api/staffing
/api/staffing/staffed-days

Business rules

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

Database tables & columns

TableColumns used
calendarscalendar_name, city, dentrix_office_id, dentrix_office_name, hubspot_id, short_code, state, status, street_address, zip_code
companieshubspot_id, name
dd_staff_assignmentscalendar_id, created_at, id, pending, position, published_at, schedule_date, staff_id, updated_at
dentrix_officesactive, app, dentrix_id, display_name, name, state, timezone
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
equipment_repairs(columns not named in the SQL)
geocode_cacheaddress, found, latitude, longitude, provider
operatoriesactive, app, dentrix_id, name, office_id, short_name, use_for_booking
route_leg_cachedrive_meters, drive_seconds, drive_seconds_static, found, from_lat, from_lng, polyline, provider, to_lat, to_lng
schedulesarrival_datetime, calendar_id, date, end_hour, setup_datetime, start_hour, van_name
staffcell_phone, cell_phone_encrypted, first_name, id, last_name, mobile_phone, mobile_phone_encrypted, onboarding_completed_at, personal_email, personal_email_encrypted, position, work_email
staff_invitescreated_at, created_by, expires_at, revoked_at, staff_id, token_hash, used_at, user_id
staff_time_offend_date, id, reason, staff_id, start_date
vansactive, color, created_at, id, name, notes, sort_order

File structure

Its own files

  • apps/
    • web/
      • src/
        • pages/
          • StaffingSchedule.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
          • vans/
            • VanDriveCheck.tsx
          • MaskedDateTimeInput.tsx
          • TablePagination.tsx
        • hooks/
          • useApi.ts
        • services/
          • api.ts
    • worker/
      • src/
        • db/
          • index.ts
        • routes/
          • data.ts
          • staff.ts
          • staffing.ts
        • services/
          • email-templates.ts
          • phi-read.ts
          • staff-onboarding.ts
          • user-access.ts
          • van-legs.ts
        • utils/
          • crypto.ts
          • email.ts
          • office.ts
          • phi-access.ts
          • phi-crypto.ts