const capabilities = {
    ADMIN: {
        defaultAdminTab: 'dashboard',
        adminTabs: ['dashboard', 'teacher-requests', 'schedule', 'academic-calendar', 'auditorium-workload', 'schedule-view', 'classrooms', 'groups', 'university-structure', 'subjects', 'users'],
        defaultSettingsTab: 'general',
        settingsTabs: ['general', 'time-slots', 'database', 'edu-forms']
    },
    EDUCATION_OFFICE: {
        defaultAdminTab: 'dashboard',
        adminTabs: ['dashboard', 'schedule', 'academic-calendar', 'auditorium-workload', 'schedule-view', 'classrooms'],
        defaultSettingsTab: 'time-slots',
        settingsTabs: ['time-slots', 'edu-forms']
    },
    DEPARTMENT: {
        defaultAdminTab: 'department-workspace',
        adminTabs: ['department-workspace', 'schedule-view'],
        defaultSettingsTab: null,
        settingsTabs: []
    },
    SCHEDULE_VIEWER: {
        defaultAdminTab: 'schedule-view',
        adminTabs: ['schedule-view'],
        defaultSettingsTab: null,
        settingsTabs: []
    }
};

export const ROLE_CAPABILITIES = Object.freeze(
    Object.fromEntries(Object.entries(capabilities).map(([role, value]) => [
        role,
        Object.freeze({
            ...value,
            adminTabs: Object.freeze([...value.adminTabs]),
            settingsTabs: Object.freeze([...value.settingsTabs])
        })
    ]))
);

export const ADMIN_APP_ROLES = Object.freeze(Object.keys(ROLE_CAPABILITIES));
export const SETTINGS_ROLES = Object.freeze(
    ADMIN_APP_ROLES.filter(role => ROLE_CAPABILITIES[role].settingsTabs.length > 0)
);

export function capabilitiesForRole(role) {
    return ROLE_CAPABILITIES[role] || null;
}
