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
|
|
|
{
|
|
|
|
$rules = [
|
2019-11-06 00:44:31 +08:00
|
|
|
'airline_id' => 'required|exists:airlines,id',
|
|
|
|
'aircraft_id' => 'required|exists:aircraft,id',
|
|
|
|
'flight_number' => 'required',
|
|
|
|
'dpt_airport_id' => 'required',
|
|
|
|
'arr_airport_id' => 'required',
|
|
|
|
'flight_id' => 'nullable',
|
|
|
|
'source_name' => 'required',
|
2018-09-09 00:38:30 +08:00
|
|
|
'alt_airport_id' => 'nullable',
|
2018-05-04 04:07:16 +08:00
|
|
|
'status' => 'nullable',
|
2018-03-20 09:50:40 +08:00
|
|
|
'level' => 'nullable|numeric',
|
2018-05-01 06:29:42 +08:00
|
|
|
'flight_type' => 'nullable',
|
2018-03-20 09:50:40 +08:00
|
|
|
'route_code' => 'nullable',
|
|
|
|
'route_leg' => 'nullable',
|
|
|
|
'distance' => 'nullable|numeric',
|
2018-03-30 02:42:16 +08:00
|
|
|
'block_time' => 'nullable|integer',
|
2018-03-20 09:50:40 +08:00
|
|
|
'flight_time' => 'nullable|integer',
|
|
|
|
'planned_distance' => 'nullable|numeric',
|
|
|
|
'planned_flight_time' => 'nullable|integer',
|
|
|
|
'zfw' => 'nullable|numeric',
|
|
|
|
'block_fuel' => 'nullable|numeric',
|
|
|
|
'route' => 'nullable',
|
|
|
|
'notes' => 'nullable',
|
2018-04-26 00:56:05 +08:00
|
|
|
'score' => 'nullable|integer',
|
2018-03-30 03:12:25 +08:00
|
|
|
'block_off_time' => 'nullable|date',
|
|
|
|
'block_on_time' => 'nullable|date',
|
2018-03-20 09:50:40 +08:00
|
|
|
'created_at' => 'nullable|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
|
|
|
];
|
|
|
|
|
|
|
|
return $rules;
|
|
|
|
}
|
|
|
|
}
|