<?php

declare(strict_types=1);

namespace App\Contracts\Services;

use App\Models\User;
use Illuminate\Support\Collection;

interface PermissionServiceInterface
{
    /**
     * Assign a role to a user
     */
    public function assignRole(User $user, string $role): void;

    /**
     * Assign multiple roles to a user
     *
     * @param  array<string>  $roles
     */
    public function assignRoles(User $user, array $roles): void;

    /**
     * Remove a role from a user
     */
    public function removeRole(User $user, string $role): void;

    /**
     * Check if user has a specific role
     */
    public function hasRole(User $user, string $role): bool;

    /**
     * Check if user has any of the given roles
     *
     * @param  array<string>  $roles
     */
    public function hasAnyRole(User $user, array $roles): bool;

    /**
     * Check if user has all of the given roles
     *
     * @param  array<string>  $roles
     */
    public function hasAllRoles(User $user, array $roles): bool;

    /**
     * Get all roles for a user
     *
     * @return Collection<int, \Spatie\Permission\Models\Role>
     */
    public function getUserRoles(User $user): Collection;

    /**
     * Get all available roles in the system
     *
     * @return Collection<int, \Spatie\Permission\Models\Role>
     */
    public function getAllRoles(): Collection;

    /**
     * Check if user is an admin
     */
    public function isAdmin(User $user): bool;

    /**
     * Check if user is a guest
     */
    public function isGuest(User $user): bool;

    /**
     * Check if user is an owner
     */
    public function isOwner(User $user): bool;

    /**
     * Check if user is a partner
     */
    public function isPartner(User $user): bool;
}
