feat(scanner): add scan attempt detail endpoint
This commit is contained in:
@@ -51,6 +51,19 @@ class ScannerTicketService
|
||||
->withQueryString();
|
||||
}
|
||||
|
||||
public function scanAttemptDetail(User $scanner, int $scanAttemptId): ScanAttempt
|
||||
{
|
||||
$scanAttempt = ScanAttempt::query()
|
||||
->with('ticket')
|
||||
->where('tenant_code', $scanner->tenant_codigo)
|
||||
->where('scanner_user_id', $scanner->getKey())
|
||||
->findOrFail($scanAttemptId);
|
||||
|
||||
$scanAttempt->ticket?->loadMissing($this->relations());
|
||||
|
||||
return $scanAttempt;
|
||||
}
|
||||
|
||||
private function parseSearchDate(string $search): ?string
|
||||
{
|
||||
if (preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', $search, $matches) === 1) {
|
||||
|
||||
Reference in New Issue
Block a user