first commit
This commit is contained in:
0
Modules/Recruit/app/Http/Controllers/.gitkeep
Normal file
0
Modules/Recruit/app/Http/Controllers/.gitkeep
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Employee\Repositories\EmployeeRepository;
|
||||
use Modules\Recruit\Repositories\InterviewScheduleInterface;
|
||||
use Modules\Recruit\Repositories\InterviewScheduleRepository;
|
||||
use Modules\Recruit\Repositories\JobPostInterface;
|
||||
use Modules\Recruit\Repositories\JobPostRepository;
|
||||
use Yoeunes\Toastr\Facades\Toastr;
|
||||
|
||||
class InterviewScheduleController extends Controller
|
||||
{
|
||||
|
||||
private $interviewScheduleRepository;
|
||||
private $jobPostRepository;
|
||||
private $employeeRepository;
|
||||
public function __construct(InterviewScheduleInterface $interviewScheduleRepository, JobPostInterface $jobPostRepository, EmployeeRepository $employeeRepository)
|
||||
{
|
||||
$this->interviewScheduleRepository = $interviewScheduleRepository;
|
||||
$this->jobPostRepository = $jobPostRepository;
|
||||
$this->employeeRepository = $employeeRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Interview Schedule Lists';
|
||||
$data['interviewScheduleLists'] = $this->interviewScheduleRepository->findAll();
|
||||
return view('recruit::interviewschedules.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create InterviewSchedule';
|
||||
$data['editable'] = false;
|
||||
$data['jobPostLists'] = $this->jobPostRepository->pluck();
|
||||
$data['employeeLists'] = $this->employeeRepository->pluck();
|
||||
|
||||
return view('recruit::interviewschedules.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$request->merge([
|
||||
'createdBy' => auth()->user()->id,
|
||||
]);
|
||||
try {
|
||||
$this->interviewScheduleRepository->create($request->all());
|
||||
toastr()->success('InterviewSchedule Created Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
// return redirect()->route('interviewSchedule.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('recruit::interviewschedules.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit InterviewSchedule';
|
||||
|
||||
$data['editable'] = true;
|
||||
|
||||
$data['jobPostLists'] = $this->jobPostRepository->pluck();
|
||||
|
||||
$data['employeeLists'] = $this->employeeRepository->pluck();
|
||||
|
||||
$data['interviewSchedule'] = $this->interviewScheduleRepository->getInterviewScheduleById($id);
|
||||
|
||||
return view('recruit::interviewschedules.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$inputData = $request->all();
|
||||
try {
|
||||
|
||||
$this->interviewScheduleRepository->update($id, $inputData);
|
||||
toastr()->success('InterviewSchecule Updated Succesfully');
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
return redirect()->route('interviewSchedule.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$this->interviewScheduleRepository->delete($id);
|
||||
|
||||
toastr()->success('InterviewSchecule Deleted Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
//throw $th;
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Admin\Repositories\FieldRepository;
|
||||
use Modules\Recruit\Repositories\JobApplicationInterface;
|
||||
use Modules\Recruit\Repositories\JobApplicationRepository;
|
||||
use Modules\Recruit\Repositories\JobPostInterface;
|
||||
use Modules\Recruit\Repositories\JobPostRepository;
|
||||
use Yoeunes\Toastr\Facades\Toastr;
|
||||
|
||||
class JobApplicationController extends Controller
|
||||
{
|
||||
private $jobApplicationRepository;
|
||||
private $jobPostRepository;
|
||||
|
||||
private $fieldRepository;
|
||||
|
||||
public function __construct(JobApplicationInterface $jobApplicationRepository, JobPostInterface $jobPostRepository, FieldRepository $fieldRepository)
|
||||
{
|
||||
$this->jobApplicationRepository = $jobApplicationRepository;
|
||||
$this->jobPostRepository = $jobPostRepository;
|
||||
$this->fieldRepository = $fieldRepository;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'JobApplication Lists';
|
||||
$data['jobApplicationLists'] = $this->jobApplicationRepository->findAll();
|
||||
return view('recruit::jobapplications.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create JobApplication';
|
||||
$data['editable'] = false;
|
||||
$data['jobPostLists'] = $this->jobPostRepository->pluck();
|
||||
$data['genderLists'] = $this->fieldRepository->getDropdownByAlias('gender');
|
||||
return view('recruit::jobapplications.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$request->mergeIfMissing([
|
||||
'createdBy' => auth()->user()->employee?->id,
|
||||
'status' => 11,
|
||||
|
||||
]);
|
||||
|
||||
try {
|
||||
$this->jobApplicationRepository->create($request->all());
|
||||
toastr()->success('JobApplication Created Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
return redirect()->route('jobApplication.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('recruit::jobapplications.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit JobApplication';
|
||||
|
||||
$data['editable'] = true;
|
||||
|
||||
$data['jobPostLists'] = $this->jobPostRepository->pluck();
|
||||
|
||||
$data['genderLists'] = $this->fieldRepository->getDropdownByAlias('gender');
|
||||
|
||||
|
||||
$data['jobApplication'] = $this->jobApplicationRepository->getJobApplicationById($id);
|
||||
|
||||
return view('recruit::jobapplications.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$request->mergeIfMissing([
|
||||
'updatedBy' => auth()->user()->employee?->id,
|
||||
'status' => 11,
|
||||
]);
|
||||
|
||||
$inputData = $request->all();
|
||||
try {
|
||||
|
||||
$this->jobApplicationRepository->update($id, $inputData);
|
||||
toastr()->success('JobApplication Updated Succesfully');
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
return redirect()->route('jobApplication.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$this->jobApplicationRepository->delete($id);
|
||||
|
||||
toastr()->success('JobApplication Deleted Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
//throw $th;
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
131
Modules/Recruit/app/Http/Controllers/JobPostController.php
Normal file
131
Modules/Recruit/app/Http/Controllers/JobPostController.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Admin\Repositories\DepartmentInterface;
|
||||
use Modules\Admin\Repositories\DesignationInterface;
|
||||
use Modules\Recruit\Repositories\JobPostInterface;
|
||||
use Modules\Recruit\Repositories\JobPostRepository;
|
||||
use Yoeunes\Toastr\Facades\Toastr;
|
||||
|
||||
class JobPostController extends Controller
|
||||
{
|
||||
private $jobPostRepository;
|
||||
private $departmentRepository;
|
||||
private $designationRepository;
|
||||
|
||||
public function __construct(JobPostInterface $jobPostRepository, DepartmentInterface $departmentRepository, DesignationInterface $designationRepository)
|
||||
{
|
||||
$this->jobPostRepository = $jobPostRepository;
|
||||
$this->departmentRepository = $departmentRepository;
|
||||
$this->designationRepository = $designationRepository;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Job Post Lists';
|
||||
$data['jobPostLists'] = $this->jobPostRepository->findAll();
|
||||
|
||||
return view('recruit::jobposts.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create Job Post';
|
||||
$data['editable'] = false;
|
||||
$data['departmentLists'] = $this->departmentRepository->pluck();
|
||||
$data['designationLists'] = $this->designationRepository->pluck();
|
||||
return view('recruit::jobposts.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$request->mergeIfMissing([
|
||||
'createdBy' => auth()->user()->employee?->id,
|
||||
]);
|
||||
|
||||
try {
|
||||
$this->jobPostRepository->create($request->all());
|
||||
toastr()->success('JobPost Created Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
return redirect()->route('jobPost.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('recruit::jobposts.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit Job Post';
|
||||
|
||||
$data['editable'] = true;
|
||||
|
||||
$data['departmentLists'] = $this->departmentRepository->pluck();
|
||||
$data['designationLists'] = $this->designationRepository->pluck();
|
||||
|
||||
$data['jobPost'] = $this->jobPostRepository->getJobPostById($id);
|
||||
|
||||
return view('recruit::jobposts.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$request->mergeIfMissing([
|
||||
'updateBy' => auth()->user()->employee?->id,
|
||||
]);
|
||||
|
||||
$inputData = $request->all();
|
||||
|
||||
try {
|
||||
$this->jobPostRepository->update($id, $inputData);
|
||||
|
||||
toastr()->success('Job Post Updated Succesfully');
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
return redirect()->route('jobPost.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$this->jobPostRepository->delete($id);
|
||||
|
||||
toastr()->success('Job Post Deleted Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
//throw $th;
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
151
Modules/Recruit/app/Http/Controllers/OfferLetterController.php
Normal file
151
Modules/Recruit/app/Http/Controllers/OfferLetterController.php
Normal file
@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Admin\Repositories\DepartmentInterface;
|
||||
use Modules\Admin\Repositories\DepartmentRepository;
|
||||
use Modules\Admin\Repositories\DesignationRepository;
|
||||
use Modules\Admin\Repositories\WorkShiftInterface;
|
||||
use Modules\Admin\Repositories\WorkShiftRepository;
|
||||
use Modules\Employee\Repositories\EmployeeInterface;
|
||||
use Modules\Employee\Repositories\EmployeeRepository;
|
||||
use Modules\Recruit\Repositories\JobApplicationInterface;
|
||||
use Modules\Recruit\Repositories\JobPostInterface;
|
||||
use Modules\Recruit\Repositories\OfferLetterInterface;
|
||||
use Modules\Recruit\Repositories\OfferLetterRepository;
|
||||
use Modules\Recruit\Repositories\JobPostRepository;
|
||||
use Yoeunes\Toastr\Facades\Toastr;
|
||||
|
||||
class OfferLetterController extends Controller
|
||||
{
|
||||
private $offerLetterRepository;
|
||||
private $departmentRepository;
|
||||
private $designationRepository;
|
||||
private $workShiftRepository;
|
||||
private $employeeRepository;
|
||||
private $jobPostRepository;
|
||||
private $jobApplicationRepository;
|
||||
|
||||
public function __construct(OfferLetterInterface $offerLetterRepository, DepartmentInterface $departmentRepository, DesignationRepository $designationRepository, WorkShiftRepository $workShiftRepository, EmployeeInterface $employeeRepository, JobApplicationInterface $jobApplicationRepository, JobPostRepository $jobPostRepository)
|
||||
{
|
||||
$this->offerLetterRepository = $offerLetterRepository;
|
||||
$this->departmentRepository = $departmentRepository;
|
||||
$this->designationRepository = $designationRepository;
|
||||
$this->workShiftRepository = $workShiftRepository;
|
||||
$this->employeeRepository = $employeeRepository;
|
||||
$this->jobPostRepository = $jobPostRepository;
|
||||
$this->jobApplicationRepository = $jobApplicationRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'OfferLetter Lists';
|
||||
$data['offerLetterLists'] = $this->offerLetterRepository->findAll();
|
||||
return view('recruit::offerletters.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create OfferLetter';
|
||||
$data['editable'] = false;
|
||||
$data['workShiftLists'] = $this->workShiftRepository->pluck();
|
||||
$data['designationLists'] = $this->designationRepository->pluck();
|
||||
$data['departmentLists'] = $this->departmentRepository->pluck();
|
||||
$data['employeeLists'] = $this->employeeRepository->pluck();
|
||||
$data['jobPostLists'] = $this->jobPostRepository->pluck();
|
||||
$data['jobApplicationLists'] = $this->jobApplicationRepository->pluck();
|
||||
$data['employeeLists'] = $this->employeeRepository->pluck();
|
||||
|
||||
return view('recruit::offerletters.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$request->merge([
|
||||
'createdBy' => auth()->user()->id,
|
||||
]);
|
||||
try {
|
||||
$this->offerLetterRepository->create($request->all());
|
||||
toastr()->success('OfferLetter Created Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
return redirect()->route('offerLetter.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('recruit::offerletters.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit OfferLetter';
|
||||
|
||||
$data['editable'] = true;
|
||||
|
||||
$data['workShiftLists'] = $this->workShiftRepository->pluck();
|
||||
|
||||
$data['designationLists'] = $this->designationRepository->pluck();
|
||||
|
||||
$data['departmentLists'] = $this->departmentRepository->pluck();
|
||||
|
||||
$data['employeeLists'] = $this->employeeRepository->pluck();
|
||||
|
||||
$data['offerLetter'] = $this->offerLetterRepository->getOfferLetterById($id);
|
||||
|
||||
return view('recruit::offerletters.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$inputData = $request->all();
|
||||
try {
|
||||
|
||||
$this->offerLetterRepository->update($id, $inputData);
|
||||
toastr()->success('InterviewSchecule Updated Succesfully');
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
return redirect()->route('offerLetter.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$this->offerLetterRepository->delete($id);
|
||||
|
||||
toastr()->success('OfferLetter Deleted Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
//throw $th;
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
67
Modules/Recruit/app/Http/Controllers/RecruitController.php
Normal file
67
Modules/Recruit/app/Http/Controllers/RecruitController.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RecruitController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('recruit::index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('recruit::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('recruit::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('recruit::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
0
Modules/Recruit/app/Http/Requests/.gitkeep
Normal file
0
Modules/Recruit/app/Http/Requests/.gitkeep
Normal file
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;'];
|
||||
|
||||
|
||||
}
|
0
Modules/Recruit/app/Observers/.gitkeep
Normal file
0
Modules/Recruit/app/Observers/.gitkeep
Normal file
0
Modules/Recruit/app/Providers/.gitkeep
Normal file
0
Modules/Recruit/app/Providers/.gitkeep
Normal file
127
Modules/Recruit/app/Providers/RecruitServiceProvider.php
Normal file
127
Modules/Recruit/app/Providers/RecruitServiceProvider.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Recruit\Repositories\InterviewScheduleInterface;
|
||||
use Modules\Recruit\Repositories\InterviewScheduleRepository;
|
||||
use Modules\Recruit\Repositories\JobApplicationInterface;
|
||||
use Modules\Recruit\Repositories\JobApplicationRepository;
|
||||
use Modules\Recruit\Repositories\JobPostInterface;
|
||||
use Modules\Recruit\Repositories\JobPostRepository;
|
||||
use Modules\Recruit\Repositories\OfferLetterInterface;
|
||||
use Modules\Recruit\Repositories\OfferLetterRepository;
|
||||
|
||||
class RecruitServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected string $moduleName = 'Recruit';
|
||||
|
||||
protected string $moduleNameLower = 'recruit';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
$this->registerCommands();
|
||||
$this->registerCommandSchedules();
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->bind(OfferLetterInterface::class,OfferLetterRepository::class);
|
||||
$this->app->bind(JobPostInterface::class, JobPostRepository::class);
|
||||
$this->app->bind(JobApplicationInterface::class, JobApplicationRepository::class);
|
||||
$this->app->bind(InterviewScheduleInterface::class, InterviewScheduleRepository::class);
|
||||
$this->app->bind(JobPostInterface::class, JobPostRepository::class);
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register commands in the format of Command::class
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
// $this->commands([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register command Schedules.
|
||||
*/
|
||||
protected function registerCommandSchedules(): void
|
||||
{
|
||||
// $this->app->booted(function () {
|
||||
// $schedule = $this->app->make(Schedule::class);
|
||||
// $schedule->command('inspire')->hourly();
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*/
|
||||
public function registerTranslations(): void
|
||||
{
|
||||
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom($langPath);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*/
|
||||
protected function registerConfig(): void
|
||||
{
|
||||
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower . '.php')], 'config');
|
||||
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*/
|
||||
public function registerViews(): void
|
||||
{
|
||||
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
|
||||
$sourcePath = module_path($this->moduleName, 'resources/views');
|
||||
|
||||
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower . '-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
|
||||
|
||||
$componentNamespace = str_replace('/', '\\', config('modules.namespace') . '\\' . $this->moduleName . '\\' . ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder', '')));
|
||||
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (config('view.paths') as $path) {
|
||||
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
|
||||
$paths[] = $path . '/modules/' . $this->moduleNameLower;
|
||||
}
|
||||
}
|
||||
|
||||
return $paths;
|
||||
}
|
||||
}
|
49
Modules/Recruit/app/Providers/RouteServiceProvider.php
Normal file
49
Modules/Recruit/app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*/
|
||||
public function map(): void
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
Route::middleware('web')->group(module_path('Recruit', '/routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Recruit', '/routes/api.php'));
|
||||
}
|
||||
}
|
0
Modules/Recruit/app/Repositories/.gitkeep
Normal file
0
Modules/Recruit/app/Repositories/.gitkeep
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Repositories;
|
||||
|
||||
interface InterviewScheduleInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getInterviewScheduleById($interviewScheduleId);
|
||||
public function delete($interviewScheduleId);
|
||||
public function create(array $interviewScheduleDetails);
|
||||
public function update($interviewScheduleId, array $newDetails);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Repositories;
|
||||
|
||||
use Modules\Recruit\Models\InterviewSchedule;
|
||||
|
||||
|
||||
class InterviewScheduleRepository implements InterviewScheduleInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return InterviewSchedule::get();
|
||||
}
|
||||
|
||||
public function getInterviewScheduleById($interviewScheduleId)
|
||||
{
|
||||
return InterviewSchedule::findOrFail($interviewScheduleId);
|
||||
}
|
||||
|
||||
public function delete($interviewScheduleId)
|
||||
{
|
||||
InterviewSchedule::destroy($interviewScheduleId);
|
||||
}
|
||||
|
||||
public function create(array $interviewScheduleDetails)
|
||||
{
|
||||
return InterviewSchedule::create($interviewScheduleDetails);
|
||||
}
|
||||
|
||||
public function update($interviewScheduleId, array $newDetails)
|
||||
{
|
||||
return InterviewSchedule::where('interview_schedule_id', $interviewScheduleId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
14
Modules/Recruit/app/Repositories/JobApplicationInterface.php
Normal file
14
Modules/Recruit/app/Repositories/JobApplicationInterface.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Repositories;
|
||||
|
||||
interface JobApplicationInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getJobApplicationById($jobApplicationId);
|
||||
public function delete($jobApplicationId);
|
||||
public function create(array $jobApplicationDetails);
|
||||
public function update($jobApplicationId, array $newDetails);
|
||||
|
||||
public function pluck();
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Repositories;
|
||||
|
||||
use Modules\Recruit\Models\JobApplication;
|
||||
|
||||
|
||||
class JobApplicationRepository implements JobApplicationInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return JobApplication::get();
|
||||
}
|
||||
|
||||
public function getJobApplicationById($jobApplicationId)
|
||||
{
|
||||
return JobApplication::findOrFail($jobApplicationId);
|
||||
}
|
||||
|
||||
public function delete($jobApplicationId)
|
||||
{
|
||||
JobApplication::destroy($jobApplicationId);
|
||||
}
|
||||
|
||||
public function create(array $jobApplicationDetails)
|
||||
{
|
||||
return JobApplication::create($jobApplicationDetails);
|
||||
}
|
||||
|
||||
public function update($jobApplicationId, array $newDetails)
|
||||
{
|
||||
return JobApplication::where('job_application_id', $jobApplicationId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck()
|
||||
{
|
||||
return JobApplication::pluck('name', 'job_application_id');
|
||||
}
|
||||
|
||||
}
|
13
Modules/Recruit/app/Repositories/JobPostInterface.php
Normal file
13
Modules/Recruit/app/Repositories/JobPostInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Repositories;
|
||||
|
||||
interface JobPostInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function pluck();
|
||||
public function getJobPostById($jobPostId);
|
||||
public function delete($jobPostId);
|
||||
public function create(array $jobPostDetails);
|
||||
public function update($jobPostId, array $newDetails);
|
||||
}
|
39
Modules/Recruit/app/Repositories/JobPostRepository.php
Normal file
39
Modules/Recruit/app/Repositories/JobPostRepository.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Repositories;
|
||||
|
||||
use Modules\Recruit\Models\JobPost;
|
||||
|
||||
|
||||
class JobPostRepository implements JobPostInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return JobPost::get();
|
||||
}
|
||||
|
||||
public function getJobPostById($jobPostId)
|
||||
{
|
||||
return JobPost::findOrFail($jobPostId);
|
||||
}
|
||||
|
||||
public function delete($jobPostId)
|
||||
{
|
||||
JobPost::destroy($jobPostId);
|
||||
}
|
||||
|
||||
public function create(array $jobPostDetails)
|
||||
{
|
||||
return JobPost::create($jobPostDetails);
|
||||
}
|
||||
|
||||
public function update($jobPostId, array $newDetails)
|
||||
{
|
||||
return JobPost::where('job_post_id', $jobPostId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck(){
|
||||
return JobPost::pluck('title', 'job_post_id');
|
||||
}
|
||||
|
||||
}
|
13
Modules/Recruit/app/Repositories/OfferLetterInterface.php
Normal file
13
Modules/Recruit/app/Repositories/OfferLetterInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Repositories;
|
||||
|
||||
interface OfferLetterInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function pluck();
|
||||
public function getOfferLetterById($offerLetterId);
|
||||
public function delete($offerLetterId);
|
||||
public function create(array $offerLetterDetails);
|
||||
public function update($offerLetterId, array $newDetails);
|
||||
}
|
40
Modules/Recruit/app/Repositories/OfferLetterRepository.php
Normal file
40
Modules/Recruit/app/Repositories/OfferLetterRepository.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Repositories;
|
||||
|
||||
use Modules\Recruit\Models\OfferLetter;
|
||||
|
||||
|
||||
class OfferLetterRepository implements OfferLetterInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return OfferLetter::get();
|
||||
}
|
||||
|
||||
public function getOfferLetterById($offerLetterId)
|
||||
{
|
||||
return OfferLetter::findOrFail($offerLetterId);
|
||||
}
|
||||
|
||||
public function delete($offerLetterId)
|
||||
{
|
||||
OfferLetter::destroy($offerLetterId);
|
||||
}
|
||||
|
||||
public function create(array $offerLetterDetails)
|
||||
{
|
||||
return OfferLetter::create($offerLetterDetails);
|
||||
}
|
||||
|
||||
public function update($offerLetterId, array $newDetails)
|
||||
{
|
||||
return OfferLetter::where('offer_letter_id', $offerLetterId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck()
|
||||
{
|
||||
return OfferLetter::pluck('title', 'offer_letter_id');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user