Add addtl fields to pirep - block_off and block_on times, calculate block_off time if not there

This commit is contained in:
Nabeel Shahzad
2018-04-04 13:03:10 -05:00
parent 052813ba4a
commit e27f6f1b14
12 changed files with 130 additions and 26 deletions

View File

@@ -21,6 +21,7 @@ use App\Services\GeoService;
use App\Services\PirepService;
use App\Services\UserService;
use App\Support\Units\Time;
use Carbon\Carbon;
use Flash;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
@@ -283,6 +284,9 @@ class PirepController extends Controller
$minutes = (int) $request->input('minutes', 0);
$pirep->flight_time = Utils::hoursToMinutes($hours) + $minutes;
// Put the time that this is currently submitted
$attrs['submitted_at'] = Carbon::now('UTC');
$pirep = $this->pirepSvc->create($pirep);
$this->saveCustomFields($pirep, $request);
$this->saveFares($pirep, $request);