diff --git a/app/Http/Controllers/Api/Admin/HR/EmployeeController.php b/app/Http/Controllers/Api/Admin/HR/EmployeeController.php index e54950fc..1de66c26 100644 --- a/app/Http/Controllers/Api/Admin/HR/EmployeeController.php +++ b/app/Http/Controllers/Api/Admin/HR/EmployeeController.php @@ -76,7 +76,6 @@ public function store(Request $request): JsonResponse 'name' => 'required|string|max:50', 'email' => 'nullable|email|max:100', 'phone' => 'nullable|string|max:20', - 'password' => 'nullable|string|min:6', 'department_id' => 'nullable|integer|exists:departments,id', 'position_key' => 'nullable|string|max:50', 'job_title_key' => 'nullable|string|max:50', @@ -86,6 +85,7 @@ public function store(Request $request): JsonResponse 'manager_user_id' => 'nullable|integer|exists:users,id', 'display_name' => 'nullable|string|max:50', 'hire_date' => 'nullable|date', + 'resign_date' => 'nullable|date', 'address' => 'nullable|string|max:200', 'emergency_contact' => 'nullable|string|max:100', ]; @@ -154,6 +154,7 @@ public function update(Request $request, int $id): JsonResponse 'manager_user_id' => 'nullable|integer|exists:users,id', 'display_name' => 'nullable|string|max:50', 'hire_date' => 'nullable|date', + 'resign_date' => 'nullable|date', 'address' => 'nullable|string|max:200', 'emergency_contact' => 'nullable|string|max:100', ]); diff --git a/app/Models/HR/Employee.php b/app/Models/HR/Employee.php index b9242b0d..9662e013 100644 --- a/app/Models/HR/Employee.php +++ b/app/Models/HR/Employee.php @@ -39,6 +39,7 @@ class Employee extends Model protected $appends = [ 'hire_date', + 'resign_date', 'position_label', 'job_title_label', ]; @@ -71,6 +72,11 @@ public function getHireDateAttribute(): ?string return $this->json_extra['hire_date'] ?? null; } + public function getResignDateAttribute(): ?string + { + return $this->json_extra['resign_date'] ?? null; + } + public function getAddressAttribute(): ?string { return $this->json_extra['address'] ?? null; diff --git a/app/Services/HR/EmployeeService.php b/app/Services/HR/EmployeeService.php index 6e95959d..d5e12a53 100644 --- a/app/Services/HR/EmployeeService.php +++ b/app/Services/HR/EmployeeService.php @@ -170,7 +170,7 @@ public function createEmployee(array $data): Employee 'name' => $data['name'], 'email' => $email, 'phone' => $data['phone'] ?? null, - 'password' => Hash::make($data['password'] ?? 'sam1234!'), + 'password' => Hash::make('sam1234!'), 'role' => 'ops', 'is_active' => true, 'must_change_password' => true, @@ -191,6 +191,9 @@ public function createEmployee(array $data): Employee if (! empty($data['hire_date'])) { $jsonExtra['hire_date'] = $data['hire_date']; } + if (! empty($data['resign_date'])) { + $jsonExtra['resign_date'] = $data['resign_date']; + } if (! empty($data['address'])) { $jsonExtra['address'] = $data['address']; } @@ -240,7 +243,7 @@ public function updateEmployee(int $id, array $data): ?Employee ], fn ($v) => $v !== null); // json_extra 업데이트 - $jsonExtraKeys = ['hire_date', 'address', 'emergency_contact', 'salary', 'bank_account']; + $jsonExtraKeys = ['hire_date', 'resign_date', 'address', 'emergency_contact', 'salary', 'bank_account']; $extra = $employee->json_extra ?? []; foreach ($jsonExtraKeys as $key) { if (array_key_exists($key, $data)) { diff --git a/resources/views/hr/employees/create.blade.php b/resources/views/hr/employees/create.blade.php index fd8da0ef..b4b8e644 100644 --- a/resources/views/hr/employees/create.blade.php +++ b/resources/views/hr/employees/create.blade.php @@ -125,17 +125,6 @@ class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:rin - {{-- 비밀번호 --}} -
미입력 시 기본 비밀번호가 설정됩니다.
-