diff --git a/app/Http/Resources/CompanyResource.php b/app/Http/Resources/CompanyResource.php index c49fbf14..38459a35 100644 --- a/app/Http/Resources/CompanyResource.php +++ b/app/Http/Resources/CompanyResource.php @@ -2,14 +2,9 @@ namespace App\Http\Resources; -use App\Classes\Modules\Companies\Services\FetchesCompanyServices; -use App\Classes\ValueObjects\Constants\BankAccountType; +use App\Classes\ValueObjects\Constants\ApprovalStatus; use App\Classes\ValueObjects\Constants\BusinessType; use App\Classes\ValueObjects\Constants\DocumentType; -use App\Classes\ValueObjects\Constants\SegmentConstants; -use App\Models\CompanyModule; -use App\Models\Currency; -use App\Models\SegmentConstant; use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Support\Facades\Crypt; @@ -37,7 +32,7 @@ class CompanyResource extends JsonResource 'company_module' => new CompanyModuleResource($companyModule), 'last_order' => new OrderResource($companyModule ? $companyModule->orders()->orderBy('id', 'DESC')->first(): null), 'order_count' => $this->orders()->count(), - 'identification' => new DocumentResource($this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->first()), + 'identification' => new DocumentResource($this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED])->first()), 'created_at' => $this->created_at->format('d-m-Y') ];