|
- <?php
-
- namespace App\Logic\ReceiptIssuingOrder\Custom\HelloTechno;
-
- use App\Codes\ReceiptIssuingOrderStatus;
- use App\Codes\SMSSendPurpose;
- use App\Logic\ReceiptIssuingOrder\CreateManager as BaseManager;
- use App\Logic\SMS\SMSManager;
- use App\Models\ReceiptIssuingHTParkingCustomOrder;
- use App\Models\ReceiptIssuingOrder;
- use Illuminate\Support\Facades\View;
- use LogicException;
-
- 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();
-
- return [];
- }
- }
|