領収証発行サービス
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\Custom\HelloTechno;
  3. use App\Codes\Custom;
  4. use App\Codes\UserRole;
  5. use App\Http\Controllers\Web\IParam;
  6. use App\Http\Controllers\Web\WebController;
  7. use App\Util\Custom\HelloTechno\API;
  8. use Illuminate\Http\JsonResponse;
  9. use Illuminate\Http\Request;
  10. class CustomersController extends WebController
  11. {
  12. public function name(): string
  13. {
  14. return "[HelloTechno専用]顧客情報取得";
  15. }
  16. public function description(): string
  17. {
  18. return "[HelloTechno専用]顧客情報を取得する";
  19. }
  20. public function __construct(
  21. protected CustomersParam $param,
  22. ) {
  23. $this->middleware('auth:sanctum');
  24. $this->roleAllow(UserRole::NORMAL_ADMIN);
  25. $this->customAllow = [Custom::HELLO_TECHNO];
  26. }
  27. protected function getParam(): IParam
  28. {
  29. return $this->param;
  30. }
  31. protected function run(Request $request): JsonResponse
  32. {
  33. $param = $this->param;
  34. $list = API::getCustomers($param->customerCode);
  35. return $this->successResponse(['records' => $list]);
  36. }
  37. }