2018-01-29 01:12:13 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Acars;
|
|
|
|
|
2019-07-16 03:44:31 +08:00
|
|
|
use App\Contracts\FormRequest;
|
2018-01-29 01:12:13 +08:00
|
|
|
|
|
|
|
class PrefileRequest extends FormRequest
|
|
|
|
{
|
2019-11-06 00:44:31 +08:00
|
|
|
public function rules(): array
|
2018-01-29 01:12:13 +08:00
|
|
|
{
|
2020-02-28 00:37:05 +08:00
|
|
|
return [
|
2019-11-06 00:44:31 +08:00
|
|
|
'airline_id' => 'required|exists:airlines,id',
|
|
|
|
'aircraft_id' => 'required|exists:aircraft,id',
|
2019-12-04 04:45:18 +08:00
|
|
|
'flight_id' => 'sometimes|exists:flights,id',
|
2019-11-06 00:44:31 +08:00
|
|
|
'flight_number' => 'required',
|
2020-02-28 00:37:05 +08:00
|
|
|
'dpt_airport_id' => 'required',
|
|
|
|
'arr_airport_id' => 'required',
|
2019-11-06 00:44:31 +08:00
|
|
|
'source_name' => 'required',
|
2020-02-28 00:37:05 +08:00
|
|
|
'alt_airport_id' => 'sometimes',
|
2019-12-03 07:27:58 +08:00
|
|
|
'status' => 'sometimes',
|
2018-03-20 09:50:40 +08:00
|
|
|
'level' => 'nullable|numeric',
|
2019-12-03 07:27:58 +08:00
|
|
|
'flight_type' => 'sometimes',
|
|
|
|
'route_code' => 'sometimes',
|
|
|
|
'route_leg' => 'sometimes',
|
|
|
|
'distance' => 'sometimes|numeric',
|
|
|
|
'block_time' => 'sometimes|integer',
|
|
|
|
'flight_time' => 'sometimes|integer',
|
|
|
|
'planned_distance' => 'sometimes|numeric',
|
|
|
|
'planned_flight_time' => 'sometimes|integer',
|
|
|
|
'zfw' => 'sometimes|numeric',
|
|
|
|
'block_fuel' => 'sometimes|numeric',
|
2018-03-20 09:50:40 +08:00
|
|
|
'route' => 'nullable',
|
|
|
|
'notes' => 'nullable',
|
2019-12-03 07:27:58 +08:00
|
|
|
'score' => 'sometimes|integer',
|
|
|
|
'block_off_time' => 'sometimes|date',
|
|
|
|
'block_on_time' => 'sometimes|date',
|
|
|
|
'created_at' => 'sometimes|date',
|
2018-03-14 23:34:41 +08:00
|
|
|
|
2018-08-27 00:40:04 +08:00
|
|
|
// See if the fare objects are included and formatted properly
|
|
|
|
'fares' => 'nullable|array',
|
|
|
|
'fares.*.id' => 'required',
|
|
|
|
'fares.*.count' => 'required|numeric',
|
2018-01-29 01:12:13 +08:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|