Browse Source

プラン変更申請対応

master
sosuke.iwabuchi 2 years ago
parent
commit
27720d6b0f
9 changed files with 99 additions and 3 deletions
  1. +1
    -0
      app/Codes/Email.php
  2. +42
    -0
      app/Email/Members/ChangePlanOrderApprove.php
  3. +3
    -1
      app/Email/Members/ChangePlanOrderNotice.php
  4. +12
    -0
      app/Http/Controllers/Web/Email/EmailSendController.php
  5. +1
    -1
      app/Http/Controllers/Web/SeasonTicketContract/ChangePlanOrderOptionsController.php
  6. +4
    -0
      app/Kintone/Models/SeasonTicketContractPlan.php
  7. +19
    -0
      resources/views/emails/members/change_plan_order_approve.blade.php
  8. +17
    -1
      resources/views/emails/members/change_plan_order_notice.blade.php
  9. BIN
      設計書/メール一覧.xlsx

+ 1
- 0
app/Codes/Email.php View File

@@ -9,4 +9,5 @@ enum Email: string
case USER_INFO_UPDATE_ORDER_APPROVE = '利用者情報変更完了';
case ENTRY_APPROVE = '申込受付';
case ENTRY_PAYMENT_COMPLETE = '申込承認';
case CHANGE_PLAN_ORDER_APPROVE = 'プラン変更完了';
}

+ 42
- 0
app/Email/Members/ChangePlanOrderApprove.php View File

@@ -0,0 +1,42 @@
<?php

namespace App\Email\Members;

use App\Kintone\Models\ChangePlanApplication;
use App\Kintone\Models\Customer;
use App\Kintone\Models\SeasonTicketContract;

class ChangePlanOrderApprove extends Members
{

public function __construct(
private SeasonTicketContract $seasonTicketContract,
private ChangePlanApplication $app,
?Customer $customer = null,
) {
if ($customer === null) {
$customer = $app->getCustomer();
}
parent::__construct($customer);
}

public function getTemplateName(): string
{
return 'emails.members.change_plan_order_approve';
}

public function getSubject(): string
{
return "プラン変更申請完了のお知らせ";
}

public function getMemberParams(): array
{
return [
'parking_name' => $this->app->parkingName,
'customer_name' => $this->customer->customerName,
'plan_name' => $this->app->planNameAfter,
'memo' => $this->app->memo,
];
}
}

+ 3
- 1
app/Email/Members/ChangePlanOrderNotice.php View File

@@ -27,13 +27,15 @@ class ChangePlanOrderNotice extends Members

public function getSubject(): string
{
return "##TODO プラン変更申請受付のお知らせ";
return "プラン変更申請受付のお知らせ";
}

public function getMemberParams(): array
{
return [
'parking_name' => $this->app->parkingName,
'customer_name' => $this->customer->customerName,
'plan_name' => $this->app->planNameAfter,
'memo' => $this->app->memo,
];
}


+ 12
- 0
app/Http/Controllers/Web/Email/EmailSendController.php View File

@@ -4,12 +4,14 @@ namespace App\Http\Controllers\Web\Email;

use App\Codes\Email;
use App\Email\BaseEmailer;
use App\Email\Members\ChangePlanOrderApprove;
use App\Email\Members\EntryApprove;
use App\Email\Members\EntryPaymentComplete;
use App\Email\Members\TerminateOrderApprove;
use App\Email\Members\UserInfoUpdateOrderApprove;
use App\Email\Members\VehicleInfoUpdateOrderApprove;
use App\Http\Controllers\Web\FromKintoneController;
use App\Kintone\Models\ChangePlanApplication;
use App\Kintone\Models\SeasonTicketContract;
use App\Kintone\Models\SeasonTicketContractEntry;
use App\Kintone\Models\TerminateApplication;
@@ -54,6 +56,10 @@ class EmailSendController extends FromKintoneController
if ($this->emailManager === null) {
throw new LogicException("EmailManager不正");
}


