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

46 lines
1.2KB

  1. <?php
  2. namespace App\Logic\ReceiptIssuingOrder\Custom\HelloTechno;
  3. use App\Jobs\Other\Custom\HelloTechno\CacheParkingName;
  4. use App\Logic\ReceiptIssuingOrder\CreateManager as BaseManager;
  5. use App\Logic\SMS\SMSManager;
  6. use App\Models\ReceiptIssuingHTParkingCustomOrder;
  7. use App\Models\ReceiptIssuingOrder;
  8. class CreateManager extends BaseManager
  9. {
  10. public function __construct(
  11. ReceiptIssuingOrder $order,
  12. SMSManager $smsManager,
  13. private ReceiptIssuingHTParkingCustomOrder $customOrder,
  14. ) {
  15. parent::__construct($order, $smsManager);
  16. }
  17. public function fill(array $attr): static
  18. {
  19. $this->customOrder->fill($attr);
  20. return parent::fill($attr);
  21. }
  22. public function create(): array
  23. {
  24. $id = $this->id();
  25. $this->customOrder->setReceiptIssuingOrder($id);
  26. $this->customOrder->save();
  27. $messages = parent::create();
  28. if (count($messages) !== 0) {
  29. return $messages;
  30. }
  31. // 駐車場名キャッシュ
  32. CacheParkingName::dispatch($this->customOrder->customer_code, $this->customOrder->parking_management_code);
  33. return [];
  34. }
  35. }