Add employee presence with kiosk sign-in, QR badges, and mobile step-out.
Deploy Ladill Frontdesk / deploy (push) Failing after 26s
Deploy Ladill Frontdesk / deploy (push) Failing after 26s
Enables staff roster, PIN/code kiosk flow, attendance reports, evacuation staff roll call, webhooks, branch mismatch warnings, and a linked-user My presence portal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class EmployeePresence extends Model
|
||||
{
|
||||
public const STATUS_OFF_SITE = 'off_site';
|
||||
|
||||
public const STATUS_ON_SITE = 'on_site';
|
||||
|
||||
public const STATUS_STEPPED_OUT = 'stepped_out';
|
||||
|
||||
protected $table = 'frontdesk_employee_presence';
|
||||
|
||||
protected $fillable = [
|
||||
'employee_id', 'status', 'branch_id', 'device_id', 'destination',
|
||||
'step_out_reason', 'notes', 'expected_return_at', 'return_alert_sent_at',
|
||||
'signed_in_at', 'last_event_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'signed_in_at' => 'datetime',
|
||||
'last_event_at' => 'datetime',
|
||||
'expected_return_at' => 'datetime',
|
||||
'return_alert_sent_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function employee(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Employee::class, 'employee_id');
|
||||
}
|
||||
|
||||
public function branch(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Branch::class, 'branch_id');
|
||||
}
|
||||
|
||||
public function device(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Device::class, 'device_id');
|
||||
}
|
||||
|
||||
public function isOnSite(): bool
|
||||
{
|
||||
return $this->status === self::STATUS_ON_SITE;
|
||||
}
|
||||
|
||||
public function isSteppedOut(): bool
|
||||
{
|
||||
return $this->status === self::STATUS_STEPPED_OUT;
|
||||
}
|
||||
|
||||
public function isOffSite(): bool
|
||||
{
|
||||
return $this->status === self::STATUS_OFF_SITE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user