61 lines
1.3 KiB
PHP
61 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\Deceased;
|
|
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
|
|
interface DeceasedRepositoryInterface
|
|
{
|
|
/**
|
|
* Get all deceased with optional filtering and pagination
|
|
*
|
|
* @param array $filters
|
|
* @param int $perPage
|
|
* @return LengthAwarePaginator
|
|
*/
|
|
public function getAllPaginated(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
|
|
|
/**
|
|
* Find a deceased by ID
|
|
*
|
|
* @param int $id
|
|
* @return Deceased
|
|
*/
|
|
public function findById(int $id): Deceased;
|
|
|
|
/**
|
|
* Create a new deceased record
|
|
*
|
|
* @param array $data
|
|
* @return Deceased
|
|
*/
|
|
public function create(array $data): Deceased;
|
|
|
|
/**
|
|
* Update an existing deceased record
|
|
*
|
|
* @param Deceased $deceased
|
|
* @param array $data
|
|
* @return Deceased
|
|
*/
|
|
public function update(Deceased $deceased, array $data): Deceased;
|
|
|
|
/**
|
|
* Delete a deceased record
|
|
*
|
|
* @param Deceased $deceased
|
|
* @return bool
|
|
*/
|
|
public function delete(Deceased $deceased): bool;
|
|
|
|
/**
|
|
* Search deceased by name
|
|
*
|
|
* @param string $name
|
|
* @return Collection
|
|
*/
|
|
public function searchByName(string $name): Collection;
|
|
}
|