Commit graph

26 commits

Author SHA1 Message Date
Adam Moussa
199715d5b6 Add Verify & Close button and verified banner to dispatch detail
- Verify & Close button at bottom of dispatch modal
- Disabled with tooltip showing missing items (checklist, signoffs)
- Green verified banner after verification with verifier name + timestamp
- Verified status badge (dark green)
- Added Verified to DISPATCH_STATUSES constant
- verifyDispatch API function
2026-04-17 16:03:34 -04:00
Adam Moussa
5c24b9249d Add sign-off UI with signature capture component
- SignatureCapture component: canvas drawing pad + typed mode with cursive preview
- Two sign-off slots in dispatch detail modal: Customer and Vendor
- Collect Signature button opens capture modal, prompts for name
- Signed slots show signature thumbnail, name, and timestamp
- Green "All Signed" badge when both complete
- addDispatchSignoff API function
2026-04-17 15:51:20 -04:00
Adam Moussa
31479029e3 Add time tracking to dispatch workflow
- timeSince utility: relative time display (2h ago, 3d ago)
- timeBetween utility: duration between two timestamps
- waitTimeColor utility: green (<4h), yellow (4-24h), red (>24h)
- Dispatch detail modal shows accepted time with duration
- Awaiting acceptance shows elapsed time with color coding
- Dispatches table shows Wait column with color-coded time for Sent dispatches
2026-04-17 15:41:51 -04:00
Adam Moussa
5dcfc9d303 Show acceptance status in dispatch detail modal
- Accepted field shows green timestamp when acknowledged
- Shows "Awaiting acceptance" in yellow when status is Sent
2026-04-17 15:39:50 -04:00
Adam Moussa
62bc2f058c Add checklist UI to dispatch workflow
- Task List Template picker in dispatch modal
- Checklist section in dispatch detail modal with toggleable items
- Shows completion count, completed by user name + timestamp
- Strikethrough styling on completed items
- fetchTaskTemplates, updateChecklistItem, addChecklistItem API functions
2026-04-17 15:28:52 -04:00
Adam Moussa
714376c61b Update dispatch for multi-WO support
- Pass WorkOrderIds array in dispatch API call
- DispatchDetailModal shows WO list from junction table in header
- dispatchToVendor API simplified to pass full payload
2026-04-17 15:16:28 -04:00
Adam Moussa
27fb70724b Remove Vendor tab from Activity section
- Vendor communication now lives in the dispatch detail modal
- Activity tabs: Customer, Internal, Audit Log
- Comment input only shows on Internal tab
2026-04-17 14:03:41 -04:00
Adam Moussa
2a23febcec Add dispatch detail modal with vendor communication thread
- Click dispatch row to open detail modal
- View/edit dispatch status, NTE, scheduled/completed dates, description
- Vendor Communication thread with message input
- Send email toggle — messages optionally email the vendor
- Modal sized for long email threads with scrollable communication area
- Dispatch table shows dispatch number, clickable rows
2026-04-17 14:01:13 -04:00
Adam Moussa
0455fdf2ec Change dispatch to single vendor select per dispatch
- Switch from checkbox multi-select to radio button single select
- One vendor per dispatch, can dispatch multiple times for multiple vendors
- Selected vendor shown as chip below the list
2026-04-17 12:22:37 -04:00
Adam Moussa
766ad20774 Fix vendor item layout — checkbox left, distance right
- Switch from label to div to avoid global label CSS overriding flex layout
- Checkbox, vendor info, and distance badge now on the same row
2026-04-17 12:19:09 -04:00
Adam Moussa
7bb5133523 Redesign vendor item layout in dispatch modal
- Checkbox on the left, vendor info in the middle, distance badge on the right
- Distance shown as large blue number with "miles" label in a rounded badge
- Vendor address on its own line below trades
2026-04-17 12:16:38 -04:00
Adam Moussa
2769dc23ba Swap trade and address order in dispatch vendor list
- Trade shown directly under company name in blue
- Address and distance shown on the bottom line
2026-04-17 11:59:34 -04:00
Adam Moussa
c09ac4460b Show vendor address and distance in dispatch modal
- Pass locationZip to vendor dropdown API for distance calculation
- Display vendor address and distance in miles (blue, bold)
- Vendors sorted by proximity when site has a zip code
- Include locationZip in WO API response mapping
2026-04-17 11:56:15 -04:00
Adam Moussa
2a4cd5da75 Add searchable vendor picker and scheduled date to dispatch modal
- Vendor list now has search input to filter by name or trade
- Selected vendors shown as removable chips below the list
- NTE and Vendor Scheduled Date side-by-side in the modal
- Sends ScheduledDate with dispatch request
2026-04-17 11:47:19 -04:00
Adam Moussa
0167a1aa75 Add vendor pages and dispatch UI
- Vendor CRUD: list page with search, create/edit form with trade specialty chips
- Vendor routes, sidebar nav item with truck icon
- vendorApi in services/api.js
- Dispatch button on WO view page opens DispatchModal
- DispatchModal: vendor multi-select filtered by trade, NTE field, description
- Dispatches CollapsibleSection with PO table on WO view page
- fetchVendorsDropdown and dispatchToVendor API functions
- dispatches included in getWorkOrderById response mapping
2026-04-17 11:37:49 -04:00
Adam Moussa
feacb72337 Add WO fields, collapsible sections, assign dropdown, settings page
- New Classification section: Problem, Trade, SubTrade dropdowns (SubTrade filters by Trade)
- New Schedule fields: Scheduled, Completed dates
- New Financial section: Vendor NTE, Customer NTE placeholder
- All sections below Details default collapsed with toggle arrows
- Assigned To on view page is now a clickable dropdown like status
- TT moved to Details section
- Dropdown options settings page at /settings/dropdowns with add/edit/delete
- Settings link in sidebar and user dropdown
2026-04-17 10:40:55 -04:00
Adam Moussa
9c83713971 Add internal 8-digit WO number, rename existing to Customer WO
- Pass internalWONumber through API mapping
- Edit page header shows "Edit Work Order XXXXXXXX"
- Rename "Work Order Number" field to "Customer WO" (not required)
- View page shows both Internal WO and Customer WO in details
- Breadcrumb uses internal WO number
- List WO # column shows internal number
2026-04-16 18:42:58 -04:00
Adam Moussa
049934478c Sort all activity tabs oldest-first with newest at bottom
- CommentTimeline and AuditTimeline both sort by date ascending
- Auto-scroll to bottom on all tabs for consistency
2026-04-16 18:33:37 -04:00
Adam Moussa
287839d089 Update audit log immediately after status change
- Append audit entry to local state after successful status update
- No page refresh needed to see the change in the Audit Log tab
2026-04-16 18:32:03 -04:00
Adam Moussa
24c83c6535 Render status dropdown via React portal to fix transparency
- Menu now renders on document.body via createPortal
- Positioned using getBoundingClientRect from the badge button
- Eliminates all parent stacking context / overflow issues
2026-04-16 18:30:45 -04:00
Adam Moussa
3b15a43879 Add interactive status dropdown on work order view page
- Click the status badge to open a dropdown with all status options
- Status change calls ChangeStatus API and updates locally
- Color-coded status dots in the dropdown menu
- Closes on outside click
- Also logged in audit trail via backend ChangeStatus endpoint
2026-04-16 18:27:00 -04:00
Adam Moussa
d3a4bcc984 Add comment input on Internal and Vendor tabs
- Add CommentInput component with textarea and send button
- Enter to send, Shift+Enter for new line
- New comments append to the list immediately without reload
- Fixed 400px height for tab content with scrollable overflow
- Comment input bar pinned at bottom of tab container
- Add addComment API function calling AddCommentJson endpoint
- Auto-scroll to newest comment
2026-04-16 18:22:34 -04:00
Adam Moussa
d979d5571a Add four-tab activity section: Customer, Vendor, Internal, Audit Log
- Filter comments by commentType field (customer, vendor, internal)
- Add AuditTimeline component showing field changes with old → new values
- Pass auditLog from API response to view page
2026-04-16 18:09:57 -04:00
Adam Moussa
1958973968 Split activity into customer and vendor comment tabs
- Extract CommentTimeline into reusable component
- Filter comments: customer (from ingest pipeline, has recordType/commenter)
  vs vendor (internal, has userName from ApplicationUser)
- Add tab UI to switch between streams with counts
- Format comment timestamps with formatDateTime
- Show "No comments yet" when a tab is empty
2026-04-16 18:01:25 -04:00
Adam Moussa
9bae91f281 Format created date as YYYY-MM-DD HH:MM TZ on view page
- Parse timestamp as UTC, display in user's local timezone
- 24-hour format with short timezone name (e.g. 2026-04-16 17:27 EDT)
2026-04-16 17:54:21 -04:00
Adam Moussa
03b2572773 Add work order detail/view page
- Create WorkOrderViewPage with details grid, status badge, and activity timeline
- Add /workorders/:id route for view, keep /workorders/edit/:id for edit
- List page now navigates to view page instead of edit
- Include comments and commenter fields in API response mapping
2026-04-16 17:41:11 -04:00