Eindeutige iCal-Kalenderspiegelungen automatisch und widerrufbar zuordnen
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m53s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m53s
This commit is contained in:
1 parent
8b36e07dc4
commit
add2367869
16 files changed
+540
-31
No files matched your search
@@ -32,7 +32,7 @@ class BlockedPeriod extends Model
|
||||
/** @use HasFactory<BlockedPeriodFactory> */
|
||||
use BelongsToTenant, HasChannelProvenance, HasFactory, SoftDeletes;
|
||||
|
||||
protected $attributes = ['is_representation' => false, 'export_approved' => true];
|
||||
protected $attributes = ['is_representation' => false, 'representation_automatic' => false, 'export_approved' => true];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
@@ -50,6 +50,7 @@ protected function casts(): array
|
||||
'needs_review' => 'boolean',
|
||||
'missing_imports' => 'integer',
|
||||
'is_representation' => 'boolean',
|
||||
'representation_automatic' => 'boolean',
|
||||
'export_approved' => 'boolean',
|
||||
'reviewed_at' => 'immutable_datetime',
|
||||
'ical_properties' => 'encrypted:array',
|
||||
@@ -119,6 +120,10 @@ public function guestName(): ?string
|
||||
|
||||
public function bookingChannelLabel(): string
|
||||
{
|
||||
if ($this->is_representation) {
|
||||
return $this->canonicalBlock?->bookingChannelLabel() ?? $this->linkedBooking?->bookingChannelLabel() ?? 'Führende Belegung nicht verfügbar';
|
||||
}
|
||||
|
||||
return $this->is_private ? 'Privat' : ($this->originChannel?->name ?? $this->channel?->name ?? ($this->source === 'manual' ? 'Eigene Sperre' : 'Ursprung unbekannt'));
|
||||
}
|
||||
|
||||
@@ -170,8 +175,9 @@ protected function unclear(Builder $query): Builder
|
||||
{
|
||||
return $query->whereIn('source', ['channel', 'email'])->where(fn (Builder $query) => $query
|
||||
->where('needs_review', true)
|
||||
->orWhere('occupation_kind', OccupationKind::Unknown)
|
||||
->orWhere(fn (Builder $query) => $query->whereNull('occupation_kind')->where(fn (Builder $query) => $query->whereNull('ical_event_type')->orWhere('ical_event_type', '!=', 'portal_reservation'))));
|
||||
->orWhere(fn (Builder $query) => $query->where('is_representation', false)->where(fn (Builder $query) => $query
|
||||
->where('occupation_kind', OccupationKind::Unknown)
|
||||
->orWhere(fn (Builder $query) => $query->whereNull('occupation_kind')->where(fn (Builder $query) => $query->whereNull('ical_event_type')->orWhere('ical_event_type', '!=', 'portal_reservation'))))));
|
||||
}
|
||||
|
||||
/** @param Builder<BlockedPeriod> $query
|
||||
|
||||
Reference in new issue
Block a user