From 76a993d32d3be55324dff7cbaa6cad71fe211b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Tue, 10 Mar 2026 10:04:24 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[employee]=20=EC=82=AC=EC=9B=90?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=EA=B0=9C=EC=9D=B8=20=EC=9D=B4=EB=A9=94?= =?UTF-8?q?=EC=9D=BC=20=ED=95=84=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 사원 수정 폼에 개인 이메일 입력 필드 추가 - 레이아웃 2x2 배열로 변경 (업무용 이메일|개인 이메일 / 주민등록번호|연락처) - Employee 모델에 personalEmail accessor 추가 - 컨트롤러 validation, 서비스 jsonExtraKeys에 personal_email 반영 --- .../Api/Admin/HR/EmployeeController.php | 2 ++ app/Models/HR/Employee.php | 5 +++ app/Services/HR/EmployeeService.php | 4 +-- resources/views/hr/employees/edit.blade.php | 32 ++++++++++++------- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/app/Http/Controllers/Api/Admin/HR/EmployeeController.php b/app/Http/Controllers/Api/Admin/HR/EmployeeController.php index c25db9b7..266ea8c9 100644 --- a/app/Http/Controllers/Api/Admin/HR/EmployeeController.php +++ b/app/Http/Controllers/Api/Admin/HR/EmployeeController.php @@ -95,6 +95,7 @@ public function store(Request $request): JsonResponse 'address' => 'nullable|string|max:200', 'emergency_contact' => 'nullable|string|max:100', 'resident_number' => 'nullable|string|max:14', + 'personal_email' => 'nullable|email|max:100', 'bank_account.bank_code' => 'nullable|string|max:20', 'bank_account.bank_name' => 'nullable|string|max:50', 'bank_account.account_holder' => 'nullable|string|max:50', @@ -176,6 +177,7 @@ public function update(Request $request, int $id): JsonResponse 'address' => 'nullable|string|max:200', 'emergency_contact' => 'nullable|string|max:100', 'resident_number' => 'nullable|string|max:14', + 'personal_email' => 'nullable|email|max:100', 'bank_account.bank_code' => 'nullable|string|max:20', 'bank_account.bank_name' => 'nullable|string|max:50', 'bank_account.account_holder' => 'nullable|string|max:50', diff --git a/app/Models/HR/Employee.php b/app/Models/HR/Employee.php index 555ea784..64cf438f 100644 --- a/app/Models/HR/Employee.php +++ b/app/Models/HR/Employee.php @@ -111,6 +111,11 @@ public function getResidentNumberAttribute(): ?string return $this->json_extra['resident_number'] ?? null; } + public function getPersonalEmailAttribute(): ?string + { + return $this->json_extra['personal_email'] ?? null; + } + public function getBankAccountAttribute(): ?array { return $this->json_extra['bank_account'] ?? null; diff --git a/app/Services/HR/EmployeeService.php b/app/Services/HR/EmployeeService.php index 01f7b0f0..57aabe63 100644 --- a/app/Services/HR/EmployeeService.php +++ b/app/Services/HR/EmployeeService.php @@ -233,7 +233,7 @@ public function createEmployee(array $data): Employee // json_extra 구성 $jsonExtra = []; - foreach (['hire_date', 'resign_date', 'address', 'emergency_contact', 'resident_number'] as $key) { + foreach (['hire_date', 'resign_date', 'address', 'emergency_contact', 'resident_number', 'personal_email'] as $key) { if (! empty($data[$key])) { $jsonExtra[$key] = $data[$key]; } @@ -305,7 +305,7 @@ public function updateEmployee(int $id, array $data): ?Employee ], fn ($v) => $v !== null); // json_extra 업데이트 (스칼라 값) - $jsonExtraKeys = ['hire_date', 'resign_date', 'address', 'emergency_contact', 'salary', 'resident_number']; + $jsonExtraKeys = ['hire_date', 'resign_date', 'address', 'emergency_contact', 'salary', 'resident_number', 'personal_email']; $extra = $employee->json_extra ?? []; foreach ($jsonExtraKeys as $key) { if (array_key_exists($key, $data)) { diff --git a/resources/views/hr/employees/edit.blade.php b/resources/views/hr/employees/edit.blade.php index abef0ed3..fffb5dac 100644 --- a/resources/views/hr/employees/edit.blade.php +++ b/resources/views/hr/employees/edit.blade.php @@ -51,14 +51,32 @@ class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:rin class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"> - {{-- 이메일 / 연락처 --}} + {{-- 업무용 이메일 / 개인 이메일 --}}
- +
+
+ + +
+
+ + {{-- 주민등록번호 / 연락처 --}} +
+
+ + +
주민등록번호 - -
- {{-- 근무 정보 --}}

근무 정보