Revert "Merge pull request 'KAN-11 Move remaining project metadata ownership to templates' (#94) from koda/kan-11-restliche-projekt-konfiguration-auf-templates-umstellen into epic/kan-3"
linter / quality (pull_request) Successful in 1m31s
tests / ci (8.4) (pull_request) Successful in 1m44s

This reverts commit d39d21d303, reversing
changes made to a8952d7867.
This commit is contained in:
2026-06-24 00:29:04 +02:00
parent 7171f75845
commit 634b78904b
26 changed files with 45 additions and 473 deletions
+11 -13
View File
@@ -27,13 +27,6 @@ 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);
@@ -57,14 +50,19 @@ class CreateProject
$project,
$template->configuration_snapshot ?? [],
);
$project->forceFill([
'project_template_id' => $template->id,
])->save();
}
$baseTemplate->forceFill([
'configuration_snapshot' => $this->duplicateProjectConfiguration->export(
$project->fresh() ?? $project,
DuplicateProjectConfiguration::copyableAreas(),
),
])->save();
if ($project->project_template_id === null) {
$baseTemplate = $this->createProjectBaseTemplate->handle($project->fresh() ?? $project);
$project->forceFill([
'project_template_id' => $baseTemplate->id,
])->save();
}
return $project->fresh() ?? $project;
});