feat: consolidar desenvolvimentos do portal InvestMoz
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
final class OpportunityWorkflowUnavailable extends RuntimeException
|
||||
{
|
||||
public function __construct(public readonly string $reference, public readonly bool $recorded, Throwable $previous)
|
||||
{
|
||||
parent::__construct('Opportunity operation result requires verification.', 0, $previous);
|
||||
}
|
||||
|
||||
public function render(): JsonResponse
|
||||
{
|
||||
return response()->json(['message' => 'Não foi possível confirmar o resultado. Consulte o estado da oportunidade e dos recursos antes de repetir. '.($this->recorded ? 'Incidente técnico registado. ' : 'Não foi possível guardar o incidente; conserve esta referência. ').'Referência: '.$this->reference,
|
||||
'reference' => $this->reference, 'incident_recorded' => $this->recorded], 503)->header('Cache-Control', 'private, no-store');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user