[Client Portal] Alarm Center

This commit is contained in:
Muhammad Fajar
2024-01-13 13:58:49 +07:00
parent d1465ae554
commit a42d444b82
19 changed files with 827 additions and 1236 deletions

View File

@@ -197,6 +197,11 @@ class Member extends Model
{
return $this->hasOneThrough(CorporateDivision::class, CorporateEmployee::class, 'member_id', 'id', 'id', 'division_id');
}
public function requestLogs()
{
return $this->hasMany(RequestLog::class);
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
@@ -270,13 +275,13 @@ class Member extends Model
protected function relations(): Attribute
{
$relation = '-';
if ($this->relation_with_principal == 'H'){
if ($this->relation_with_principal == 'H') {
$relation = 'Husbund';
} else if ($this->relation_with_principal == 'W'){
} else if ($this->relation_with_principal == 'W') {
$relation = 'Wife';
} else if ($this->relation_with_principal == 'S'){
} else if ($this->relation_with_principal == 'S') {
$relation = 'Son';
} else if ($this->relation_with_principal == 'D'){
} else if ($this->relation_with_principal == 'D') {
$relation = 'Daughter';
}
return Attribute::make(
@@ -287,11 +292,11 @@ class Member extends Model
protected function statusMarital(): Attribute
{
$maritalStatus = '-';
if ($this->marital_status == 'M'){
if ($this->marital_status == 'M') {
$maritalStatus = 'Married';
} else if ($this->relation_with_principal == 'D'){
} else if ($this->relation_with_principal == 'D') {
$maritalStatus = 'Divorced';
} else if ($this->relation_with_principal == 'S'){
} else if ($this->relation_with_principal == 'S') {
$maritalStatus = 'Single';
}
return Attribute::make(
@@ -311,12 +316,12 @@ class Member extends Model
protected function birthDateeCard(): Attribute
{
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
if ($this->birth_date){
if ($this->birth_date) {
$date = $this->birth_date;
return Attribute::make(
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
);
} else if ($this->person->birth_date){
} else if ($this->person->birth_date) {
return Attribute::make(
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
);

View File

@@ -94,7 +94,7 @@ class RequestLog extends Model
"CLAIM METHOD",
"STATUS",
];
public static $status = [
'draft' => 'Draft',
@@ -241,6 +241,16 @@ class RequestLog extends Model
return $this->belongsTo(Service::class, 'service_code', 'code');
}
public function requestLogBenefit()
{
return $this->hasOne(RequestLogBenefit::class, 'request_log_id');
}
public function requestLogDailyMonitorings()
{
return $this->hasMany(RequestLogDailyMonitoring::class, 'request_log_id');
}
public function getPaymentTypeNameAttribute()
{
return self::$payment_types[$this->payment_type] ?? $this->payment_type;

View File

@@ -24,7 +24,13 @@ class RequestLogBenefit extends Model
'deleted_by',
];
public function benefit(){
public function benefit()
{
return $this->belongsTo(Benefit::class, 'benefit_id', 'id');
}
public function requestLog()
{
return $this->belongsTo(RequestLog::class, 'aa');
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class RequestLogDailyMonitoring extends Model
{
use HasFactory;
public function requestLog()
{
return $this->belongsTo(RequestLog::class);
}
public function requestLogMedicalPlans()
{
return $this->hasMany(RequestLogMedicalPlan::class);
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class RequestLogMedicalPlan extends Model
{
use HasFactory;
public function requestLogDailyMonitoring()
{
return $this->belongsTo(RequestLogDailyMonitoring::class);
}
}