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

51 lines
1.3KB

  1. <?php
  2. namespace App\Http\Controllers\Web\Custom\HelloTechno;
  3. use App\Http\Controllers\Web\IParam;
  4. use App\Http\Controllers\Web\WebController;
  5. use App\Logic\ReceiptIssuingOrder\Custom\HelloTechno\PDFDownLoadManagerHelloTechno;
  6. use App\Logic\ReceiptIssuingOrder\UpdateManager;
  7. use App\Util\DateUtil;
  8. use Illuminate\Http\Request;
  9. use Illuminate\Http\Response;
  10. class DownloadLetterController extends WebController
  11. {
  12. public function name(): string
  13. {
  14. return "領収証PDFダウンロード";
  15. }
  16. public function description(): string
  17. {
  18. return "領収証PDFダウンロードする";
  19. }
  20. public function __construct(
  21. protected DownloadLetterParam $param,
  22. private UpdateManager $updateManager,
  23. private PDFDownLoadManagerHelloTechno $pdfManager,
  24. ) {
  25. parent::__construct();
  26. }
  27. protected function getParam(): IParam
  28. {
  29. return $this->param;
  30. }
  31. protected function run(Request $request): Response
  32. {
  33. $param = $this->param;
  34. // 投函日の登録
  35. $today = DateUtil::now();
  36. $this->updateManager->initById($param->id)
  37. ->mailPosted($today)
  38. ->update();
  39. return $this->pdfManager->initById($param->id)->downlaodLetter();
  40. }
  41. }