領収証発行サービス
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 line
969B

  1. <?php
  2. namespace App\Http\Controllers\Web\Auth;
  3. use App\Codes\UserRole;
  4. use App\Features\LoginUser;
  5. use App\Http\Controllers\Web\WebController;
  6. use Illuminate\Http\JsonResponse;
  7. use Illuminate\Http\Request;
  8. class ChangeContractController extends WebController
  9. {
  10. use Me, LoginUser;
  11. public function name(): string
  12. {
  13. return "成り代わり";
  14. }
  15. public function description(): string
  16. {
  17. return "成り代わりを開始する";
  18. }
  19. public function __construct(protected ChangeContractParam $param)
  20. {
  21. parent::__construct();
  22. $this->roleAllow(UserRole::SUPER_ADMIN);
  23. }
  24. protected function run(Request $request): JsonResponse
  25. {
  26. $param = $this->param;
  27. $this->loginUser()->setCurrentContractId($param->contractId);
  28. $me = $this->me();
  29. if ($me !== null) {
  30. return $this->successResponse($me);
  31. }
  32. return $this->failedResponse();
  33. }
  34. }