|
- <?php
-
- namespace App\Http\Controllers\Web\QRService\Group;
-
- use App\Http\Controllers\Web\WebController;
- use App\Logics\QRService\QRServiceParkingGroupLogic;
- use App\Models\HtpmsCustomer\QRService\ServiceParkingGroup;
- use App\Repositories\QRServiceParkingGroupRepository;
- use Illuminate\Http\JsonResponse;
- use Illuminate\Http\Request;
-
- class QRServiceGroupRegisterController extends WebController
- {
-
- public function name(): string
- {
- return "QRサービス券駐車場グループ新規登録";
- }
-
- public function description(): string
- {
- return "QRサービス券駐車場グループを新規登録する";
- }
-
-
- public function __construct(protected QRServiceGroupRegisterParam $param, private QRServiceParkingGroupRepository $repository)
- {
- parent::__construct();
- }
-
- protected function run(Request $request): JsonResponse
- {
- $param = $this->param;
-
- $group = new ServiceParkingGroup();
- $group->name = $param->name;
- QRServiceParkingGroupLogic::register($group);
-
-
- $res = [
- 'id' => $group->id,
- ];
-
- return $this->successResponse($res);
- }
- }
|