Vans

Van Management

Path/vans
Statustodo
Drill-down pagesโ€”
Pop-ups(+4 inline)
Tabs2
API routes/api/data/vans:x
/api/staff
/api/van-drivers

Business rules

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

Database tables & columns

TableColumns used
calendarscalendar_name, city, dentrix_office_id, hubspot_id, short_code, state, status, street_address, zip_code
companieshubspot_id, name
dd_staff_assignmentscalendar_id, position, schedule_date, staff_id
dentrix_officesapp, dentrix_id, name
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
route_leg_cachedrive_meters, drive_seconds, drive_seconds_static, found, from_lat, from_lng, polyline, provider, to_lat, to_lng
schedulescalendar_id, date, end_hour, start_hour, van_name
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
staff_time_offend_date, staff_id, start_date
van_driver_movesco_driver_staff_id, driver_staff_id, from_calendar_id, from_date, notes, status, to_calendar_id, to_date, travel_cost, travel_details, travel_method, updated_by, van
vansactive, color, created_at, id, name, notes, sort_order

File structure

Its own files

  • apps/
    • web/
      • src/
        • pages/
          • VanManagement.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/
            • HowItWorksNote.tsx
            • TableLoading.tsx
          • vans/
            • VanDrivers.tsx
        • hooks/
          • useApi.ts
        • lib/
          • van-colors.ts
        • services/
          • api.ts
    • worker/
      • src/
        • db/
          • index.ts
        • routes/
          • data.ts
          • staff.ts
          • van-drivers.ts
        • services/
          • email-templates.ts
          • phi-read.ts
          • staff-onboarding.ts
          • user-access.ts
          • van-legs.ts
        • utils/
          • crypto.ts
          • email.ts
          • phi-access.ts
          • phi-crypto.ts