Vans
Van Management
| Path | /vans |
|---|---|
| Status | todo |
| Drill-down pages | โ |
| Pop-ups | (+4 inline) |
| Tabs | 2 |
| 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
| Table | Columns used |
|---|---|
calendars | calendar_name, city, dentrix_office_id, hubspot_id, short_code, state, status, street_address, zip_code |
companies | hubspot_id, name |
dd_staff_assignments | calendar_id, position, schedule_date, staff_id |
dentrix_offices | app, dentrix_id, name |
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 |
equipment_repairs | (columns not named in the SQL) |
geocode_cache | address, found, latitude, longitude, provider |
route_leg_cache | drive_meters, drive_seconds, drive_seconds_static, found, from_lat, from_lng, polyline, provider, to_lat, to_lng |
schedules | calendar_id, date, end_hour, start_hour, van_name |
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 |
staff_time_off | end_date, staff_id, start_date |
van_driver_moves | co_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 |
vans | active, color, created_at, id, name, notes, sort_order |
File structure
Its own files
- apps/
- web/
- src/
- pages/
- VanManagement.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/
- HowItWorksNote.tsx
- TableLoading.tsx
- vans/
- VanDrivers.tsx
- reports/
- hooks/
- useApi.ts
- lib/
- van-colors.ts
- services/
- api.ts
- components/
- src/
- 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
- db/
- src/
- web/