Admin: implementation of the 'is_selected' feature for candidates for interviews
This commit is contained in:
@@ -237,6 +237,15 @@ class CandidateController extends Controller
|
||||
$this->storeDocument($candidate, $file, $type);
|
||||
}
|
||||
|
||||
public function toggleSelection(Candidate $candidate)
|
||||
{
|
||||
$candidate->update([
|
||||
'is_selected' => !$candidate->is_selected
|
||||
]);
|
||||
|
||||
return back()->with('success', 'Statut de sélection mis à jour.');
|
||||
}
|
||||
|
||||
private function storeDocument(Candidate $candidate, $file, string $type)
|
||||
{
|
||||
if (!$file) {
|
||||
|
||||
@@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
use App\Traits\BelongsToTenant;
|
||||
|
||||
#[Fillable(['user_id', 'job_position_id', 'phone', 'linkedin_url', 'status', 'notes', 'cv_score', 'motivation_score', 'interview_score', 'ai_analysis', 'tenant_id'])]
|
||||
#[Fillable(['user_id', 'job_position_id', 'phone', 'linkedin_url', 'status', 'is_selected', 'notes', 'cv_score', 'motivation_score', 'interview_score', 'ai_analysis', 'tenant_id'])]
|
||||
class Candidate extends Model
|
||||
{
|
||||
use HasFactory, BelongsToTenant;
|
||||
@@ -30,6 +30,7 @@ class Candidate extends Model
|
||||
|
||||
protected $casts = [
|
||||
'ai_analysis' => 'array',
|
||||
'is_selected' => 'boolean',
|
||||
];
|
||||
|
||||
public function jobPosition(): BelongsTo
|
||||
|
||||
Reference in New Issue
Block a user