Add subfleet data when single bid is retrieved
This commit is contained in:
@@ -10,6 +10,8 @@ use Carbon\Carbon;
|
|||||||
* @property string flight_id
|
* @property string flight_id
|
||||||
* @property Carbon created_at
|
* @property Carbon created_at
|
||||||
* @property Carbon updated_at
|
* @property Carbon updated_at
|
||||||
|
* @property Flight flight
|
||||||
|
* @property User user
|
||||||
*/
|
*/
|
||||||
class Bid extends Model
|
class Bid extends Model
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,7 +48,15 @@ class BidService extends Service
|
|||||||
'flight.subfleets.fares',
|
'flight.subfleets.fares',
|
||||||
];
|
];
|
||||||
|
|
||||||
return Bid::with($with)->where(['id' => $bid_id])->first();
|
/** @var Bid $bid */
|
||||||
|
$bid = Bid::with($with)->where(['id' => $bid_id])->first();
|
||||||
|
|
||||||
|
// Reconcile the aircraft for this bid
|
||||||
|
// TODO: Only do this if there isn't a Simbrief attached?
|
||||||
|
$bid->flight = $this->flightSvc->filterSubfleets($user, $bid->flight);
|
||||||
|
$bid->flight = $this->fareSvc->getReconciledFaresForFlight($bid->flight);
|
||||||
|
|
||||||
|
return $bid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user