Merge branch '807-disable-sms-for-certain-rejection-reasons' into 'master'
Resolve "Disable SMS for certain Rejection Reasons" Closes #807 and #792 See merge request jankstudio/resq!922
This commit is contained in:
commit
f1609b2273
1 changed files with 40 additions and 5 deletions
|
|
@ -4367,12 +4367,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
|
|
||||||
$phone_number = $this->country_code . $notif_number;
|
$phone_number = $this->country_code . $notif_number;
|
||||||
|
|
||||||
// check if reason is administrative
|
// check if reason is in the list of rejection reason
|
||||||
if ($rejection->getReason() == JORejectionReason::ADMINISTRATIVE)
|
$flag_send_sms = $this->checkRejectionReason($rejection->getReason());
|
||||||
return null;
|
|
||||||
|
|
||||||
// check if reason is discount
|
if (!$flag_send_sms)
|
||||||
if ($rejection->getReason() == JORejectionReason::DISCOUNT)
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// sms content
|
// sms content
|
||||||
|
|
@ -4406,6 +4404,43 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$this->rt->sendSMS($phone_number, $this->translator->trans('message.battery_brand_allcaps'), $msg);
|
$this->rt->sendSMS($phone_number, $this->translator->trans('message.battery_brand_allcaps'), $msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function checkRejectionReason($reason): bool
|
||||||
|
{
|
||||||
|
// reason is administrative
|
||||||
|
if ($reason == JORejectionReason::ADMINISTRATIVE)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// reason is discount
|
||||||
|
if ($reason == JORejectionReason::DISCOUNT)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// reason is store closed on schedule
|
||||||
|
if ($reason == JORejectionReason::STORE_CLOSED_SCHEDULED)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// store closed half day
|
||||||
|
if ($reason == JORejectionReason::STORE_CLOSED_HALF_DAY)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// prio hub for warranty claim
|
||||||
|
if ($reason == JORejectionReason::PRIORITY_HUB_WTY_CLAIM)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// prio hub for jumpstart
|
||||||
|
if ($reason == JORejectionReason::PRIORITY_HUB_JUMPSTART)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// prio hub for RES-Q request
|
||||||
|
if ($reason == JORejectionReason::PRIORITY_HUB_RESQ_REQUEST)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// customer request
|
||||||
|
if ($reason == JORejectionReason::CUSTOMER_REQUEST)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected function skipInventoryCheck(Point $coordinates): bool
|
protected function skipInventoryCheck(Point $coordinates): bool
|
||||||
{
|
{
|
||||||
$long = $coordinates->getLongitude();
|
$long = $coordinates->getLongitude();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue