<?php

namespace App\Http\Controllers\V3\Dashboard\Mission;

use App\Http\Controllers\Controller;
use App\Http\Traits\ApiResponse;
use App\Models\Mission;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class DetailController extends Controller
{
    use ApiResponse;

    public function machines(Mission $mission): JsonResponse
    {
        return $this->successResponse($mission->machines()->get(['cmms_machines.id', 'cmms_machines.machine_code', 'cmms_machines.car_name', 'cmms_machines.plak_number']));
    }

    public function rahdaran(Mission $mission): JsonResponse
    {
        return $this->successResponse($mission->rahdaran()->get(['rahdaran.id', 'rahdaran.name', 'rahdaran.code']));
    }
}
