function reportArtifactUrl(item = {}, kind) {
	if (kind === 'background') return item.backgroundReportUrl || ''
	if (kind === 'professional') return item.professionalReportUrl || ''
	if (kind === 'public') return item.publicReportUrl || item.fileUrl || ''
	return ''
}

function reportArtifactLinks(item = {}) {
	return {
		background: reportArtifactUrl(item, 'background'),
		professional: reportArtifactUrl(item, 'professional'),
		public: reportArtifactUrl(item, 'public')
	}
}

module.exports = { reportArtifactUrl, reportArtifactLinks }
