領収証発行サービス
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 satır
1.1KB

  1. <?php
  2. namespace App\Logic\ReceiptIssuingOrder\Custom\HelloTechno;
  3. use App\Codes\ReceiptIssuingOrderStatus;
  4. use App\Codes\SMSSendPurpose;
  5. use App\Logic\ReceiptIssuingOrder\CreateManager as BaseManager;
  6. use App\Logic\SMS\SMSManager;
  7. use App\Models\ReceiptIssuingHTParkingCustomOrder;
  8. use App\Models\ReceiptIssuingOrder;
  9. use Illuminate\Support\Facades\View;
  10. use LogicException;
  11. class CreateManager
  12. {
  13. public function __construct(
  14. protected BaseManager $manager,
  15. private ReceiptIssuingHTParkingCustomOrder $customOrder,
  16. ) {
  17. }
  18. public function init(): static
  19. {
  20. $this->manager->init();
  21. return $this;
  22. }
  23. public function fill(array $attr): static
  24. {
  25. $this->manager->fill($attr);
  26. $this->customOrder->fill($attr);
  27. return $this;
  28. }
  29. public function create(): array
  30. {
  31. $messages = $this->manager->create();
  32. if (count($messages) !== 0) {
  33. return $messages;
  34. }
  35. $this->customOrder->setReceiptIssuingOrder($this->manager->id());
  36. $this->customOrder->save();
  37. return [];
  38. }
  39. }