diff --git a/app/Models/Bid.php b/app/Models/Bid.php index 362a07b9..cbe399a6 100644 --- a/app/Models/Bid.php +++ b/app/Models/Bid.php @@ -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 { diff --git a/app/Services/BidService.php b/app/Services/BidService.php index 5b015bc2..847aa482 100644 --- a/app/Services/BidService.php +++ b/app/Services/BidService.php @@ -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; } /**