Add percentages as part of sample data #125

This commit is contained in:
Nabeel Shahzad 2018-02-23 15:34:14 -06:00
parent d5aef6fb87
commit b8b4fe7a8a
3 changed files with 14 additions and 6 deletions

View File

@ -239,11 +239,11 @@ subfleet_fare:
capacity: 400
- subfleet_id: 1
fare_id: 2
capacity: 20
price: 120%
- subfleet_id: 1
fare_id: 3
price: 1000
capacity: 10
capacity: 110%
# Fare classes on the 777
- subfleet_id: 2

View File

@ -395,6 +395,16 @@ class FlightController extends BaseController
return $this->return_fares_view($flight);
}
if ($request->isMethod('delete')) {
$fare = $this->fareRepo->findWithoutFail($request->fare_id);
$this->fareSvc->delFareFromFlight($flight, $fare);
return $this->return_fares_view($flight);
}
$this->validate($request, [
'value' => 'nullable', // regex:/([\d%]*)/
]);
/**
* update specific fare data
*/
@ -408,10 +418,6 @@ class FlightController extends BaseController
$override[$request->name] = $request->value;
$this->fareSvc->setForFlight($flight, $fare, $override);
} // dissassociate fare from teh aircraft
elseif ($request->isMethod('delete')) {
$fare = $this->fareRepo->findWithoutFail($request->fare_id);
$this->fareSvc->delFareFromFlight($flight, $fare);
}
return $this->return_fares_view($flight);
}

View File

@ -9,6 +9,8 @@
<a href="http://docs.phpvms.net/concepts/finances"
target="_blank">Read documentation about finances</a>.
@endcomponent
<p class="text-danger">{{ $errors->first('value') }}</p>
</div>
<table id="flight_fares"