package dev.inmo.postssystem.features.roles.common

import dev.inmo.postssystem.features.users.common.UserId
import kotlinx.serialization.Serializable
import kotlinx.serialization.builtins.ListSerializer

const val usersRolesRootPathPart = "roles"

val RoleSubjectsSerializer = ListSerializer(RoleSubject.serializer())

const val usersRolesRoleQueryParameterName = "userRole"
const val usersRolesRoleSubjectQueryParameterName = "subject"

const val usersRolesGetSubjectsPathPart = "getSubjectsByRole"
const val usersRolesGetRolesPathPart = "getSubjectRoles"
const val usersRolesContainsPathPart = "contains"
const val usersRolesContainsAnyPathPart = "containsAny"

const val usersRolesIncludePathPart = "include"
const val usersRolesExcludePathPart = "exclude"

@Serializable
data class RolesStorageIncludeExcludeWrapper<T : Role>(
    val subject: RoleSubject,
    val userRole: T
)
