[WIP] Claims
This commit is contained in:
27
app/Services/ClaimService.php
Normal file
27
app/Services/ClaimService.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Claim;
|
||||
use App\Models\Icd;
|
||||
use Str;
|
||||
|
||||
class ClaimService{
|
||||
|
||||
public function storeClaim($member, $icd, $benefit, $totalClaim)
|
||||
{
|
||||
$claim = Claim::create([
|
||||
'code' => Str::random('16'),
|
||||
'member_id' => $member->id,
|
||||
'diagnosis_id' => $icd,
|
||||
'total_claim' => $totalClaim,
|
||||
'currency' => 'IDR',
|
||||
'plan_id' => $member->currentPlan->id,
|
||||
'benefit_id' => $benefit->id,
|
||||
]);
|
||||
|
||||
$corporate = $member->asd;
|
||||
|
||||
return $claim;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user