You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1KB

  1. <?php
  2. namespace App\Http\Controllers\Web\QRService\Group;
  3. use App\Http\Controllers\Web\WebController;
  4. use App\Logics\QRService\QRServiceParkingGroupLogic;
  5. use App\Models\HtpmsCustomer\QRService\ServiceParkingGroup;
  6. use App\Repositories\QRServiceParkingGroupRepository;
  7. use Illuminate\Http\JsonResponse;
  8. use Illuminate\Http\Request;
  9. class QRServiceGroupRegisterController extends WebController
  10. {
  11. public function name(): string
  12. {
  13. return "QRサービス券駐車場グループ新規登録";
  14. }
  15. public function description(): string
  16. {
  17. return "QRサービス券駐車場グループを新規登録する";
  18. }
  19. public function __construct(protected QRServiceGroupRegisterParam $param, private QRServiceParkingGroupRepository $repository)
  20. {
  21. parent::__construct();
  22. }
  23. protected function run(Request $request): JsonResponse
  24. {
  25. $param = $this->param;
  26. $group = new ServiceParkingGroup();
  27. $group->name = $param->name;
  28. QRServiceParkingGroupLogic::register($group);
  29. $res = [
  30. 'id' => $group->id,
  31. ];
  32. return $this->successResponse($res);
  33. }
  34. }