PHPackages                             azaharizaman/nexus-field-service - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. azaharizaman/nexus-field-service

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

azaharizaman/nexus-field-service
================================

Framework-agnostic field service management engine for work orders, technician dispatch, mobile job execution, service contracts, and SLA tracking

v0.1.0-alpha1(1mo ago)00MITPHPPHP ^8.3

Since May 5Pushed 1mo agoCompare

[ Source](https://github.com/azaharizaman/nexus-field-service)[ Packagist](https://packagist.org/packages/azaharizaman/nexus-field-service)[ RSS](/packages/azaharizaman-nexus-field-service/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (9)Versions (2)Used By (0)

Nexus\\FieldService
===================

[](#nexusfieldservice)

Framework-agnostic field service management engine for work orders, technician dispatch, mobile job execution, service contracts, and SLA tracking.

Overview
--------

[](#overview)

The **FieldService** package provides a complete solution for managing field service operations including:

- Work order lifecycle management (NEW → SCHEDULED → IN\_PROGRESS → COMPLETED → VERIFIED)
- Intelligent technician assignment based on skills, proximity, and capacity
- Service contract management with SLA tracking
- Mobile job execution with offline sync capability
- Parts consumption with van stock waterfall logic
- GPS location tracking with privacy controls
- Customer signature capture and verification
- Automated preventive maintenance scheduling
- Service report generation

Features by Tier
----------------

[](#features-by-tier)

### Tier 1: Basic Work Orders

[](#tier-1-basic-work-orders)

- Manual work order creation and assignment
- Technician schedule management
- Basic parts consumption tracking
- Customer signature capture (SHA-256 hash)
- Service report PDF generation

### Tier 2: Service Contracts &amp; Preventive Maintenance

[](#tier-2-service-contracts--preventive-maintenance)

- Service contract management with asset linkage
- SLA deadline tracking and breach alerts
- Automated preventive maintenance scheduling (7 days before due date)
- Maintenance deduplication (±3 days conflict detection)
- Checklist templates and validation

### Tier 3: Enterprise Features

[](#tier-3-enterprise-features)

- ML-powered technician assignment via `Nexus\Intelligence`
- VRP route optimization via `Nexus\Routing`
- RFC 3161 cryptographic timestamp signing for signatures
- Advanced GPS tracking and analytics
- Event sourcing for compliance auditing

Installation
------------

[](#installation)

```
composer require azaharizaman/nexus-field-service
```

Key Concepts
------------

[](#key-concepts)

### Work Order States

[](#work-order-states)

```
NEW → SCHEDULED → IN_PROGRESS → COMPLETED → VERIFIED
  ↓       ↓            ↓            ↓
  └───────┴────────────┴────────────┴─→ CANCELLED

```

### Parts Consumption Waterfall

[](#parts-consumption-waterfall)

1. Check technician van stock
2. Deduct available quantity from van
3. Deduct remainder from primary warehouse
4. Update work order parts cost

### SLA Tracking

[](#sla-tracking)

Service contracts define response times (e.g., "4 hours"). When a work order is created against a contract:

1. Calculate SLA deadline based on response time
2. Schedule escalation check job
3. Monitor progress via `Nexus\Workflow`
4. Trigger escalation workflow on breach

Dependencies
------------

[](#dependencies)

### Required Packages

[](#required-packages)

- `azaharizaman/nexus-party` - Customer and vendor management
- `azaharizaman/nexus-backoffice` - Staff/technician management
- `azaharizaman/nexus-inventory` - Parts consumption tracking
- `azaharizaman/nexus-warehouse` - Van stock management
- `azaharizaman/nexus-scheduler` - Preventive maintenance automation
- `azaharizaman/nexus-routing` - Route optimization (Tier 3)
- `azaharizaman/nexus-geo` - Geocoding and distance calculation
- `azaharizaman/nexus-workflow` - SLA escalation
- `azaharizaman/nexus-sequencing` - Work order numbering
- `azaharizaman/nexus-document` - Service report PDF generation
- `azaharizaman/nexus-storage` - Photo and signature storage
- `azaharizaman/nexus-notifier` - Multi-channel notifications
- `azaharizaman/nexus-audit-logger` - Audit trail
- `azaharizaman/nexus-tenant` - Multi-tenancy isolation
- `azaharizaman/nexus-product` - Service and parts catalog

### Optional Packages

[](#optional-packages)

- `azaharizaman/nexus-assets` - Asset tracking and maintenance history
- `azaharizaman/nexus-intelligence` - AI-powered assignment (Tier 3)
- `azaharizaman/nexus-crypto` - Signature timestamp signing (Tier 3)
- `azaharizaman/nexus-event-stream` - Event sourcing for compliance

Usage
-----

[](#usage)

### Creating a Work Order

[](#creating-a-work-order)

```
use Nexus\FieldService\Services\WorkOrderManager;
use Nexus\FieldService\Enums\WorkOrderPriority;
use Nexus\FieldService\Enums\ServiceType;

$workOrder = $workOrderManager->create([
    'customer_party_id' => 'party-123',
    'service_location_id' => 'address-456',
    'service_type' => ServiceType::REPAIR,
    'priority' => WorkOrderPriority::HIGH,
    'description' => 'HVAC system not cooling properly',
    'scheduled_start' => new \DateTimeImmutable('2025-11-25 09:00:00'),
]);
```

### Assigning a Technician

[](#assigning-a-technician)

```
use Nexus\FieldService\Services\TechnicianDispatcher;

// Find best available technician
$technician = $technicianDispatcher->findBestTechnician(
    $workOrder,
    $availableTechnicians
);

// Assign to work order
$workOrderManager->assign($workOrder->getId(), $technician->getId());
```

### Recording Parts Consumption

[](#recording-parts-consumption)

```
use Nexus\FieldService\Services\PartsConsumptionManager;

$partsConsumptionManager->recordConsumption(
    $workOrder->getId(),
    $productVariantId,
    $quantity,
    $technicianId
);
// Automatically deducts from van stock first, then warehouse
```

### Capturing Customer Signature

[](#capturing-customer-signature)

```
$signatureData = base64_encode($signatureImageBinary);

$workOrderManager->captureSignature(
    $workOrder->getId(),
    $signatureData,
    $technicianId,
    $gpsLocation
);
```

### Generating Service Report

[](#generating-service-report)

```
use Nexus\FieldService\Services\ServiceReportGenerator;

$document = $serviceReportGenerator->generate($workOrder->getId());
// Returns DocumentInterface with PDF content
```

Architecture
------------

[](#architecture)

This package follows the Nexus monorepo architecture:

- **Package Layer** (`packages/FieldService/`): Framework-agnostic business logic
- **Application Layer** (`apps/Atomy/`): Laravel implementation with Eloquent models and migrations

### Package Structure

[](#package-structure)

```
packages/FieldService/
├── src/
│   ├── Contracts/          # Interfaces for dependency injection
│   ├── Services/           # Business logic orchestrators
│   ├── Core/               # Internal engine components
│   ├── Enums/              # Native PHP 8.3 enums
│   ├── ValueObjects/       # Immutable data structures
│   ├── Events/             # Domain events
│   └── Exceptions/         # Domain-specific exceptions

```

Testing
-------

[](#testing)

```
composer test
```

Documentation
-------------

[](#documentation)

### Getting Started

[](#getting-started)

- **[Getting Started Guide](docs/getting-started.md)** - Comprehensive 840-line guide covering:
    - Prerequisites and installation
    - 7 core concepts (work order lifecycle, assignment strategies, SLA enforcement, preventive maintenance, offline sync, GPS tracking, parts consumption)
    - Configuration and setup
    - Integration examples
    - Troubleshooting and performance tips

### API Reference

[](#api-reference)

- **[API Reference](docs/api-reference.md)** - Complete documentation of:
    - 17 interfaces (WorkOrderInterface, TechnicianAssignmentStrategyInterface, GpsTrackerInterface, MobileSyncManagerInterface, etc.)
    - 3 value objects (GpsLocation, SkillSet, LaborHours)
    - 3 enums (WorkOrderStatus, WorkOrderPriority, MaintenanceType)
    - 14 exceptions with factory methods

### Integration Guides

[](#integration-guides)

- **[Integration Guide](docs/integration-guide.md)** - Framework integration examples:
    - Laravel service provider and controller examples
    - Symfony services.yaml and controller examples
    - Common patterns (offline sync, GPS tracking, SLA monitoring)
    - Testing examples

### Code Examples

[](#code-examples)

- **[Basic Usage](docs/examples/basic-usage.php)** - Common operations:
    - Create and auto-assign work orders
    - Start work orders with GPS validation
    - Complete work orders with signatures
    - Service contract validation
    - SLA breach detection
- **[Advanced Usage](docs/examples/advanced-usage.php)** - Complex scenarios:
    - Custom technician assignment strategies
    - Offline mobile sync with conflict resolution
    - Preventive maintenance scheduling with deduplication

### Implementation Documentation

[](#implementation-documentation)

- **[Implementation Summary](IMPLEMENTATION_SUMMARY.md)** - 806-line detailed implementation status
- **[Requirements](REQUIREMENTS.md)** - 100 documented requirements with traceability
- **[Test Suite Summary](TEST_SUITE_SUMMARY.md)** - ~95 tests with coverage metrics
- **[Valuation Matrix](VALUATION_MATRIX.md)** - Package valuation ($820K value, 3,696% ROI)

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) file for details.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance93

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 76.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

36d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/117408?v=4)[Azahari Zaman](/maintainers/azaharizaman)[@azaharizaman](https://github.com/azaharizaman)

---

Top Contributors

[![azaharizaman](https://avatars.githubusercontent.com/u/117408?v=4)](https://github.com/azaharizaman "azaharizaman (465 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (139 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

mobilemaintenancedispatchgpsslafield-servicetechnicianwork orderservice-contract

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/azaharizaman-nexus-field-service/health.svg)

```
[![Health](https://phpackages.com/badges/azaharizaman-nexus-field-service/health.svg)](https://phpackages.com/packages/azaharizaman-nexus-field-service)
```

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

515135.1M619](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[phpro/soap-client

A general purpose SoapClient library

8955.9M52](/packages/phpro-soap-client)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k41](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

744284.3k34](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7126.9M199](/packages/illuminate-broadcasting)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
