Add subfleet data when single bid is retrieved
This commit is contained in:
parent
8a94d8db7b
commit
74a1b4d753
@ -10,6 +10,8 @@ use Carbon\Carbon;
|
||||
* @property string flight_id
|
||||
* @property Carbon created_at
|
||||
* @property Carbon updated_at
|
||||
* @property Flight flight
|
||||
* @property User user
|
||||
*/
|
||||
class Bid extends Model
|
||||
{
|
||||
|
@ -48,7 +48,15 @@ class BidService extends Service
|
||||
'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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user