61 lines
1.4 KiB
PHP
61 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\Intervention;
|
|
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
|
|
|
interface InterventionRepositoryInterface
|
|
{
|
|
/**
|
|
* Get all interventions with optional filtering and pagination
|
|
*
|
|
* @param array $filters
|
|
* @param int $perPage
|
|
* @return LengthAwarePaginator
|
|
*/
|
|
public function getAllPaginated(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
|
|
|
/**
|
|
* Find an intervention by ID
|
|
*
|
|
* @param int $id
|
|
* @return Intervention
|
|
*/
|
|
public function findById(int $id): Intervention;
|
|
|
|
/**
|
|
* Create a new intervention record
|
|
*
|
|
* @param array $data
|
|
* @return Intervention
|
|
*/
|
|
public function create(array $data): Intervention;
|
|
|
|
/**
|
|
* Update an existing intervention record
|
|
*
|
|
* @param Intervention $intervention
|
|
* @param array $data
|
|
* @return Intervention
|
|
*/
|
|
public function update(Intervention $intervention, array $data): Intervention;
|
|
|
|
/**
|
|
* Delete an intervention record
|
|
*
|
|
* @param Intervention $intervention
|
|
* @return bool
|
|
*/
|
|
public function delete(Intervention $intervention): bool;
|
|
|
|
/**
|
|
* Change the status of an intervention
|
|
*
|
|
* @param Intervention $intervention
|
|
* @param string $status
|
|
* @return Intervention
|
|
*/
|
|
public function changeStatus(Intervention $intervention, string $status): Intervention;
|
|
}
|