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,
|
'resolved_at' => $this->resolved_at,
|
||||||
'result' => $this->result->value,
|
'result' => $this->result->value,
|
||||||
'result_label' => match ($this->result) {
|
'result_label' => match ($this->result) {
|
||||||
ScanAttemptResult::Processing => 'Procesando',
|
|
||||||
ScanAttemptResult::Accepted => 'Verificado',
|
ScanAttemptResult::Accepted => 'Verificado',
|
||||||
ScanAttemptResult::InvalidQr => 'QR inválido',
|
ScanAttemptResult::AlreadyScanned => 'Usado',
|
||||||
ScanAttemptResult::TicketNotFound => 'Ticket inexistente',
|
|
||||||
ScanAttemptResult::CategoryForbidden => 'Categoría no permitida',
|
|
||||||
ScanAttemptResult::AlreadyScanned => 'Ya escaneado',
|
|
||||||
ScanAttemptResult::Expired => 'Vencido',
|
ScanAttemptResult::Expired => 'Vencido',
|
||||||
ScanAttemptResult::NotValid => 'No válido',
|
default => 'Error',
|
||||||
ScanAttemptResult::UnexpectedError => 'Error',
|
|
||||||
},
|
},
|
||||||
'result_detail_label' => match ($this->result) {
|
'result_detail_label' => match ($this->result) {
|
||||||
ScanAttemptResult::Processing => 'Error',
|
ScanAttemptResult::Processing => 'Error',
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ class ScannerTicketControllerTest extends TestCase
|
|||||||
$this->getJson("/api/v1/scanner/attempts/{$scanAttempt->id}")
|
$this->getJson("/api/v1/scanner/attempts/{$scanAttempt->id}")
|
||||||
->assertOk()
|
->assertOk()
|
||||||
->assertJsonPath('data.scan_attempt.id', $scanAttempt->id)
|
->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.scan_attempt.result_detail_label', 'Error')
|
||||||
->assertJsonPath('data.ticket', null)
|
->assertJsonPath('data.ticket', null)
|
||||||
->assertJsonPath('data.client', null);
|
->assertJsonPath('data.client', null);
|
||||||
@@ -205,7 +205,7 @@ class ScannerTicketControllerTest extends TestCase
|
|||||||
|
|
||||||
$this->getJson("/api/v1/scanner/attempts/{$scanAttempt->id}")
|
$this->getJson("/api/v1/scanner/attempts/{$scanAttempt->id}")
|
||||||
->assertOk()
|
->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');
|
->assertJsonPath('data.scan_attempt.result_detail_label', 'QR no pertenece al evento');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user