tambah kolom provider di final log dan request log

This commit is contained in:
2024-01-09 09:15:16 +07:00
parent b5862650cb
commit e2be94f0d0
10 changed files with 115 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ namespace Modules\Internal\Transformers;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Str;
use App\Models\Organization;
class RequestLogResource extends JsonResource
{
@@ -18,6 +19,7 @@ class RequestLogResource extends JsonResource
$filesGroupByType = $this->files->mapToGroups(function($file) {
return [Str::slug($file->type, '_') => $file];
});
$provider = Organization::where('id', $this->organization_id)->first();
$data = [
'id' => $this->id,
@@ -25,6 +27,7 @@ class RequestLogResource extends JsonResource
'submission_date' => $this->submission_date,
'member_name' => $this->member->name,
'status' => $this->status ?? 'unknown',
'provider' => $provider ? $provider->name : '-',
'status_final_log' => $this->status_final_log ?? 'unknown',
'service_name' => $this->service ? $this->service->name : '',
'payment_type' => $this->payment_type,