Browse Source

feat: add endpoint calculate project actual progress

pull/11/head
wahyun 5 months ago
parent
commit
1bb2f02341
  1. 14
      app/Http/Controllers/ProjectController.php
  2. 1
      routes/web.php

14
app/Http/Controllers/ProjectController.php

@ -292,7 +292,6 @@ class ProjectController extends Controller
$countBuilder = $dataBuilder['count'];
$dataGet = $builder->get();
$totalRecord = $countBuilder->count();
Artisan::call('calculate:ActualProgressProject');
return response()->json(['status' => 'success', 'code' => 200, 'data' => $dataGet, 'totalRecord' => $totalRecord], 200);
}
@ -438,17 +437,12 @@ class ProjectController extends Controller
Artisan::call('calculate:scurve', [
'project_id' => $request->project_id
]);
// $project = Project::find($request->project_id);
// if ($project) {
// dispatch(new ProcessSCurve($project));
// return response()->json(['message' => 'S Curve calculation queued']);
// }
// return response()->json(['message' => 'Project not found'], 404);
}
public function ActualProgressProjectCommand() {
Artisan::call('calculate:ActualProgressProject');
}
public function getLinearSCurve(Request $request)
{
$data = MasterFunctionsHelper::getLinearSCurve($request);

1
routes/web.php

@ -93,6 +93,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->post('/project/get-s-curve', 'ProjectController@getSCurve');
$router->post('/project/calculate-s-curve', 'ProjectController@calculateSCurve');
$router->post('/project/s-curve-command', 'ProjectController@sCurveCommand');
$router->get('/project/actual-progress-project-command', 'ProjectController@ActualProgressProjectCommand');
$router->post('/project/s-curve-command-test', 'ProjectController@calculateSCurvetest');
$router->post('/project/get-linear-s-curve', 'ProjectController@getLinearSCurve');
$router->post('/project/get-overdue-activities', 'ProjectController@getOverdueActivities');

Loading…
Cancel
Save