Change Permission & WIP Dashboard Client Portal

This commit is contained in:
Fajar
2023-04-06 15:30:22 +07:00
parent 4a7c3ebdda
commit 85039893a8
1497 changed files with 2808 additions and 2508 deletions

0
.editorconfig Executable file → Normal file
View File

0
.env.example Executable file → Normal file
View File

0
.gitattributes vendored Executable file → Normal file
View File

0
.gitignore vendored Executable file → Normal file
View File

0
.styleci.yml Executable file → Normal file
View File

0
Modules/Client/Config/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Config/config.php Executable file → Normal file
View File

0
Modules/Client/Console/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Database/Migrations/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Database/Seeders/.gitkeep Executable file → Normal file
View File

View File

0
Modules/Client/Database/factories/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Entities/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Http/Controllers/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Http/Controllers/Api/AuthController.php Executable file → Normal file
View File

View File

View File

View File

@@ -26,6 +26,9 @@ class CorporateMemberController extends Controller
case 'claim-report':
$members = $this->corporateMemberService->getAllMemberClaimReports($corporate_id, $request);
return response()->json(Helper::paginateResources(ClaimReportMemberResources::collection($members)));
case 'claim-submit':
$members = $this->corporateMemberService->getAllMemberClaimReports($corporate_id, $request);
return response()->json(Helper::paginateResources(ClaimReportMemberResources::collection($members)));
default:
$members = $this->corporateMemberService->getAllMemberDashboards($corporate_id, $request);
return response()->json(Helper::paginateResources(DashboardMemberResources::collection($members)));

View File

@@ -15,7 +15,7 @@ class CorporatePolicyController extends Controller
* Display a listing of the resource.
* @return Renderable
*/
public function index(Request $request, $corporate_id)
public function index($corporate_id)
{
$currentCorporate = Auth::user()->managedCorporates()
->with(['currentPolicy', 'employees'])
@@ -26,15 +26,6 @@ class CorporatePolicyController extends Controller
return Helper::responseJson($data);
}
/**
* Show the form for creating a new resource.
* @return Renderable
*/
public function create()
{
return view('client::create');
}
/**
* Store a newly created resource in storage.
* @param Request $request

View File

@@ -0,0 +1,71 @@
<?php
namespace Modules\Client\Http\Controllers\Api;
use App\Helpers\Helper;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth;
use Modules\Client\Transformers\Dashboard\TopUpLimitResources;
class TopUpController extends Controller
{
/**
* Display a listing of the resource.
* @return Renderable
*/
public function index($corporate_id)
{
$data = Auth::user()
->managedCorporates()
->with(['currentPolicy', 'employees'])
->withCount(['employees', 'claims' => function ($query) {
$query->where('claims.status', 'paid');
}])
->find($corporate_id);
return Helper::responseJson(TopUpLimitResources::make($data));
}
/**
* Store a newly created resource in storage.
* @param Request $request
* @return Renderable
*/
public function store(Request $request)
{
//
}
/**
* Show the specified resource.
* @param int $id
* @return Renderable
*/
public function show($id)
{
return view('client::show');
}
/**
* Update the specified resource in storage.
* @param Request $request
* @param int $id
* @return Renderable
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
* @param int $id
* @return Renderable
*/
public function destroy($id)
{
//
}
}

0
Modules/Client/Http/Controllers/Api/UserController.php Executable file → Normal file
View File

0
Modules/Client/Http/Controllers/ClientController.php Executable file → Normal file
View File

0
Modules/Client/Http/Middleware/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Http/Requests/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Providers/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Providers/ClientServiceProvider.php Executable file → Normal file
View File

0
Modules/Client/Providers/RouteServiceProvider.php Executable file → Normal file
View File

0
Modules/Client/Resources/assets/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Resources/assets/js/app.js Executable file → Normal file
View File

0
Modules/Client/Resources/assets/sass/app.scss Executable file → Normal file
View File

0
Modules/Client/Resources/lang/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Resources/views/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Resources/views/index.blade.php Executable file → Normal file
View File

View File

0
Modules/Client/Routes/.gitkeep Executable file → Normal file
View File

5
Modules/Client/Routes/api.php Executable file → Normal file
View File

