addRolesAndFeatures = function(entity) {
    let roleAndFeatureContent = ''
    if (entity.roles && entity.roles.length > 0) {
        roleAndFeatureContent += ` ${entity.roles.length > 1 ? `hasRoles` : `hasRole`} `;
        entity.roles.forEach(item => {
            roleAndFeatureContent += item.includes(' ') ? `"${item}",` : `${item},`;
        })
    }
    roleAndFeatureContent = roleAndFeatureContent.substring(0, roleAndFeatureContent.length - 1);
    if (!entity.features || entity.features.length <= 0) {
        return roleAndFeatureContent
    }

    let featuresList = new Array();
    entity.features.forEach(item => {
        if (item.featureName) featuresList.push(item.featureName);
        if (item.modelName) {
            if (item.isRequired !== undefined) {
                if (item.isRequired !== true) 
                    featuresList.push(item.modelName);
            } else {
                featuresList.push(item.modelName);
            }
        }
    })
    if (featuresList.length > 0) {
        roleAndFeatureContent += ` ${featuresList.length > 1 ? `usesFeatures` : `usesFeature`} `;
        featuresList.forEach(feature => {
            roleAndFeatureContent += feature.includes(' ') ? `"${feature}",` : `${feature},`;
        });
        roleAndFeatureContent = roleAndFeatureContent.substring(0, roleAndFeatureContent.length - 1);
    }
    
    //${featuresList.join(',')}`;
    return roleAndFeatureContent
}
Helper to construt role and features list for an entity
@param {Object} entity 
@returns {String} file content to include.