import { type ListFrontEndInterface } from './CommonType'

export interface UserRightsListInterface {
    userList: ListFrontEndInterface[]
    userRightsList: UserRightsListDataTypeInterface[]
    userRightsListCount: number
}

export interface UserRightsListDataTypeInterface
    extends UserRightsFormDataInterface {
    userId: number
    rightPermissionList: RightPermission[]
    key: React.Key
}

export interface UserRightsFormDataInterface {
    rightId: number
    rightCode: string
    rightDescription: string
    permissionValue: string
    rightPermissionList: RightPermission[]
}
export interface RightPermission {
    rightPermissionDescription: string
    rightPermissionId: number
}
export interface UserRightsFormInterface {
    onSave: (
        data: UserRightsFormDataInterface,
        callBack: CallableFunction
    ) => void
    editData: UserRightsFormDataInterface
}

export interface UserRightsPayloadInterface {
    data: UserRightsFormDataInterface[]
    noOfRecords: number
}
export interface ApiResponse {
    statusCode: number
    noOfRecords: number
    data: UserRightsFormDataInterface[]
    error: ErrorData[] | null
    rightsViewList: any[]
}
export interface ErrorData {
    source: string
    code: number
    message: string
}