@@ -7,6 +7,7 @@ use Modules\Client\Http\Controllers\Api\CorporateMemberController;
use Modules\Client\Http\Controllers\Api\CorporatePolicyController;
use Modules\Client\Http\Controllers\Api\UserController;
use Modules\Client\Http\Controllers\Api\ClaimController;
use Modules\Client\Http\Controllers\Api\TopUpController;
/*
|--------------------------------------------------------------------------
@@ -36,8 +37,10 @@ Route::prefix('client')->group(function () {
Route::get('division', [CorporateDivisionController::class, 'index']);
Route::get('members', [CorporateMemberController::class, 'index']);
Route::get('claims/status', [ClaimController::class, 'status']);
Route::get('claims', [ClaimController::class, 'index']);
Route::get('topup', [TopUpController::class, 'index']);
Route::post('topup', [TopUpController::class, 'store']);
});
Route::get('claims/{id}', [ClaimController::class, 'show']);

0
Modules/Client/Routes/web.php Executable file → Normal file
View File

0
Modules/Client/Tests/Feature/.gitkeep Executable file → Normal file
View File

0
Modules/Client/Tests/Unit/.gitkeep Executable file → Normal file
View File

View File

@@ -20,7 +20,7 @@ class MemberResources extends JsonResource
'fullName' => $this->full_name,
'division' => $this->division_name ?? '',
'limit' => [
'current' => $this->claims_sum_total_claim,
'current' => $this->claims_sum_total_claim ?? 0,
'total' => $this->currentPlan->limit_rules ?? 0,
'percentage' => (!empty($this->currentPlan->limit_rules ?? 0)) ? (($this->claims_sum_total_claim / $this->currentPlan->limit_rules) * 100) : 0
],

View File

@@ -0,0 +1,33 @@
<?php
namespace Modules\Client\Transformers\Dashboard;
use Illuminate\Http\Resources\Json\JsonResource;
class TopUpLimitResources extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
$myLimitBalance = (int)$this->currentPolicy->limit_balance;
$myLimitTotal = (int)$this->currentPolicy->total_premi;
return [
'companyName' => $this->name,
'policyNumber' => $this->currentPolicy->code,
'totalMembers' => $this->employees_count,
'totalCases' => $this->claims_count,
'myLimit' => [
'balance' => $myLimitBalance,
'total' => $myLimitTotal,
'percentage' => $myLimitTotal ? round(($myLimitBalance / $myLimitTotal) * 100, 2) : 0,
],
'maxTopUp' => ($myLimitTotal - $myLimitBalance)
];
}
}

0
Modules/Client/composer.json Executable file → Normal file
View File

0
Modules/Client/module.json Executable file → Normal file
View File

0
Modules/Client/package.json Executable file → Normal file
View File

0
Modules/Client/webpack.mix.js Executable file → Normal file
View File

View File

0
Modules/Internal/Config/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Config/config.php Executable file → Normal file
View File

0
Modules/Internal/Console/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Database/Migrations/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Database/Seeders/.gitkeep Executable file → Normal file
View File

View File

0
Modules/Internal/Database/factories/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Entities/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Http/Controllers/.gitkeep Executable file → Normal file
View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

0
Modules/Internal/Http/Middleware/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Http/Requests/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Providers/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Providers/InternalServiceProvider.php Executable file → Normal file
View File

0
Modules/Internal/Providers/RouteServiceProvider.php Executable file → Normal file
View File

0
Modules/Internal/Resources/assets/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Resources/assets/js/app.js Executable file → Normal file
View File

0
Modules/Internal/Resources/assets/sass/app.scss Executable file → Normal file
View File

0
Modules/Internal/Resources/lang/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Resources/views/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Resources/views/index.blade.php Executable file → Normal file
View File

View File

0
Modules/Internal/Routes/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Routes/api.php Executable file → Normal file
View File

0
Modules/Internal/Routes/web.php Executable file → Normal file
View File

0
Modules/Internal/Services/CorporateService.php Executable file → Normal file
View File

0
Modules/Internal/Services/ExclusionService.php Executable file → Normal file
View File

0
Modules/Internal/Services/FormulariumService.php Executable file → Normal file
View File

0
Modules/Internal/Services/MemberEnrollmentService.php Executable file → Normal file
View File

0
Modules/Internal/Tests/Feature/.gitkeep Executable file → Normal file
View File

0
Modules/Internal/Tests/Unit/.gitkeep Executable file → Normal file
View File

View File

View File

View File

0
Modules/Internal/composer.json Executable file → Normal file
View File

0
Modules/Internal/module.json Executable file → Normal file
View File

0
Modules/Internal/package.json Executable file → Normal file
View File

0
Modules/Internal/webpack.mix.js Executable file → Normal file
View File

0
Modules/Linksehat/Config/.gitkeep Executable file → Normal file
View File

0
Modules/Linksehat/Config/config.php Executable file → Normal file
View File

Some files were not shown because too many files have changed in this diff Show More