fitur is reversal
This commit is contained in:
@@ -71,6 +71,17 @@ class ClaimRequestShowResource extends JsonResource
|
||||
'total_excess_paid' => $total_excess_paid,
|
||||
];
|
||||
|
||||
$isReversal = false;
|
||||
$isRole = auth()->user()->role_id;
|
||||
if ($data['request_log']['status'] == 'approved' &&
|
||||
$data['request_log']['status_final_log'] == 'approved' &&
|
||||
$data['status'] == 'approved' &&
|
||||
$data['status_claim_management'] == 'approved' &&
|
||||
$isRole != 1 // is admin
|
||||
){
|
||||
$isReversal = true;
|
||||
}
|
||||
|
||||
|
||||
$response = [
|
||||
'id' => $data['id'],
|
||||
@@ -101,6 +112,7 @@ class ClaimRequestShowResource extends JsonResource
|
||||
'files' => $data['request_log']['files'],
|
||||
'reason_decline' => $data['reason_decline'],
|
||||
// 'benefit_data' => $benefitDetailLog,
|
||||
'is_reversal' => $isReversal, // untuk penjagaan, jika true tidak bisa di edit/hapus lagi
|
||||
];
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user