Add source to invoice criteria. Modify invoice rules to get service fees from... #1701

Merged
arcticzero merged 217 commits from 746-resq-2-0-final into master 2023-11-22 08:54:48 +00:00
2 changed files with 14 additions and 4 deletions
Showing only changes of commit 18c295f2b1 - Show all commits

View file

@ -248,16 +248,16 @@ apiv2_rider_review_tags:
# account deletion
apiv2_account_delete:
path: /apiv2/account
path: /apiv2/account_delete
controller: App\Controller\CustomerAppAPI\AccountController::deleteAccount
methods: [DELETE]
methods: [POST]
apiv2_account_delete_resend_code:
path: /apiv2/account_resend_code
path: /apiv2/account_delete_resend_code
controller: App\Controller\CustomerAppAPI\AccountController:resendCode
methods: [POST]
apiv2_account_delete_code_validate:
path: /apiv2/account_code_validate
path: /apiv2/account_delete_code_validate
controller: App\Controller\CustomerAppAPI\AccountController::validateDeleteCode
methods: [POST]

View file

@ -6,6 +6,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Contracts\Translation\TranslatorInterface;
use Catalyst\ApiBundle\Component\Response as ApiResponse;
use App\Entity\CustomerDeleteRequest;
use App\Entity\Customer;
use App\Service\RisingTideGateway;
use DateTime;
@ -81,9 +82,18 @@ class AccountController extends ApiController
return new ApiResponse(false, 'Invalid request details provided.');
}
// check if a customer record exists for this phone number
$cust_obj = $this->em->getRepository(Customer::class)->findOneBy([
'phone_mobile' => $obj->getPhoneNumber(),
]);
if (empty($cust_obj)) {
return new ApiResponse(false, 'No account exists for this phone number.');
}
// confirm the request
$obj->setConfirmed(true);
$obj->setDateConfirmed(new DateTime());
$obj->setCustomer($cust_obj);
$this->em->flush();
// response