<?php

namespace Modules\Client\Transformers\ClaimReport;

use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\Crypt;

class MemberResources extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'code' => $this->code,
            'member_id' => $this->member_id,
            'full_name' => $this->full_name,
            'division_name' => $this->division_name ?? '',
            'status' => $this->status,
            'claimRequestId' => Crypt::encrypt($this->claim_request_id),
            'submission_date' => $this->submission_date,
        ];
    }
}
