Mobile Repairs

Mobile Repairs

The mobile repair workflow lets technicians report faults, upload photographic evidence, and manage their repair queue from any device. Combined with QR code scanning, it provides a fast path from discovering an issue to creating a tracked repair record.

MobileRepairController endpoints

The following API endpoints power the mobile repair experience:

Method Endpoint Description
POST /repairs/mobile/report Quick repair report via QR scan, photo, and text description.
POST /repairs/{id}/mobile/photo Upload a photo during an active repair (base64 or file upload).
GET /repairs/mobile/my-repairs Technician's assigned repair queue with status and priority filters.
GET /repairs/mobile/sync-queue Offline sync queue status (future enhancement).
GET /repairs/mobile/scan/{equipmentId} QR scan result showing equipment repair status and history.

Reporting a repair from mobile

To report a fault from the field, use the POST /repairs/mobile/report endpoint. The request payload includes:

  • equipment_id — UUID of the affected equipment (typically obtained by scanning its QR code).
  • problem_description — Free-text description of the issue. Can be typed or dictated using voice input.
  • priority — One of low, medium, high, or critical.
  • photos — An array of base64-encoded images documenting the damage. The first photo is categorised as before; subsequent photos as damage.
  • gps_location — An object with lat and lng properties, captured automatically from the device's location services.

The MobileRepairService.createFromMobile(data) method processes this payload. It sets reported_by to the current user, reported_at to the current timestamp, and status to reported. GPS coordinates are stored in the repair's attachments JSON field.

Uploading photos during repair

Technicians can add photos at any stage of the repair process using POST /repairs/{id}/mobile/photo. The request accepts:

  • photo — Either a base64-encoded image string or a standard file upload.
  • photo_type — Categorises the image: before, during, after, or other.
  • caption — Optional descriptive text for the photo.

The MobileRepairService.uploadPhoto() method handles both base64 and file uploads. Photos are stored in repairs/{repairId}/photos/ on the public disk. A RepairPhoto record is created with the file path, MIME type, file size, and any EXIF metadata (including GPS coordinates if embedded in the image).

Technician's repair queue

The GET /repairs/mobile/my-repairs endpoint returns the authenticated technician's assigned repairs. It supports the following query parameters:

  • status — Filter by one or more statuses (e.g. reported, in_repair).
  • priority — Filter by priority level.
  • include_completed — Boolean toggle; defaults to false. When false, only active repairs are returned.

Results are sorted by priority (critical first) then by deadline (earliest first), and paginated at 20 items per page. Each repair includes its status, priority, equipment details, progress percentage, and deadline.

QR code scanning

Scanning an equipment QR code calls GET /repairs/mobile/scan/{equipmentId}. The response from MobileRepairService.getEquipmentRepairStatus() includes:

  • Equipment details — Name, model, serial number, current status, and image URL.
  • in_repair — Boolean indicating whether active repairs exist for this equipment.
  • active_repairs — A list of current repairs showing repair number, status, priority, problem description, assigned technician, estimated completion date, and progress percentage.
  • repair_history_count — Total number of historical repairs for this equipment.

This gives technicians instant context when they encounter an equipment item — they can see whether it is already being repaired, who is handling it, and what the issue is.

GPS location capture

When reporting a repair from mobile, GPS coordinates are captured from the device at the time of submission. These are stored in the repair's attachments field as a JSON object containing latitude, longitude, and recorded_at timestamp. This is useful for tracking where damage occurred, especially for equipment deployed across multiple sites.

Offline sync support

The GET /repairs/mobile/sync-queue endpoint is reserved for a future offline sync feature. When connectivity is limited on remote sites, repairs created offline will be queued locally on the device and synchronised once a connection is restored. The endpoint currently returns a placeholder response with zero pending items.

Tips and best practices

  • Encourage technicians to photograph damage before starting work and again after completion — this provides clear evidence of the repair quality.
  • Use QR scanning as part of your daily equipment check routine to quickly identify items with open repair tickets.
  • Ensure device location permissions are granted so GPS data is captured with every mobile report.
  • Keep photo file sizes under 10 MB to ensure uploads complete reliably on mobile data connections.

Was this article helpful?