Merge branch 'master' of itcorp.primaya.id:rajif/aso

This commit is contained in:
R
2023-04-06 17:23:46 +07:00
1500 changed files with 2985 additions and 2616 deletions

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

@@ -4,6 +4,7 @@ namespace Modules\Client\Http\Controllers\Api;
use App\Helpers\Helper;
use App\Models\Claim;
use App\Services\ClaimService;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
@@ -11,6 +12,24 @@ use Modules\Client\Transformers\ClaimShowResource;
class ClaimController extends Controller
{
public function __construct(public ClaimService $claimService)
{
}
public function status($corporate_id)
{
$claims = $this->claimService->getCountClaimRequestPerStatus($corporate_id);
dd($claims);
return Helper::responseJson([
'count_requested' => 0,
'count_approval' => 0,
'count_disbrushment' => 0,
'count_rejected' => 0,
]);
}
/**
* Display a listing of the resource.
* @return Renderable
@@ -18,8 +37,8 @@ class ClaimController extends Controller
public function index(Request $request, $corporate_id)
{
$claims = Claim::query()
->when($request->search ?? null, function($query, $search) {
$query->where('code', 'LIKE', '%'.$search.'%');
->when($request->search ?? null, function ($query, $search) {
$query->where('code', 'LIKE', '%' . $search . '%');
})
->with([
'member',
@@ -27,7 +46,7 @@ class ClaimController extends Controller
return $diagnosis->where('type', 'primary');
},
'diagnoses.icd',
'plan',
'plan',
'benefit',
'claimRequest',
'claimRequest.service'
@@ -65,8 +84,8 @@ class ClaimController extends Controller
{
$claim = Claim::query()
->with([
'member',
'member.currentPlan',
'member',
'member.currentPlan',
'member.currentPlan.benefits',
'member.currentCorporate',
'member.currentPolicy',
@@ -78,7 +97,7 @@ class ClaimController extends Controller
'claimRequest.files',
'items',
'items.claim_itemable',
])
])
->findOrFail($id);
return Helper::responseJson(ClaimShowResource::make($claim));

View File

View File

View File

@@ -7,7 +7,8 @@ use App\Services\CorporateMemberService;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Modules\Client\Transformers\Dashboard\MemberResources;
use Modules\Client\Transformers\ClaimReport\MemberResources as ClaimReportMemberResources;
use Modules\Client\Transformers\Dashboard\MemberResources as DashboardMemberResources;
class CorporateMemberController extends Controller
{
@@ -21,68 +22,16 @@ class CorporateMemberController extends Controller
*/
public function index(Request $request, $corporate_id)
{
$members = $this->corporateMemberService->getAllDashboardMembers($corporate_id, $request);
return response()->json(Helper::paginateResources(MemberResources::collection($members)));
}
/**
* 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
* @return Renderable
*/
public function store(Request $request)
{
//
}
/**
* Show the specified resource.
* @param int $id
* @return Renderable
*/
public function show($id)
{
return view('client::show');
}
/**
* Show the form for editing the specified resource.
* @param int $id
* @return Renderable
*/
public function edit($id)
{
return view('client::edit');
}
/**
* 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)
{
//
switch ($request->input('type')) {
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

8
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;
/*
|--------------------------------------------------------------------------
@@ -35,10 +36,13 @@ Route::prefix('client')->group(function () {
Route::get('policy', [CorporatePolicyController::class, 'index']);
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

@@ -0,0 +1,26 @@
<?php
namespace Modules\Client\Transformers\ClaimReport;
use Illuminate\Http\Resources\Json\JsonResource;
class MemberResources extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'memberId' => $this->member_id,
'fullName' => $this->full_name,
'division' => $this->division_name ?? '',
'submission_date' => '',
'status' => $this->active,
];
}
}

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

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

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

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

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