implemented step 07
- added categories for 1. step in wizard
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user