feat: harden tenant settings and import pipeline

This commit is contained in:
2025-09-25 11:50:18 +02:00
parent b22d91ed32
commit 9248d7a3f5
29 changed files with 577 additions and 293 deletions

View File

@@ -11,21 +11,13 @@ class TaskCollection extends Model
use HasFactory;
protected $table = 'task_collections';
protected $fillable = [
'tenant_id',
'name',
'description',
];
protected $casts = [
'name' => 'array',
'description' => 'array',
];
/**
* Tasks in this collection
*/
public function tasks(): BelongsToMany
{
return $this->belongsToMany(
@@ -36,9 +28,6 @@ class TaskCollection extends Model
);
}
/**
* Events that use this collection
*/
public function events(): BelongsToMany
{
return $this->belongsToMany(
@@ -48,24 +37,5 @@ class TaskCollection extends Model
'event_id'
);
}
}
/**
* Get the localized name for the current locale
*/
public function getLocalizedNameAttribute(): string
{
$locale = app()->getLocale();
return $this->name[$locale] ?? $this->name['de'] ?? 'Unnamed Collection';
}
/**
* Get the localized description for the current locale
*/
public function getLocalizedDescriptionAttribute(): ?string
{
if (!$this->description) return null;
$locale = app()->getLocale();
return $this->description[$locale] ?? $this->description['de'] ?? null;
}
}