Vans

Van Drive Time

Path/van-drive-time
Statustodo
Drill-down pages—
Pop-ups(+1 inline)
Tabs—
API routes/api/data/maps-key
/api/data/offices
/api/data/van-routes
/api/data/vans:x
/api/js

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, pending, position, schedule_date, staff_id
dentrix_officesapp, dentrix_id, name
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
vansactive, color, created_at, home_address, id, name, notes, sort_order

File structure

Its own files

  • apps/
    • web/
      • src/
        • pages/
          • VanDriveTime.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
            • sortable-grid.tsx
        • hooks/
          • useApi.ts
        • lib/
          • van-colors.ts
        • services/
          • api.ts
    • worker/
      • src/
        • routes/
          • data.ts
        • services/
          • van-legs.ts
        • utils/
          • office.ts