|
@@ -357,6 +357,28 @@ class ProjectController extends Controller
|
|
|
return $this->noContent();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public function done(PostponeRequest $request, string $id)
|
|
|
+ {
|
|
|
+ $isAction=true;
|
|
|
+ $project = Project::allowed($id,$isAction)->find($id);
|
|
|
+ if($project===null||is_null($project)){
|
|
|
+ return $this->badRequest('Permission denied or project not found. Please contact the administrator.');
|
|
|
+ };
|
|
|
+
|
|
|
+ $project->status = ProjectStatus::DONE->value;
|
|
|
+ $changes = ModelChangeDetector::detector(ActionObjectType::PROJECT, $project);
|
|
|
+ $project->save();
|
|
|
+
|
|
|
+ ActionRepository::createByProject(
|
|
|
+ $project, ObjectAction::DONE,
|
|
|
+ $request->comment?(new \App\Services\File\ImageUrlService)->interceptImageUrl($request->comment) : null,
|
|
|
+ objectChanges: $changes
|
|
|
+ );
|
|
|
+
|
|
|
+ return $this->noContent();
|
|
|
+ }
|
|
|
+
|
|
|
public function linkRequirement(LinkRequirementRequest $request, string $id)
|
|
|
{
|
|
|
$requirementIds = $request->get("requirement_id",[]);
|