Refactor fares inheritance #905 (#906)

This commit is contained in:
Nabeel S
2020-10-27 18:46:15 -04:00
committed by GitHub
parent 060bebf8fe
commit dc7efc981c
8 changed files with 187 additions and 121 deletions

View File

@@ -13,11 +13,15 @@ use Illuminate\Support\Facades\Log;
class BidService extends Service
{
/** @var FareService */
private $fareSvc;
/** @var FlightService */
private $flightSvc;
public function __construct(FlightService $flightSvc)
public function __construct(FareService $fareSvc, FlightService $flightSvc)
{
$this->fareSvc = $fareSvc;
$this->flightSvc = $flightSvc;
}
@@ -26,7 +30,7 @@ class BidService extends Service
*
* @param $bid_id
*
* @return \App\Models\Bid|\Illuminate\Database\Eloquent\Model|object|null
* @return \App\Models\Bid|\Illuminate\Database\Eloquent\Model|tests/ImporterTest.php:521object|null
*/
public function getBid($bid_id)
{
@@ -55,6 +59,7 @@ class BidService extends Service
foreach ($bids as $bid) {
$bid->flight = $this->flightSvc->filterSubfleets($user, $bid->flight);
$bid->flight = $this->fareSvc->getReconciledFaresForFlight($bid->flight);
}
return $bids;