feat: implement barangay and household management with associated tests

This commit is contained in:
Developer
2026-06-29 15:02:52 +08:00
parent 9ac2ea7bda
commit b85fc255cf
124 changed files with 2894 additions and 192 deletions

View File

@@ -7,6 +7,7 @@ use App\Models\DropOffPoint;
use App\Models\Trip;
use App\Models\TripStop;
use App\Services\Scan\ScanService;
use Carbon\Carbon;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -46,7 +47,7 @@ class ScannerController extends ApiController
wasteType: $data['waste_type'] ?? null,
photoPath: $data['photo_path'] ?? null,
notes: $data['notes'] ?? null,
scannedAt: isset($data['scanned_at']) ? \Carbon\Carbon::parse($data['scanned_at']) : null,
scannedAt: isset($data['scanned_at']) ? Carbon::parse($data['scanned_at']) : null,
);
if (! $result->accepted) {
@@ -87,6 +88,7 @@ class ScannerController extends ApiController
$dop = DropOffPoint::find($s['drop_off_point_id']);
if (! $dop) {
$results[] = ['index' => $i, 'serial' => $s['serial'], 'accepted' => false, 'reason' => 'dop_not_found'];
continue;
}
$trip = isset($s['trip_id']) ? Trip::where('uuid', $s['trip_id'])->first() : null;
@@ -100,7 +102,7 @@ class ScannerController extends ApiController
lng: (float) $s['lng'],
trip: $trip,
tripStop: $stop,
scannedAt: isset($s['scanned_at']) ? \Carbon\Carbon::parse($s['scanned_at']) : null,
scannedAt: isset($s['scanned_at']) ? Carbon::parse($s['scanned_at']) : null,
);
$results[] = [
'index' => $i,