Support oft parent groups

This commit is contained in:
2026-09-29 14:35:33 +02:00
parent c4ca101594
commit a5e4e55df5
86 changed files with 1936 additions and 80 deletions
@@ -2,6 +2,8 @@
namespace App\Domains\Admin\Actions\UpdateTenantGeneral;
use App\Enumerations\ParticipantGroupType;
class UpdateTenantGeneralAction
{
public function __construct(private UpdateTenantGeneralRequest $request)
@@ -12,10 +14,17 @@ class UpdateTenantGeneralAction
{
$response = new UpdateTenantGeneralResponse();
if ($this->request->parentGroup === null) {
$response->message = sprintf('Bitte bei „%s" eine Auswahl treffen.', ParticipantGroupType::ParentGroup->label());
return $response;
}
$this->request->tenant->update([
'name' => $this->request->name,
'slug' => $this->request->slug,
'url' => $this->request->url,
'parent_group_id' => $this->request->parentGroup->id,
]);
$response->success = true;
@@ -2,6 +2,7 @@
namespace App\Domains\Admin\Actions\UpdateTenantGeneral;
use App\Models\ParentGroup;
use App\Models\Tenant;
class UpdateTenantGeneralRequest
@@ -11,6 +12,8 @@ class UpdateTenantGeneralRequest
public string $name,
public string $slug,
public string $url,
/** Pflicht; null heißt, die übermittelte ID war unbekannt. */
public ?ParentGroup $parentGroup,
) {
}
}