Files
My-KOPKB/be/Modules/User/Repositories/Contracts/UserRepositoryInterface.php
T

72 lines
1.6 KiB
PHP

<?php
namespace Modules\User\Repositories\Contracts;
use Illuminate\Database\Eloquent\Collection;
use Modules\Auth\Entities\User;
interface UserRepositoryInterface
{
/**
* Get all Users with pagination and search
*/
public function getAllPaginated(int $perPage = 10, string $search = '');
/**
* Get all Users with their relationships and pagination with search
*/
public function getAllWithRelationsPaginated(
int $perPage = 10,
string $search = '',
string $status = '',
string $sortBy = 'name',
string $sortOrder = 'asc'
);
/**
* Get all Users with their relationships and search
*/
public function getAllWithRelations(string $search = ''): Collection;
/**
* Create a new User
*/
public function create(array $data): User;
/**
* Find User by ID
*/
public function findById(string $id): ?User;
/**
* Delete User (soft delete)
*/
public function delete(string $id): bool;
/**
* Get soft-deleted Users with their relationships and pagination
*/
public function getDeletedWithRelationsPaginated(
int $perPage = 10,
string $search = '',
string $status = '',
string $sortBy = 'deleted_at',
string $sortOrder = 'desc'
);
/**
* Find soft-deleted User by ID
*/
public function findTrashedById(string $id): ?User;
/**
* Restore a soft-deleted User
*/
public function restore(string $id): bool;
/**
* Get all Users
*/
public function all(string $search = ''): Collection;
}