Faster voice announcements, Care/Frontdesk API, and console UI polish.
Deploy Ladill Queue / deploy (push) Successful in 28s
Deploy Ladill Queue / deploy (push) Successful in 28s
Poll displays every 1.2s with client-side TTS ack; expose service API for sibling apps; redesign tickets, counters, and staff console. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Qms;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\VoiceAnnouncement;
|
||||
use App\Services\Qms\DisplayService;
|
||||
use App\Services\Qms\VoiceAnnouncementService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -23,6 +24,8 @@ class DisplayPublicController extends Controller
|
||||
return view('qms.display.public', [
|
||||
'screen' => $screen,
|
||||
'dataUrl' => route('qms.display.data', $token),
|
||||
'playedUrl' => route('qms.display.announcement.played', ['token' => $token, 'announcement' => '__ID__']),
|
||||
'pollMs' => config('qms.display_poll_ms', 1200),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -31,17 +34,16 @@ class DisplayPublicController extends Controller
|
||||
$screen = $this->displays->findByToken($token) ?? abort(404);
|
||||
$this->displays->touch($screen);
|
||||
|
||||
$payload = $this->displays->payload($screen);
|
||||
return response()->json($this->displays->payload($screen));
|
||||
}
|
||||
|
||||
foreach ($payload['announcements'] as $announcement) {
|
||||
if (isset($announcement['id'])) {
|
||||
$model = \App\Models\VoiceAnnouncement::find($announcement['id']);
|
||||
if ($model) {
|
||||
$this->voice->markPlayed($model);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function played(string $token, VoiceAnnouncement $announcement): JsonResponse
|
||||
{
|
||||
$screen = $this->displays->findByToken($token) ?? abort(404);
|
||||
abort_unless($announcement->branch_id === $screen->branch_id, 404);
|
||||
|
||||
return response()->json($payload);
|
||||
$this->voice->markPlayed($announcement);
|
||||
|
||||
return response()->json(['ok' => true]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user