feat(scanner): update scan attempt result labels for consistency

This commit is contained in:
2026-09-09 08:47:10 -03:00
parent 002f08a8fa
commit 64e965aff7
2 changed files with 4 additions and 9 deletions

View File

@@ -23,15 +23,10 @@ class ScanAttemptResource extends JsonResource
'resolved_at' => $this->resolved_at,
'result' => $this->result->value,
'result_label' => match ($this->result) {
ScanAttemptResult::Processing => 'Procesando',
ScanAttemptResult::Accepted => 'Verificado',
ScanAttemptResult::InvalidQr => 'QR inválido',
ScanAttemptResult::TicketNotFound => 'Ticket inexistente',
ScanAttemptResult::CategoryForbidden => 'Categoría no permitida',
ScanAttemptResult::AlreadyScanned => 'Ya escaneado',
ScanAttemptResult::AlreadyScanned => 'Usado',
ScanAttemptResult::Expired => 'Vencido',
ScanAttemptResult::NotValid => 'No válido',
ScanAttemptResult::UnexpectedError => 'Error',
default => 'Error',
},
'result_detail_label' => match ($this->result) {
ScanAttemptResult::Processing => 'Error',

View File

@@ -190,7 +190,7 @@ class ScannerTicketControllerTest extends TestCase
$this->getJson("/api/v1/scanner/attempts/{$scanAttempt->id}")
->assertOk()
->assertJsonPath('data.scan_attempt.id', $scanAttempt->id)
->assertJsonPath('data.scan_attempt.result_label', 'Ticket inexistente')
->assertJsonPath('data.scan_attempt.result_label', 'Error')
->assertJsonPath('data.scan_attempt.result_detail_label', 'Error')
->assertJsonPath('data.ticket', null)
->assertJsonPath('data.client', null);
@@ -205,7 +205,7 @@ class ScannerTicketControllerTest extends TestCase
$this->getJson("/api/v1/scanner/attempts/{$scanAttempt->id}")
->assertOk()
->assertJsonPath('data.scan_attempt.result_label', 'QR inválido')
->assertJsonPath('data.scan_attempt.result_label', 'Error')
->assertJsonPath('data.scan_attempt.result_detail_label', 'QR no pertenece al evento');
}