using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TIAM.Entities.Permissions;
using TIAM.Entities.Products;
using TIAM.Entities.ServiceProviders;
using TIAM.Models.Dtos.Products;

namespace TIAMWebApp.Shared.Application.Interfaces
{
    public interface IPermissionService
    {
        //1. create a permission to be assigned to users to access a context
        public Task CreatePermissionForContextByContextIdAsync(Guid contextId);

        //2. get the contexts where the user has permission
        public Task<List<AssignedPermissionModel>> GetPermissionContextsByUserIdAsync(Guid userId);

        //3. get the users who have permission for a context
        public Task<List<AssignedPermissionModel>> GetPermissionsForContextByContextIdAsync(Guid contextId);

        //4. give a user permission to access a context
        public Task AssignPermissionToUserForContextAsync(Guid contextId, Guid userId);

        //5. remove a user's permission to access a context
        public Task RemovePermissionFromUserByContextIdAsync(Guid contextId, Guid permissionId, Guid userId);

        //6. remove all permissions of a user for a context
        public Task RemoveAllPermissionsByContextIdAsync(Guid contextId, Guid userId);

        //7. remove all permissions of a user (BAN user from all contexts, even the system)
        public Task RemoveAllPermissionsByUserIdAsync(Guid userId);

        //8. create permission group
        public Task CreatePermissionGroupForContextAsync(Guid contextId, string name);

        //9. add user to permission group
        public Task AddUserToPermissionGroupAsync(Guid permissionGroupId, Guid userId);

        //10. create permission type
        public Task<bool> CreatePermissionTypeAsync(string name, Guid contextId);

        //11. get permission types for context
        public Task<List<PermissionsType>>? GetPermissionTypesForContextByContextIdAsync(Guid contextId);

        //12. get permission groups for context
        public Task GetPermissionGroupsForContextByContextIdAsync(Guid contextId);

        
    }
}
