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
Showing only changes of commit b3b81e4e27 - Show all commits

View file

@ -33,8 +33,23 @@ class AccountController extends ApiController
// use the test code if we're using a test number or are on test mode
$code = $this->getConfirmCode($phone_number);
// build model
$success_msg = 'We have sent a confirmation code to the submitted phone number if it is valid.';
// initialize model
$obj = new CustomerDeleteRequest();
// check if a customer record exists for this phone number
$cust_obj = $this->em->getRepository(Customer::class)->findOneBy([
'phone_mobile' => $phone_number,
]);
if (empty($cust_obj)) {
// return a random id anyway if we don't find this customer
return new ApiResponse(true, $success_msg, [
'request_id' => $obj->getID(),
]);
}
// phone number is valid, we continue building the model
$obj->setPhoneNumber($phone_number);
$obj->setReason($reason);
$obj->setConfirmCode($code);
@ -50,7 +65,7 @@ class AccountController extends ApiController
$this->em->flush();
// response
return new ApiResponse(true, '', [
return new ApiResponse(true, $success_msg, [
'request_id' => $obj->getID(),
]);
}