first commit

This commit is contained in:
Sampanna Rimal
2024-08-27 17:48:06 +05:45
commit 53c0140f58
10839 changed files with 1125847 additions and 0 deletions

View File

@ -0,0 +1,51 @@
<?php
namespace App\Observers;
use App\Notifications\HrActionNotification;
use Modules\Admin\Models\Appreciation;
use Modules\Employee\Models\Employee;
class AppreciationObserver
{
/**
* Handle the Appreciation "created" event.
*/
public function created(Appreciation $appreciation): void
{
$appreciatee = $appreciation->appreciatee;
$appreciatee->notify(new HrActionNotification('appreciation', $appreciation,'you have been appreciated.'));
}
/**
* Handle the Appreciation "updated" event.
*/
public function updated(Appreciation $appreciation): void
{
//
}
/**
* Handle the Appreciation "deleted" event.
*/
public function deleted(Appreciation $appreciation): void
{
//
}
/**
* Handle the Appreciation "restored" event.
*/
public function restored(Appreciation $appreciation): void
{
//
}
/**
* Handle the Appreciation "force deleted" event.
*/
public function forceDeleted(Appreciation $appreciation): void
{
//
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace App\Observers;
use App\Notifications\HrActionNotification;
use Modules\Employee\Models\Employee;
use Modules\Recruit\Models\InterviewSchedule;
class InterviewScheduleObserver
{
/**
* Handle the InterviewSchedule "created" event.
*/
public function created(InterviewSchedule $interviewSchedule): void
{
$interviewers = Employee::whereIn('id', $interviewSchedule->interviewer_choices)->get();
$interviewers->each->notify(new HrActionNotification('interviewer', $interviewSchedule,'you have been selected as interviewer'));
$interviewSchedule->jobPost->jobApplications->each->notify(new HrActionNotification('interviewee', $interviewSchedule,'you interview has been scheduled'));
}
/**
* Handle the InterviewSchedule "updated" event.
*/
public function updated(InterviewSchedule $interviewSchedule): void
{
//
}
/**
* Handle the InterviewSchedule "deleted" event.
*/
public function deleted(InterviewSchedule $interviewSchedule): void
{
//
}
/**
* Handle the InterviewSchedule "restored" event.
*/
public function restored(InterviewSchedule $interviewSchedule): void
{
//
}
/**
* Handle the InterviewSchedule "force deleted" event.
*/
public function forceDeleted(InterviewSchedule $interviewSchedule): void
{
//
}
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Observers;
use App\Notifications\HrActionNotification;
use Modules\Admin\Models\PromotionDemotion;
use Modules\Employee\Models\Employee;
class PromotionDemotionObserver
{
/**
* Handle the PromotionDemotion "created" event.
*/
public function created(PromotionDemotion $promotionDemotion): void
{
$employee = $promotionDemotion->employee;
$employee->notify(new HrActionNotification($promotionDemotion->type, $promotionDemotion,'You have been promoted'));
}
/**
* Handle the PromotionDemotion "updated" event.
*/
public function updated(PromotionDemotion $promotionDemotion): void
{
//
}
/**
* Handle the PromotionDemotion "deleted" event.
*/
public function deleted(PromotionDemotion $promotionDemotion): void
{
//
}
/**
* Handle the PromotionDemotion "restored" event.
*/
public function restored(PromotionDemotion $promotionDemotion): void
{
//
}
/**
* Handle the PromotionDemotion "force deleted" event.
*/
public function forceDeleted(PromotionDemotion $promotionDemotion): void
{
//
}
}

View File

@ -0,0 +1,50 @@
<?php
namespace App\Observers;
use App\Notifications\HrActionNotification;
use Modules\Admin\Models\Warning;
class WarningObserver
{
/**
* Handle the Warning "created" event.
*/
public function created(Warning $warning): void
{
$employee = $warning->warningRecipient;
$employee->notify(new HrActionNotification('warning', $warning,'you have been warned'));
}
/**
* Handle the Warning "updated" event.
*/
public function updated(Warning $warning): void
{
//
}
/**
* Handle the Warning "deleted" event.
*/
public function deleted(Warning $warning): void
{
//
}
/**
* Handle the Warning "restored" event.
*/
public function restored(Warning $warning): void
{
//
}
/**
* Handle the Warning "force deleted" event.
*/
public function forceDeleted(Warning $warning): void
{
//
}
}