

export interface EgovUser {
    id: number
    email: string
    firstname: string
    lastname: string,
    hasEmergencyPassword?: boolean
    roles: Role[];
    permissions: Permissions
    permissions_plain: any
    microservice_permissions: MicroservicePermissions
    quickAccess: string[]
    personalNote: any
    defaultSignature:any
    profile_settings: Record<string, boolean>
}

// interface ProfileSettings

export interface Translations {
    'roles' : Record<Role, {
        view_name: string,

    }>,
    'microservices' : Record<Microservice, {
        'view_name': string
        description: string
    }>,
    'modules' : Record<string, {
        filepath?: string
        'view_name': string
        description: string
    }>,
    'permissions' : Record<string, {
        'view_name': string
    }>,
}

export type Permissions = Record<Role, RolePermissions>

export type RolePermissions = Record<string, ModulePermissions>

interface ModulePermissions {
    default_view: string
    permissions : string[]
    quick: string[]
    rules: {
        [key: string]: boolean
    }
}

export type Role = 'dua_user' | 'president' | 'director' | 'researcher' | 'gate_keeper' | 'network_manager' | 'demo_role' | 'help_desk';
export type Microservice = 'rescom' | 'ilyda' | 'riview' | 'contacts' | 'papyros' | 'notifications' | 'dpass'  | 'settings';

export type MicroservicePermissions = Partial<Record<Microservice , string[]>>

export interface AppSettings  {
    ldapIsDown : boolean,
    loginIsDisabled: boolean,
}

