<?php

namespace App\Http\Controllers\V3;

use App\Http\Controllers\Controller;
use App\Http\Traits\ApiResponse;
use App\Services\FMS\GetVehicleActivityService;
use Exception;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class FMSVehicleManagementController extends Controller
{
    use ApiResponse;

    /**
     * @throws Exception
     */
    public function getActivity(Request $request, GetVehicleActivityService $getVehicleActivityService): JsonResponse
    {
        $getVehicleActivityService->setInputParameters([
            "machineCode" => $request->machineCode,
            "startDT" => $request->startDT,
            "endDT" => $request->endDT,
        ]);

        $data = $getVehicleActivityService->run();
        return $this->successResponse($data);
    }
}
