feat(packages): implement package-based business model

This commit is contained in:
Codex Agent
2025-09-26 22:13:56 +02:00
parent 6fc36ebaf4
commit 0a643c3e4d
54 changed files with 3301 additions and 282 deletions

View File

@@ -50,4 +50,32 @@ class Event extends Model
return $this->belongsToMany(Task::class, 'event_task', 'event_id', 'task_id')
->withTimestamps();
}
public function eventPackage(): BelongsTo
{
return $this->belongsTo(EventPackage::class);
}
public function hasActivePackage(): bool
{
return $this->eventPackage && $this->eventPackage->isActive();
}
public function getPackageLimits(): array
{
if (!$this->hasActivePackage()) {
return [];
}
return $this->eventPackage->package->limits;
}
public function canUploadPhoto(): bool
{
if (!$this->hasActivePackage()) {
return false;
}
return $this->eventPackage->canUploadPhoto();
}
}