[WIP] Update Claim
This commit is contained in:
@@ -44,6 +44,11 @@ class Benefit extends Model
|
||||
// return $this->belongsTo(Benefit::class, 'benefit_code', 'code');
|
||||
// }
|
||||
|
||||
public function claimItem()
|
||||
{
|
||||
return $this->morphMany(ClaimItem::class, 'claim_itemable');
|
||||
}
|
||||
|
||||
public function plans()
|
||||
{
|
||||
return $this->belongsToMany(Plan::class, 'corporate_benefits', 'benefit_id', 'id')
|
||||
|
||||
@@ -139,6 +139,11 @@ class Claim extends Model
|
||||
return $this->morphMany(File::class, 'fileable');
|
||||
}
|
||||
|
||||
public function items()
|
||||
{
|
||||
return $this->hasMany(ClaimItem::class, 'claim_id');
|
||||
}
|
||||
|
||||
public function member()
|
||||
{
|
||||
return $this->belongsTo(Member::class, 'member_id');
|
||||
|
||||
@@ -10,4 +10,12 @@ class ClaimDiagnosis extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'claim_diagnosis';
|
||||
|
||||
public $fillable = [
|
||||
'claim_id',
|
||||
'type',
|
||||
'diagnosis_id',
|
||||
'note',
|
||||
'description',
|
||||
];
|
||||
}
|
||||
|
||||
32
app/Models/ClaimItem.php
Normal file
32
app/Models/ClaimItem.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\Blameable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class ClaimItem extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes, Blameable;
|
||||
|
||||
protected $fillable = [
|
||||
'claim_id',
|
||||
'order',
|
||||
'currency',
|
||||
'nominal_ditagihkan',
|
||||
'nominal_dicover',
|
||||
'nominal_total',
|
||||
];
|
||||
|
||||
public function claim()
|
||||
{
|
||||
return $this->belongsTo(Claim::class, 'claim_id');
|
||||
}
|
||||
|
||||
public function claim_itemable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,8 @@ class File extends Model
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
'fileable_type',
|
||||
'fileable_id'
|
||||
];
|
||||
|
||||
public $appends = [
|
||||
|
||||
Reference in New Issue
Block a user