Change Permission & WIP Dashboard Client Portal
This commit is contained in:
@@ -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
|
||||
],
|
||||
|
||||
@@ -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)
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user