Files

84 lines
1.9 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',
array $dateFilters = []
);
/**
* 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'
);
/**
* Get stats for the Users list (filtered).
*
* @return array{total: int, joined_this_month: int}
*/
public function getListStats(
string $search = '',
string $status = '',
array $dateFilters = []
): array;
/**
* 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;
}