Generische iCal-Kanäle mit Bestandsklärung und sicheren Exporten bereitstellen
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m33s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m33s
This commit is contained in:
1 parent
6fe5bbc6e3
commit
783068501c
42 files changed
+2646
-248
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Availability\AvailabilityChecker;
|
||||
use App\Enums\ChannelTaskAction;
|
||||
use App\Enums\ChannelTaskStatus;
|
||||
use App\Models\Concerns\BelongsToTenant;
|
||||
@@ -61,6 +62,14 @@ protected function open(Builder $query): Builder
|
||||
|
||||
public function complete(string $completedBy): void
|
||||
{
|
||||
if ($this->status !== ChannelTaskStatus::Open) {
|
||||
return;
|
||||
}
|
||||
if ($this->action === ChannelTaskAction::Unblock && ! app(AvailabilityChecker::class)->isAvailable($this->channel->property, $this->starts_on, $this->ends_on)) {
|
||||
$this->update(['status' => ChannelTaskStatus::Dismissed, 'automation_error' => 'Aktuell belegt – Entsperraufgabe nicht mehr gültig.']);
|
||||
|
||||
return;
|
||||
}
|
||||
$this->update([
|
||||
'status' => ChannelTaskStatus::Done,
|
||||
'completed_by' => $completedBy,
|
||||
|
||||
Reference in new issue
Block a user