Add Plan Limit & Usage

This commit is contained in:
R
2023-02-23 09:41:58 +07:00
parent 74cfcfa16b
commit eb1211cde7
2 changed files with 12 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Resources\OLDLMS;
use App\Services\ClaimService;
use Illuminate\Http\Resources\Json\JsonResource;
class MemberResource extends JsonResource
@@ -27,16 +28,18 @@ class MemberResource extends JsonResource
'plan' => $currentMemberPlan ? [
'code' => $currentMemberPlan->plan->code ?? null,
'start' => $currentMemberPlan->start,
'end' => $currentMemberPlan->end
'end' => $currentMemberPlan->end,
'limit' => $this->currentPlan->limit_rules
] : null,
'policy_code' => $this->currentPolicy->code,
'policy_code' => $this->currentPolicy?->code ?? null,
'corporate' => [
'code' => $this->currentPolicy->corporate->code,
'name' => $this->currentPolicy->corporate->name,
'welcome_message' => $this->currentPolicy->corporate->welcome_message,
'help_text' => $this->currentPolicy->corporate->help_text,
'avatar_url' => $this->currentpolicy->corporate->avatar_url
]
'code' => $this->currentPolicy?->corporate->code ?? null,
'name' => $this->currentPolicy?->corporate->name,
'welcome_message' => $this->currentPolicy?->corporate?->welcome_message,
'help_text' => $this->currentPolicy?->corporate?->help_text,
'avatar_url' => $this->currentpolicy?->corporate?->avatar_url
],
'limit_usage' => $this->totalUsage ?? null
];
return $data;
}