|
- <?php
-
- namespace App\Http\Controllers\Web\ReceiptIssuingOrder;
-
- use App\Codes\UserRole;
- use App\Http\Controllers\Web\IParam;
- use App\Http\Controllers\Web\WebController;
- use App\Logic\ReceiptIssuingOrder\CreateManager;
- use Illuminate\Http\JsonResponse;
- use Illuminate\Http\Request;
-
- class CreateController extends WebController
- {
- public function name(): string
- {
- return "領収証発行依頼新規作成";
- }
-
- public function description(): string
- {
- return "領収証発行依頼を新規作成する";
- }
-
- public function __construct(
- protected CreateParam $param,
- private CreateManager $manager
- ) {
- $this->middleware('auth:sanctum');
- $this->roleAllow(UserRole::NORMAL_ADMIN);
- }
-
- protected function getParam(): IParam
- {
- return $this->param;
- }
-
- protected function run(Request $request): JsonResponse
- {
- $param = $this->param;
-
- $this->manager->init()
- ->fill($param->toArray())
- ->create();
-
-
- return $this->successResponse();
- }
- }
|