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,67 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('frontdesk_employees', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('frontdesk_organizations')->cascadeOnDelete();
|
||||
$table->foreignId('branch_id')->nullable()->constrained('frontdesk_branches')->nullOnDelete();
|
||||
$table->string('employee_code');
|
||||
$table->string('full_name');
|
||||
$table->string('department')->nullable();
|
||||
$table->string('email')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->string('pin_hash');
|
||||
$table->foreignId('host_id')->nullable()->constrained('frontdesk_hosts')->nullOnDelete();
|
||||
$table->boolean('active')->default(true);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->unique(['organization_id', 'employee_code']);
|
||||
$table->index(['owner_ref', 'organization_id']);
|
||||
});
|
||||
|
||||
Schema::create('frontdesk_employee_presence', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('employee_id')->unique()->constrained('frontdesk_employees')->cascadeOnDelete();
|
||||
$table->string('status')->default('off_site'); // off_site, on_site, stepped_out
|
||||
$table->foreignId('branch_id')->nullable()->constrained('frontdesk_branches')->nullOnDelete();
|
||||
$table->foreignId('device_id')->nullable()->constrained('frontdesk_devices')->nullOnDelete();
|
||||
$table->string('destination')->nullable();
|
||||
$table->string('step_out_reason')->nullable();
|
||||
$table->text('notes')->nullable();
|
||||
$table->timestamp('signed_in_at')->nullable();
|
||||
$table->timestamp('last_event_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('frontdesk_employee_presence_events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('frontdesk_organizations')->cascadeOnDelete();
|
||||
$table->foreignId('employee_id')->constrained('frontdesk_employees')->cascadeOnDelete();
|
||||
$table->string('event'); // sign_in, sign_out, step_out, step_in
|
||||
$table->string('status_after');
|
||||
$table->foreignId('branch_id')->nullable()->constrained('frontdesk_branches')->nullOnDelete();
|
||||
$table->foreignId('device_id')->nullable()->constrained('frontdesk_devices')->nullOnDelete();
|
||||
$table->string('destination')->nullable();
|
||||
$table->string('step_out_reason')->nullable();
|
||||
$table->text('notes')->nullable();
|
||||
$table->timestamps();
|
||||
$table->index(['organization_id', 'created_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('frontdesk_employee_presence_events');
|
||||
Schema::dropIfExists('frontdesk_employee_presence');
|
||||
Schema::dropIfExists('frontdesk_employees');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('frontdesk_employees', function (Blueprint $table) {
|
||||
$table->string('qr_token')->nullable()->unique()->after('employee_code');
|
||||
$table->string('user_ref')->nullable()->index()->after('host_id');
|
||||
});
|
||||
|
||||
Schema::table('frontdesk_employee_presence', function (Blueprint $table) {
|
||||
$table->timestamp('expected_return_at')->nullable()->after('notes');
|
||||
$table->timestamp('return_alert_sent_at')->nullable()->after('expected_return_at');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('frontdesk_employee_presence', function (Blueprint $table) {
|
||||
$table->dropColumn(['expected_return_at', 'return_alert_sent_at']);
|
||||
});
|
||||
|
||||
Schema::table('frontdesk_employees', function (Blueprint $table) {
|
||||
$table->dropColumn(['qr_token', 'user_ref']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user