first commit
This commit is contained in:
0
Modules/Recruit/app/Models/.gitkeep
Normal file
0
Modules/Recruit/app/Models/.gitkeep
Normal file
55
Modules/Recruit/app/Models/InterviewSchedule.php
Normal file
55
Modules/Recruit/app/Models/InterviewSchedule.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Models;
|
||||
|
||||
use App\Observers\InterviewScheduleObserver;
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Recruit\Database\factories\InterviewScheduleFactory;
|
||||
|
||||
#[ObservedBy([InterviewScheduleObserver::class])]
|
||||
class InterviewSchedule extends Model
|
||||
{
|
||||
use HasFactory, StatusTrait;
|
||||
|
||||
protected $table = 'tbl_interview_schedules';
|
||||
protected $primaryKey = 'interview_schedule_id';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'job_post_id',
|
||||
'interviewer_choices',
|
||||
'interviewer_approved',
|
||||
'scheduled_date',
|
||||
'scheduled_time',
|
||||
'arranged_date',
|
||||
'interview_mode',
|
||||
'arranged_by',
|
||||
'createdBy',
|
||||
'updatedBy',
|
||||
'status',
|
||||
'description',
|
||||
'remarks',
|
||||
];
|
||||
|
||||
public $appends = ['status_name'];
|
||||
|
||||
protected $casts = [
|
||||
'interviewer_choices' => 'array',
|
||||
'interviewer_approved' => 'array',
|
||||
'arranged_date' => 'date',
|
||||
'scheduled_time' => 'datetime',
|
||||
|
||||
];
|
||||
|
||||
public function jobPost()
|
||||
{
|
||||
return $this->belongsTo(JobPost::class, 'job_post_id');
|
||||
}
|
||||
|
||||
|
||||
}
|
55
Modules/Recruit/app/Models/JobApplication.php
Normal file
55
Modules/Recruit/app/Models/JobApplication.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Models;
|
||||
|
||||
use App\Models\Document;
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Modules\Recruit\Database\factories\JobApplicationFactory;
|
||||
|
||||
class JobApplication extends Model
|
||||
{
|
||||
use HasFactory, StatusTrait, Notifiable;
|
||||
|
||||
protected $table = 'tbl_job_applications';
|
||||
protected $primaryKey = 'job_application_id';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'address',
|
||||
'phone',
|
||||
'email',
|
||||
'gender',
|
||||
'job_post_id',
|
||||
'working_experience',
|
||||
'prev_company',
|
||||
'working_mode',
|
||||
'working_type',
|
||||
'working_shift',
|
||||
'apply_date',
|
||||
'recommended_by',
|
||||
'status',
|
||||
'description',
|
||||
'remarks',
|
||||
'createdBy',
|
||||
'updatedBy',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'apply_date' => 'date',
|
||||
];
|
||||
public $appends = ['status_name'];
|
||||
public function jobPost()
|
||||
{
|
||||
return $this->belongsTo(JobPost::class, 'job_post_id');
|
||||
}
|
||||
|
||||
public function documents()
|
||||
{
|
||||
return $this->morphMany(Document::class, 'documentable');
|
||||
}
|
||||
}
|
69
Modules/Recruit/app/Models/JobPost.php
Normal file
69
Modules/Recruit/app/Models/JobPost.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Admin\Models\Department;
|
||||
use Modules\Admin\Models\Departments;
|
||||
use Modules\Admin\Models\Designation;
|
||||
use Modules\Admin\Models\Designations;
|
||||
use Modules\Employee\Models\Employee;
|
||||
use Modules\Recruit\Database\factories\JobPostFactory;
|
||||
|
||||
class JobPost extends Model
|
||||
{
|
||||
|
||||
use StatusTrait;
|
||||
|
||||
protected $table = 'tbl_job_posts';
|
||||
protected $primaryKey = 'job_post_id';
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'alias',
|
||||
'vacancy_no',
|
||||
'department_id',
|
||||
'designation_id',
|
||||
'post_date',
|
||||
'expiry_date',
|
||||
'status',
|
||||
'description',
|
||||
'remarks',
|
||||
'createdBy',
|
||||
'updateBy',
|
||||
];
|
||||
|
||||
public $appends = ['status_name'];
|
||||
|
||||
public function department()
|
||||
{
|
||||
return $this->belongsTo(Department::class, 'department_id');
|
||||
}
|
||||
|
||||
public function designation()
|
||||
{
|
||||
return $this->belongsTo(Designation::class, 'designation_id');
|
||||
}
|
||||
|
||||
public function jobPoster()
|
||||
{
|
||||
return $this->belongsTo(Employee::class, 'createdBy');
|
||||
}
|
||||
|
||||
public function interviewSchedules()
|
||||
{
|
||||
return $this->hasMany(InterviewSchedule::class, 'job_post_id');
|
||||
}
|
||||
|
||||
public function jobApplications()
|
||||
{
|
||||
return $this->hasMany(JobApplication::class, 'job_post_id');
|
||||
}
|
||||
|
||||
}
|
39
Modules/Recruit/app/Models/OfferLetter.php
Normal file
39
Modules/Recruit/app/Models/OfferLetter.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Recruit\Database\factories\OfferLetterFactory;
|
||||
|
||||
class OfferLetter extends Model
|
||||
{
|
||||
use HasFactory, StatusTrait;
|
||||
|
||||
protected $table = 'tbl_offer_letters';
|
||||
protected $primaryKey = "offer_letter_id";
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'applicant_name',
|
||||
'department_id',
|
||||
'designation_id',
|
||||
'working_shift_id',
|
||||
'salary',
|
||||
'contract_time_period',
|
||||
'joining_date',
|
||||
'issued_date',
|
||||
'issued_by',
|
||||
'createdBy',
|
||||
'updatedBy',
|
||||
'description',
|
||||
'remarks',
|
||||
];
|
||||
|
||||
public $appends = ['status_name;'];
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user