Split rank pay rate into separate rates for acars and manual flights
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Enums\PirepSource;
|
||||
use App\Models\Pirep;
|
||||
|
||||
class FinanceService extends BaseService
|
||||
{
|
||||
private $fareSvc,
|
||||
@@ -22,4 +25,19 @@ class FinanceService extends BaseService
|
||||
$this->fareSvc = $fareSvc;
|
||||
$this->flightSvc = $flightSvc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the pilot's hourly pay for the given PIREP
|
||||
* @param Pirep $pirep
|
||||
*/
|
||||
public function getPayForPirep(Pirep $pirep)
|
||||
{
|
||||
# Get the base rate for the rank
|
||||
$rank = $pirep->user->rank;
|
||||
if($pirep->source === PirepSource::ACARS) {
|
||||
$base_rate = $rank->acars_base_pay_rate;
|
||||
} else {
|
||||
$base_rate = $rank->manual_base_pay_rate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user