Files
Investidor-V2/outputs/investmoz-fintech-investimento-QA-20261015/fixture-unavailable-document-QA.php
T
nala 6a76aac80f
tests / ci (push) Canceled after 0s
versao compilada 1
2026-10-16 09:17:28 +02:00

5 lines
627 B
PHP

<?php require __DIR__.'/boot-QA.php'; use Illuminate\Support\Facades\DB;
$p=json_decode(file_get_contents(__DIR__.'/PROVA-DELTA-QA.json'),true);$s=$p['scenarios'][0];$doc=DB::table('documents')->where('id',$s['document_id'])->where('uploaded_by',$s['user_id'])->firstOrFail();
if(($argv[1]??'')==='restore')DB::table('documents')->where('id',$doc->id)->update(['deleted_at'=>null]);else{if($doc->deleted_at)throw new RuntimeException('Already unavailable');DB::table('documents')->where('id',$doc->id)->update(['deleted_at'=>now()]);}
echo json_encode(['synthetic_document_only'=>true,'restored'=>($argv[1]??'')==='restore']);