Merge pull request 'kan-11' (#99) from koda/kan-11-restliche-projekt-konfiguration-auf-templates-umstellen into epic/kan-3
linter / quality (pull_request) Successful in 1m36s
tests / ci (8.4) (pull_request) Failing after 1m51s

Reviewed-on: OpenSource/KanbanGit#99
This commit was merged in pull request #99.
This commit is contained in:
2026-06-23 22:41:16 +00:00
26 changed files with 473 additions and 45 deletions
+13 -11
View File
@@ -27,6 +27,13 @@ class CreateProject
{
return DB::transaction(function () use ($attributes, $actor): Project {
$project = Project::query()->create(Arr::only($attributes, ['key', 'name']));
$baseTemplate = $this->createProjectBaseTemplate->handle($project);
$project->forceFill([
'project_template_id' => $baseTemplate->id,
])->save();
$project = $project->fresh() ?? $project;
$this->initializeProjectTicketMetadata->handle($project);
$this->permissionService->grant($actor, Permission::ProjectAdmin, $project);
@@ -50,19 +57,14 @@ class CreateProject
$project,
$template->configuration_snapshot ?? [],
);
$project->forceFill([
'project_template_id' => $template->id,
])->save();
}
if ($project->project_template_id === null) {
$baseTemplate = $this->createProjectBaseTemplate->handle($project->fresh() ?? $project);
$project->forceFill([
'project_template_id' => $baseTemplate->id,
])->save();
}
$baseTemplate->forceFill([
'configuration_snapshot' => $this->duplicateProjectConfiguration->export(
$project->fresh() ?? $project,
DuplicateProjectConfiguration::copyableAreas(),
),
])->save();
return $project->fresh() ?? $project;
});