feat: implementation du role Gestionnaire RH et refonte de la gestion des offres

This commit is contained in:
jeremy bayse
2026-05-09 11:21:40 +02:00
parent 97a8b9443d
commit 9edf79e8ba
23 changed files with 1223 additions and 232 deletions

View File

@@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Traits\BelongsToTenant;
#[Fillable(['user_id', 'job_position_id', 'phone', 'linkedin_url', 'city', 'status', 'is_selected', 'sort_order', 'notes', 'cv_score', 'motivation_score', 'interview_score', 'interview_details', 'ai_analysis', 'tenant_id'])]
#[Fillable(['user_id', 'job_position_id', 'birth_name', 'usage_name', 'first_name', 'address', 'zip_code', 'phone', 'linkedin_url', 'city', 'birth_date', 'birth_place', 'nationality', 'current_situation', 'education_level', 'has_driving_license', 'status', 'is_selected', 'sort_order', 'notes', 'cv_score', 'motivation_score', 'interview_score', 'interview_details', 'ai_analysis', 'tenant_id'])]
class Candidate extends Model
{
use HasFactory, BelongsToTenant;
@@ -31,6 +31,7 @@ class Candidate extends Model
protected $casts = [
'ai_analysis' => 'array',
'is_selected' => 'boolean',
'has_driving_license' => 'boolean',
'interview_details' => 'array',
];

View File

@@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Traits\BelongsToTenant;
#[Fillable(['title', 'description', 'requirements', 'ai_prompt', 'ai_bypass_base_prompt', 'gemini_cache_id', 'gemini_cache_expires_at', 'tenant_id', 'fpt_metadata'])]
#[Fillable(['title', 'description', 'requirements', 'ai_prompt', 'ai_bypass_base_prompt', 'gemini_cache_id', 'gemini_cache_expires_at', 'tenant_id', 'fpt_metadata', 'expires_at'])]
class JobPosition extends Model
{
use HasFactory, BelongsToTenant;
@@ -19,6 +19,7 @@ class JobPosition extends Model
'ai_bypass_base_prompt' => 'boolean',
'gemini_cache_expires_at' => 'datetime',
'fpt_metadata' => 'array',
'expires_at' => 'datetime',
];
public function candidates(): HasMany

View File

@@ -19,7 +19,7 @@ class User extends Authenticatable
public function isAdmin(): bool
{
return in_array($this->role, ['admin', 'super_admin']);
return in_array($this->role, ['admin', 'super_admin', 'gestionnaire_rh']);
}
public function isSuperAdmin(): bool
@@ -27,6 +27,11 @@ class User extends Authenticatable
return $this->role === 'super_admin';
}
public function isGestionnaireRH(): bool
{
return $this->role === 'gestionnaire_rh';
}
public function isCandidate(): bool
{
return $this->role === 'candidate';