|
- <?php
-
- namespace App\Logic\ReceiptIssuingOrder\Custom\HelloTechno;
-
- use App\Jobs\Other\Custom\HelloTechno\CacheParkingName;
- use App\Logic\ReceiptIssuingOrder\CreateManager as BaseManager;
- use App\Models\ReceiptIssuingHTParkingCustomOrder;
-
- class CreateManager
- {
-
- public function __construct(
- protected BaseManager $manager,
- private ReceiptIssuingHTParkingCustomOrder $customOrder,
- ) {
- }
-
- public function init(): static
- {
- $this->manager->init();
- return $this;
- }
-
- public function fill(array $attr): static
- {
- $this->manager->fill($attr);
- $this->customOrder->fill($attr);
-
- return $this;
- }
-
- public function create(): array
- {
- $messages = $this->manager->create();
-
- if (count($messages) !== 0) {
- return $messages;
- }
-
- $this->customOrder->setReceiptIssuingOrder($this->manager->id());
- $this->customOrder->save();
-
-
- // 駐車場名キャッシュ
- CacheParkingName::dispatch($this->customOrder->customer_code, $this->customOrder->parking_management_code);
-
-
- return [];
- }
- }
|