fix(hse): auto sync security guard personnel into employee simper master upon seeding and importing
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Employee;
|
||||
use App\Models\Gate;
|
||||
use App\Models\SecurityGuard;
|
||||
use App\Models\User;
|
||||
@@ -105,6 +106,20 @@ class ImportSecurityGuardsCommand extends Command
|
||||
$updatedGuards++;
|
||||
}
|
||||
|
||||
// 3. Sinkronisasi Profil Master Personil / Karyawan (Data SIMPER)
|
||||
Employee::updateOrCreate(
|
||||
['nik' => $username],
|
||||
[
|
||||
'user_id' => $user->id,
|
||||
'name' => $p['name'],
|
||||
'employee_type' => 'Karyawan',
|
||||
'unit_kerja' => 'Private Guard',
|
||||
'division' => 'Private Guard',
|
||||
'position' => 'Anggota',
|
||||
'is_operator' => false,
|
||||
]
|
||||
);
|
||||
|
||||
$bar->advance();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user