83 lines
1.7 KiB
PHP
83 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\Employee;
|
|
use Illuminate\Support\Collection;
|
|
|
|
/**
|
|
* Contract for Employee repository operations.
|
|
*/
|
|
interface EmployeeRepositoryInterface
|
|
{
|
|
/**
|
|
* Get all employees with optional filtering.
|
|
*
|
|
* @param array<string, mixed> $filters
|
|
* @return Collection<int, Employee>
|
|
*/
|
|
public function getAll(array $filters = []): Collection;
|
|
|
|
/**
|
|
* Find an employee by ID.
|
|
*
|
|
* @param int $id
|
|
* @return Employee|null
|
|
*/
|
|
public function findById(int $id): ?Employee;
|
|
|
|
/**
|
|
* Find an employee by email.
|
|
*
|
|
* @param string $email
|
|
* @return Employee|null
|
|
*/
|
|
public function findByEmail(string $email): ?Employee;
|
|
|
|
/**
|
|
* Get active employees only.
|
|
*
|
|
* @return Collection<int, Employee>
|
|
*/
|
|
public function getActive(): Collection;
|
|
|
|
/**
|
|
* Get inactive employees only.
|
|
*
|
|
* @return Collection<int, Employee>
|
|
*/
|
|
public function getInactive(): Collection;
|
|
|
|
/**
|
|
* Search employees by term.
|
|
*
|
|
* @param string $term
|
|
* @return Collection<int, Employee>
|
|
*/
|
|
public function search(string $term): Collection;
|
|
|
|
/**
|
|
* Get employees with pagination.
|
|
*
|
|
* @param int $perPage
|
|
* @return array{employees: Collection<int, Employee>, pagination: array}
|
|
*/
|
|
public function getPaginated(int $perPage = 10): array;
|
|
|
|
/**
|
|
* Get employees with their thanatopractitioner data.
|
|
*
|
|
* @return Collection<int, Employee>
|
|
*/
|
|
public function getWithThanatopractitioner(): Collection;
|
|
|
|
/**
|
|
* Get employee statistics.
|
|
*
|
|
* @return array<string, int>
|
|
*/
|
|
public function getStatistics(): array;
|
|
}
|