diff --git a/app/Http/Controllers/CandidateController.php b/app/Http/Controllers/CandidateController.php index 16818d9..f343603 100644 --- a/app/Http/Controllers/CandidateController.php +++ b/app/Http/Controllers/CandidateController.php @@ -116,6 +116,19 @@ class CandidateController extends Controller return back()->with('success', 'Documents mis à jour avec succès.'); } + public function updateNotes(Request $request, Candidate $candidate) + { + $request->validate([ + 'notes' => 'nullable|string', + ]); + + $candidate->update([ + 'notes' => $request->notes, + ]); + + return back()->with('success', 'Notes mises à jour avec succès.'); + } + public function resetPassword(Candidate $candidate) { $password = Str::random(10); diff --git a/app/Models/Candidate.php b/app/Models/Candidate.php index feba303..277e31f 100644 --- a/app/Models/Candidate.php +++ b/app/Models/Candidate.php @@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Attributes\Fillable; use Illuminate\Database\Eloquent\Factories\HasFactory; -#[Fillable(['user_id', 'phone', 'linkedin_url', 'status'])] +#[Fillable(['user_id', 'phone', 'linkedin_url', 'status', 'notes'])] class Candidate extends Model { use HasFactory; diff --git a/database/migrations/2026_03_20_090804_add_notes_to_candidates_table.php b/database/migrations/2026_03_20_090804_add_notes_to_candidates_table.php new file mode 100644 index 0000000..135654b --- /dev/null +++ b/database/migrations/2026_03_20_090804_add_notes_to_candidates_table.php @@ -0,0 +1,28 @@ +longText('notes')->nullable()->after('status'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('candidates', function (Blueprint $table) { + $table->dropColumn('notes'); + }); + } +}; diff --git a/resources/js/Pages/Admin/Candidates/Show.vue b/resources/js/Pages/Admin/Candidates/Show.vue index 46e6dee..0f93519 100644 --- a/resources/js/Pages/Admin/Candidates/Show.vue +++ b/resources/js/Pages/Admin/Candidates/Show.vue @@ -23,6 +23,10 @@ const docForm = useForm({ _method: 'PUT' // For file upload via PUT in Laravel }); +const notesForm = useForm({ + notes: props.candidate.notes || '' +}); + const openAttempts = ref([]); const toggleAttempt = (id) => { @@ -71,6 +75,12 @@ const updateDocuments = () => { }); }; +const saveNotes = () => { + notesForm.patch(route('admin.candidates.update-notes', props.candidate.id), { + preserveScroll: true, + }); +}; + const openPreview = (doc) => { selectedDocument.value = doc; }; @@ -204,6 +214,42 @@ const openPreview = (doc) => {
+ +
+
+

+ + + + Notes d'entretien & Préparation +

+
+ Modifications non enregistrées + + Enregistrer + +
+
+ + + + Enregistré +
+
+ +
+ +
+ Supporte le texte brut +
+
+
+

Historique des Tests diff --git a/routes/web.php b/routes/web.php index dd88491..e07d6ed 100644 --- a/routes/web.php +++ b/routes/web.php @@ -52,6 +52,7 @@ Route::middleware('auth')->group(function () { Route::middleware('admin')->prefix('admin')->name('admin.')->group(function () { Route::get('/comparative', [\App\Http\Controllers\CandidateController::class, 'comparative'])->name('comparative'); Route::resource('candidates', \App\Http\Controllers\CandidateController::class)->only(['index', 'store', 'show', 'destroy', 'update']); + Route::patch('/candidates/{candidate}/notes', [\App\Http\Controllers\CandidateController::class, 'updateNotes'])->name('candidates.update-notes'); Route::post('/candidates/{candidate}/reset-password', [\App\Http\Controllers\CandidateController::class, 'resetPassword'])->name('candidates.reset-password'); Route::get('/documents/{document}', [\App\Http\Controllers\DocumentController::class, 'show'])->name('documents.show');