implemented step 07

- added categories for 1. step in wizard
This commit is contained in:
2026-06-12 19:01:34 +02:00
parent b4960c4e39
commit 0e0670574d
6 changed files with 388 additions and 9 deletions

View File

@ -120,4 +120,29 @@ class ProjectActions
return $projectData;
}
/**
* Saves data for a specific wizard step.
*/
public function saveStep(string $userId, string $projectId, int $step, array $data): bool
{
$projectPath = "projects/{$projectId}.json";
$projectData = $this->getProjectStatus($userId, $projectId);
switch ($step) {
case 1:
if (!isset($data['business_category'])) {
throw new Exception("Missing business_category data.", 400);
}
$projectData['wizard_data']['business_category'] = $data['business_category'];
break;
// More steps will be added later
}
$projectData['current_step'] = max($projectData['current_step'], $step + 1);
$projectData['updated_at'] = date('c');
return $this->storage->put($projectPath, $projectData);
}
}