diff --git a/app/Http/Controllers/Admin/WorkerController.php b/app/Http/Controllers/Admin/WorkerController.php index f3a99f8..0fd0bdd 100644 --- a/app/Http/Controllers/Admin/WorkerController.php +++ b/app/Http/Controllers/Admin/WorkerController.php @@ -28,7 +28,7 @@ public function index() // Preferred job types: full-time / part-time / live-in / live-out $jobTypes = ['full-time', 'part-time', 'live-in', 'live-out']; - $preferredJobType = $jobTypes[$worker->id % 4]; + $preferredJobType = $worker->preferred_job_type ?? $jobTypes[$worker->id % 4]; return [ 'id' => $worker->id, @@ -36,12 +36,17 @@ public function index() 'email' => $worker->email, 'phone' => $worker->phone, 'gender' => $worker->gender ?? 'Female', + 'age' => $worker->age, + 'religion' => $worker->religion, + 'visa_status' => $worker->visa_status, + 'in_country' => (bool)$worker->in_country, 'language' => $worker->language ?? 'English', 'languages' => $langs, 'nationality' => $worker->nationality, 'country' => $worker->country, 'city' => $worker->city, 'area' => $worker->area, + 'preferred_location' => $worker->preferred_location, 'live_in_out' => $worker->live_in_out ?? 'Live-in', 'experience' => $worker->experience, 'salary' => (int)$worker->salary, @@ -124,16 +129,21 @@ public function updateProfile(Request $request, $id) 'country' => 'nullable|string', 'city' => 'nullable|string', 'area' => 'nullable|string', + 'preferred_location' => 'nullable|string', 'live_in_out' => 'nullable|string', 'experience' => 'required|string', 'salary' => 'nullable|numeric', - 'bio' => 'nullable|string' + 'bio' => 'nullable|string', + 'nationality' => 'nullable|string', + 'visa_status' => 'nullable|string', + 'religion' => 'nullable|string', + 'age' => 'nullable|integer', + 'in_country' => 'nullable|boolean', + 'preferred_job_type' => 'nullable|string', ]); $worker = \App\Models\Worker::findOrFail($id); - - $worker->name = $validated['name']; $worker->phone = $validated['phone']; $worker->gender = $validated['gender'] ?? $worker->gender; @@ -141,10 +151,19 @@ public function updateProfile(Request $request, $id) $worker->country = $validated['country'] ?? $worker->country; $worker->city = $validated['city'] ?? $worker->city; $worker->area = $validated['area'] ?? $worker->area; + $worker->preferred_location = $validated['preferred_location'] ?? $worker->preferred_location; $worker->live_in_out = $validated['live_in_out'] ?? $worker->live_in_out; $worker->experience = $validated['experience']; $worker->salary = $validated['salary'] ?? $worker->salary; $worker->bio = $validated['bio'] ?? $worker->bio; + $worker->nationality = $validated['nationality'] ?? $worker->nationality; + $worker->visa_status = $validated['visa_status'] ?? $worker->visa_status; + $worker->religion = $validated['religion'] ?? $worker->religion; + $worker->age = $validated['age'] ?? $worker->age; + if (isset($validated['in_country'])) { + $worker->in_country = (bool)$validated['in_country']; + } + $worker->preferred_job_type = $validated['preferred_job_type'] ?? $worker->preferred_job_type; $worker->save(); return back()->with('success', "Worker #{$id} profile details moderated and updated successfully."); diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 8acece4..a9af904 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -30,11 +30,6 @@ public function run(): void // Call Seeders $this->call([ SkillSeeder::class, - WorkerSeeder::class, - EmployerProfileSeeder::class, - JobPostSeeder::class, - ConversationSeeder::class, - SupportTicketSeeder::class, ]); } } diff --git a/public/swagger.json b/public/swagger.json index d14b97e..f614856 100644 --- a/public/swagger.json +++ b/public/swagger.json @@ -106,6 +106,11 @@ "format": "date", "example": "2028-06-12", "description": "Expiry date of the license (YYYY-MM-DD). (REQUIRED)" + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -169,6 +174,11 @@ "password": { "type": "string", "example": "Password@123" + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -508,6 +518,11 @@ "type": "string", "example": "Dubai Marina", "description": "Preferred work location/area." + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -613,6 +628,11 @@ "format": "password", "example": "securepassword123", "description": "Secret account password." + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -1563,6 +1583,11 @@ "type": "string", "example": "Dubai Marina", "description": "Preferred work location/area." + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -2380,6 +2405,11 @@ "type": "string", "example": "+971509990001", "description": "Sponsor's mobile phone number" + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -2420,6 +2450,11 @@ "type": "string", "example": "111111", "description": "6-digit OTP code" + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -2590,6 +2625,11 @@ "type": "string", "format": "password", "example": "Password@123" + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -2649,6 +2689,11 @@ "password": { "type": "string", "example": "Password@123" + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -3266,6 +3311,11 @@ "new_password_confirmation": { "type": "string", "example": "NewSecurePassword@123" + }, + "fcm_token": { + "type": "string", + "example": "fcm_token_example", + "description": "Firebase Cloud Messaging token for push notifications." } } } @@ -4544,6 +4594,7 @@ "status": {"type": "string", "example": "active"}, "license_file": {"type": "string", "example": "uploads/licenses/1234567890_license_trade.pdf"}, "emirates_id_file": {"type": "string", "example": "uploads/licenses/1234567890_emirates_id.pdf"}, + "fcm_token": {"type": "string", "example": "fcm_token_example"}, "created_at": {"type": "string", "format": "date-time"} } }, diff --git a/resources/js/Pages/Admin/Workers/Index.jsx b/resources/js/Pages/Admin/Workers/Index.jsx index edab975..7b8f8f8 100644 --- a/resources/js/Pages/Admin/Workers/Index.jsx +++ b/resources/js/Pages/Admin/Workers/Index.jsx @@ -82,6 +82,12 @@ export default function WorkerManagement({ workers }) { area: '', preferred_location: '', live_in_out: '', + nationality: '', + visa_status: '', + religion: '', + age: '', + in_country: true, + preferred_job_type: '', }); const [adminNotes, setAdminNotes] = useState(''); @@ -134,7 +140,13 @@ export default function WorkerManagement({ workers }) { city: editForm.city, area: editForm.area, preferred_location: editForm.preferred_location, - live_in_out: editForm.live_in_out + live_in_out: editForm.live_in_out, + nationality: editForm.nationality, + visa_status: editForm.visa_status, + religion: editForm.religion, + age: editForm.age, + in_country: editForm.in_country, + preferred_job_type: editForm.preferred_job_type }); } }); @@ -176,6 +188,12 @@ export default function WorkerManagement({ workers }) { area: fullWorker.area || '', preferred_location: fullWorker.preferred_location || '', live_in_out: fullWorker.live_in_out || '', + nationality: fullWorker.nationality || '', + visa_status: fullWorker.visa_status || '', + religion: fullWorker.religion || '', + age: fullWorker.age || '', + in_country: fullWorker.in_country ?? true, + preferred_job_type: fullWorker.preferred_job_type || '', }); setAdminNotes(fullWorker.admin_notes); setIsEditMode(false); @@ -463,6 +481,33 @@ export default function WorkerManagement({ workers }) { className="w-full bg-white border border-slate-200 rounded-xl p-2.5 text-xs font-bold text-slate-700 outline-none focus:ring-2 focus:ring-[#0F6E56]/20" /> +
+ + setEditForm({ ...editForm, age: e.target.value })} + className="w-full bg-white border border-slate-200 rounded-xl p-2.5 text-xs font-bold text-slate-700 outline-none focus:ring-2 focus:ring-[#0F6E56]/20" + /> +
+
+ + setEditForm({ ...editForm, nationality: e.target.value })} + className="w-full bg-white border border-slate-200 rounded-xl p-2.5 text-xs font-bold text-slate-700 outline-none focus:ring-2 focus:ring-[#0F6E56]/20" + /> +
+
+ + setEditForm({ ...editForm, religion: e.target.value })} + className="w-full bg-white border border-slate-200 rounded-xl p-2.5 text-xs font-bold text-slate-700 outline-none focus:ring-2 focus:ring-[#0F6E56]/20" + /> +
@@ -636,6 +681,26 @@ export default function WorkerManagement({ workers }) { {selectedWorker?.language || 'English'} +
+ + {selectedWorker?.nationality || 'N/A'} +
+
+ + {selectedWorker?.visa_status || 'N/A'} +
+
+ + {selectedWorker?.religion || 'N/A'} +
+
+ + {selectedWorker?.age || 'N/A'} +
+
+ + {selectedWorker?.in_country ? 'In Country (UAE)' : 'Out of Country'} +