Add Frontdesk-style Devices registry for POS hardware.
Deploy Ladill POS / deploy (push) Successful in 42s
Deploy Ladill POS / deploy (push) Successful in 42s
Register tills, customer displays, kitchen screens, printers, scanners, and tablets per branch. Customer displays share the branch display token and mark online when the public screen polls; stale devices go offline on a schedule.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\Pos\DeviceService;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class MarkDevicesOfflineCommand extends Command
|
||||
{
|
||||
protected $signature = 'pos:devices-offline {--minutes=10 : Consider devices stale after this many minutes}';
|
||||
|
||||
protected $description = 'Mark POS devices offline when they stop heartbeating.';
|
||||
|
||||
public function handle(DeviceService $devices): int
|
||||
{
|
||||
$minutes = max(1, (int) $this->option('minutes'));
|
||||
$count = $devices->markStaleDevicesOffline($minutes);
|
||||
$this->info("Marked {$count} device(s) offline.");
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user