feat(scanner): update scan attempt result labels for consistency
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user