feat: Full field service platform build — 16 commits #14

Merged
jmiller merged 17 commits from dev into main 2026-06-18 14:55:44 +00:00
Owner

Summary

  • 9 helpers, 4 API controllers, 4 site views, 7 admin models, 12 tables
  • Work order management with dispatch and technician assignment
  • RouteHelper with nearest-neighbor optimization and GPS breadcrumbs
  • InvoiceHelper generates CRM invoices from completed WOs (labor + parts)
  • EstimateView for public customer approval with e-signature
  • Mobile tech app (GPS, photos, time logging, parts usage)
  • Service agreements, equipment tracking, vehicle fleet, truck stock
  • CustomerPortal for WO status and service history

Test plan

  • Verify all 12 Field tables created
  • Test work order create → dispatch → complete flow
  • Test route optimization with haversine distance
  • Test estimate approval via token URL
  • Verify invoice generation from completed WO
## Summary - 9 helpers, 4 API controllers, 4 site views, 7 admin models, 12 tables - Work order management with dispatch and technician assignment - RouteHelper with nearest-neighbor optimization and GPS breadcrumbs - InvoiceHelper generates CRM invoices from completed WOs (labor + parts) - EstimateView for public customer approval with e-signature - Mobile tech app (GPS, photos, time logging, parts usage) - Service agreements, equipment tracking, vehicle fleet, truck stock - CustomerPortal for WO status and service history ## Test plan - [ ] Verify all 12 Field tables created - [ ] Test work order create → dispatch → complete flow - [ ] Test route optimization with haversine distance - [ ] Test estimate approval via token URL - [ ] Verify invoice generation from completed WO
jmiller added 16 commits 2026-06-18 13:37:34 +00:00
Layer 2 add-on for MokoSuite CRM. Field service operations for
plumbing, electrical, HVAC, and general trades.

Schema (12 tables):
- Technicians (trade, certifications, GPS, service radius, vehicle)
- Service Locations (customer properties with access notes, GPS)
- Work Orders (full lifecycle: new > dispatched > en_route > on_site >
  in_progress > completed > invoiced, with priority/trade/category)
- WO Line Items (labor, parts, materials, flat rate, permits)
- WO Photos (before/during/after with GPS coordinates)
- Service Agreements (recurring maintenance contracts with SLA)
- Equipment (HVAC units, panels, water heaters with serial/warranty)
- Vehicles (fleet tracking with mileage, inspection, GPS)
- Truck Stock (per-vehicle parts inventory with reorder points)
- Dispatch Log (assignment and routing history with GPS)
- Estimates (on-site quoting with token-based customer acceptance)
- Time Entries (per-WO labor tracking with overtime/travel flags)

Helpers:
- DispatchHelper: find best tech by trade/location/workload, dispatch
  board, auto-assignment, unassigned queue
- WorkOrderHelper: create, status lifecycle, completion with signature,
  dashboard stats

Infrastructure:
- Joomla 6 (PHP 8.3+), admin dashboard with dispatch board
- Git submodules: MokoSuite + MokoSuiteCRM
- GPL-3.0 license
ServiceAgreementHelper: active agreements, expiring, revenue summary.
EquipmentHelper: location equipment, QR lookup, service due, warranty expiry.
EstimateHelper: create, send, accept with signature, auto-convert to WO.
FieldWorkOrderController API: CRUD + dispatch + board + available techs.
Admin views: WorkOrders list, Technicians list, ServiceAgreements with
recurring revenue dashboard. All with templates.
FieldAutomation task plugin: service reminders, agreement renewal alerts,
equipment warranty expiry, truck stock reorder.
MokoSuiteFieldApi webservices: 6 CRUD routes (workorders, technicians,
equipment, agreements, estimates, locations). Router, config.xml, access.xml.
WorkOrderHelper: reads wo_prefix and default_trade from config.xml.
FieldWorkOrderController: requireAuth() checks on list (core.manage),
create (core.create), dispatch (field.dispatch) endpoints.
TechMobile: tablet/phone view for field techs — today's jobs sorted by
priority, current job card with address/access notes/phone link, GPS
status updates (en route/arrived/start/complete), Google Maps navigation.
BookService: public form for customers to request service — trade
selector, priority, description, auto contact + work order creation.
TruckStockHelper: per-vehicle inventory, low stock, use/restock parts.
VehicleHelper: fleet overview, inspection due dates.
Admin views: Equipment list with service due alerts, Dispatch board
with date picker and tech assignments, Vehicles fleet with low stock
indicators and inspection tracking. All with templates.
FieldMobileController: 8 endpoints for field tech mobile app — my jobs
(priority-sorted with customer/location data), status updates with GPS,
photo upload with geotag, start/stop time entries, log parts from truck
stock (auto-deducts + adds WO line item), GPS heartbeat, equipment QR
code lookup. Auth requires technician profile linked to Joomla user.
- FieldEquipmentController: equipment CRUD, vehicles, truck stock, service agreements
- FieldEstimatesController: estimates CRUD, convert-to-WO, route optimization API
All use Joomla 6 BaseDatabaseModel with $this->getDatabase()
Updated .gitmodules URL and path for the MokoSuite → MokoSuiteClient rename.
jmiller added 1 commit 2026-06-18 14:03:23 +00:00
- Add CSRF token validation on EstimateView approve/reject forms
- Add status guard on reject branch (prevent reversing approved estimates)
- Fix loc.* column collision in WorkOrdersModel::getWorkOrder (overwrote wo.id)
- Add (int) cast on all query parameter concatenations
- Wrap InvoiceHelper::generateFromWorkOrder in database transaction
- Replace magic 0.5 divisor with AVG_SPEED_MPH constant in RouteHelper
jmiller merged commit f488c0ea12 into main 2026-06-18 14:55:44 +00:00
Sign in to join this conversation.
No Reviewers
Priority -
Type -
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteField#14