info(sprintf("Email送信依頼受信 %s [%s]", $this->param->emailId->value, json_encode($request->toArray())));

$this->emailManager->confirm();
} catch (Exception $e) {
LoggingUtil::debugException($e);
@@ -100,6 +106,12 @@ class EmailSendController extends FromKintoneController
$this->setEmail(new EntryPaymentComplete($parking, $entry, $plan));
return;
}
if ($emailId === Email::CHANGE_PLAN_ORDER_APPROVE) {
$application = ChangePlanApplication::findByApplicationNo($this->param->applicationNo);
$seasonTicketContract = SeasonTicketContract::find($application->seasonTicketContractRecordNo);
$this->setEmail(new ChangePlanOrderApprove($seasonTicketContract, $application));
return;
}


if ($this->email === null || $this->emailManager === null) {


+ 1
- 1
app/Http/Controllers/Web/SeasonTicketContract/ChangePlanOrderOptionsController.php View File

@@ -47,7 +47,7 @@ class ChangePlanOrderOptionsController extends WebController

$ret = [];
foreach ($plan->canChangePlanNameList as $planName) {
$ret[] = $planName->planName;
$ret[$planName->planName] = SeasonTicketContractPlan::findByName($planName->planName)->showPlanName;
}

return $this->successResponse($ret);


+ 4
- 0
app/Kintone/Models/SeasonTicketContractPlan.php View File

@@ -8,6 +8,7 @@ use Illuminate\Support\Collection;
/**
* アプリ名 定期駐車場プランマスタ
* @property string planName
* @property string showPlanName
* @property string parkingName
* @property string[] sendItem
* @property string vehicleType
@@ -20,6 +21,7 @@ class SeasonTicketContractPlan extends KintoneModel
const CONFIG_KEY = "KINTONE_APP_SEASON_TICKET_CONTRACT_PLAN";

const FIELD_PLAN_NAME = "key";
const FIELD_SHOW_PLAN_NAME = "利用者へ表示するプラン名";
const FIELD_PARKING_NAME = "定期_駐車場名";
const FIELD_SEND_ITEM = "送付物";
const FIELD_VEHICLE_TYPE = "種別";
@@ -31,6 +33,8 @@ class SeasonTicketContractPlan extends KintoneModel

protected const FIELDS = [
...parent::FIELDS,
self::FIELD_PLAN_NAME => FieldType::SINGLE_LINE_TEXT,
self::FIELD_SHOW_PLAN_NAME => FieldType::SINGLE_LINE_TEXT,
self::FIELD_PARKING_NAME => FieldType::SINGLE_LINE_TEXT,
self::FIELD_SEND_ITEM => FieldType::CHECK_BOX,
self::FIELD_VEHICLE_TYPE => FieldType::SINGLE_LINE_TEXT,


+ 19
- 0
resources/views/emails/members/change_plan_order_approve.blade.php View File

@@ -0,0 +1,19 @@
@extends('emails.layouts.member')

@section('contents')
以下の内容でプラン変更手続きが完了いたしました。

-------------------------------------------------------------------------------------
■申込内容■
◆駐車場
{{ $parking_name }}

◆氏名
{{ $customer_name }}

◆変更先プラン
{{ $plan_name }}

◆備考
{{ $memo }}
@endsection

+ 17
- 1
resources/views/emails/members/change_plan_order_notice.blade.php View File

@@ -1,5 +1,21 @@
@extends('emails.layouts.member')

@section('contents')
プラン変更申請を受け付けました
こちらのメールは【自動返信】メールです。
内容を確認後、プラン更完了メールを送付いたします。
土日祝・年末年始を除き 4 営業日後までに連絡が無い場合には、お手数ですが下記連絡先までお問い合わせ下さい。

-------------------------------------------------------------------------------------
■申込内容■
◆駐車場
{{ $parking_name }}

◆氏名
{{ $customer_name }}

◆変更先プラン
{{ $plan_name }}

◆備考
{{ $memo }}
@endsection

BIN
設計書/メール一覧.xlsx View File


Loading…
Cancel
Save