|
|
|
@@ -2,9 +2,12 @@ |
|
|
|
|
|
|
|
namespace App\Http\Controllers\Web\Customer; |
|
|
|
|
|
|
|
use App\Email\Members\ParkingCertificateOrderNotice; |
|
|
|
use App\Email\Members\UserInfoUpdateOrderNotice; |
|
|
|
use App\Http\Controllers\Web\WebController; |
|
|
|
use App\Kintone\Models\Customer; |
|
|
|
use App\Kintone\Models\UserInfoUpdateApplication; |
|
|
|
use App\Logic\EmailManager; |
|
|
|
use App\Logic\GeneralApplicationManager; |
|
|
|
use Illuminate\Http\JsonResponse; |
|
|
|
use Illuminate\Http\Request; |
|
|
|
use Illuminate\Support\Facades\Auth; |
|
|
|
@@ -31,12 +34,35 @@ class UpdateUserInfoOrderController extends WebController |
|
|
|
|
|
|
|
protected function run(Request $request): JsonResponse |
|
|
|
{ |
|
|
|
$user = Auth::user(); |
|
|
|
$param = $this->param; |
|
|
|
|
|
|
|
$mailer = (new ParkingCertificateOrderNotice()) |
|
|
|
->setUser($user); |
|
|
|
(new EmailManager($mailer))->confirm(); |
|
|
|
$customer = Customer::getSelf(); |
|
|
|
|
|
|
|
$application = new UserInfoUpdateApplication(); |
|
|
|
$manager = new GeneralApplicationManager($application); |
|
|
|
$manager |
|
|
|
->setCustomer($customer) |
|
|
|
->makeApplication(); |
|
|
|
|
|
|
|
$application->nameBefore = $customer->customerName; |
|
|
|
$application->nameAfter = $param->name; |
|
|
|
$application->nameKanaBefore = $customer->customerNameKana; |
|
|
|
$application->nameKanaAfter = $param->nameKana; |
|
|
|
$application->zipCodeBefore = $customer->zipCode; |
|
|
|
$application->zipCodeAfter = $param->zipCode; |
|
|
|
$application->addressBefore = $customer->address; |
|
|
|
$application->addressAfter = $param->address; |
|
|
|
$application->phoneNoBefore = $customer->phoneNumber; |
|
|
|
$application->phoneNoAfter = $param->phoneNo; |
|
|
|
$application->memo = $param->memo; |
|
|
|
|
|
|
|
// メール送信 |
|
|
|
$email = new UserInfoUpdateOrderNotice($customer, $application); |
|
|
|
$email->setUser(Auth::user()); |
|
|
|
$emailMmanager = new EmailManager($email); |
|
|
|
$emailMmanager->confirm(); |
|
|
|
|
|
|
|
$application->save(); |
|
|
|
|
|
|
|
return $this->successResponse(); |
|
|
|
} |
|
|
|
|