Resolve "Jumpstart fee for Hotline" #1686

Merged
korina.cordero merged 1 commit from 760-jumpstart-fee-for-hotline into 746-resq-2-0-final 2023-09-04 07:58:51 +00:00

View file

@ -55,22 +55,18 @@ class Jumpstart implements InvoiceRuleInterface
public function getServiceTypeFee($source, CustomerVehicle $cv)
{
$code = 'jumpstart_fee';
// check if customer vehicle has a motolite battery
// if yes, set the code to the motolite user service fee
if ($cv->hasMotoliteBattery())
$code = 'motolite_user_service_fee';
else
// check the source of JO
// (1) if from app, service fee is 0 if motolite user. jumpstart fee for app if non-motolite user.
// (2) any other source, jumpstart fees are charged whether motolite user or not
if ($source == TransactionOrigin::MOBILE_APP)
{
// find the service fee for jumpstart using the code
// if we can't find the fee, return 0
// jumpstart fee depends on the JO source. Jumpstart from app has a different fee
// we set the code to search for the default
if ($source == TransactionOrigin::MOBILE_APP)
if ($cv->hasMotoliteBattery())
$code = 'motolite_user_service_fee';
else
$code = 'jumpstart_fee_mobile_app';
}
else
$code = 'jumpstart_fee';
$fee = $this->em->getRepository(ServiceOffering::class)->findOneBy(['code' => $code]);