commonMain.com.saveourtool.save.entities.vulnerability.VulnerabilityDto.kt Maven / Gradle / Ivy
The newest version!
package com.saveourtool.save.entities.vulnerability
import com.saveourtool.save.entities.OrganizationDto
import com.saveourtool.save.info.UserInfo
import kotlinx.serialization.Serializable
/**
* @property name name of vulnerability
* @property progress vulnerability criticality percentage
* @property projects links to projects with this vulnerability
* @property description description of vulnerability
* @property userId creator vulnerability
* @property shortDescription
* @property relatedLink
* @property language
* @property vulnerabilityIdentifier original identifier of vulnerability
* @property organization
* @property dates
* @property status
* @property participants
*/
@Serializable
data class VulnerabilityDto(
val name: String,
val vulnerabilityIdentifier: String?,
val progress: Int,
val projects: List,
val description: String?,
val shortDescription: String,
val relatedLink: String?,
val language: VulnerabilityLanguage,
val userId: Long,
val organization: OrganizationDto?,
val dates: List,
val participants: List,
val status: VulnerabilityStatus,
) {
/**
* @return map where key is LocalDateTime and value is a label of LocalDateTime
*/
fun getDatesWithLabels() = dates.associate { it.date to it.type.value }
companion object {
val empty = VulnerabilityDto(
"",
"",
0,
emptyList(),
"",
"",
null,
VulnerabilityLanguage.OTHER,
-1,
null,
emptyList(),
emptyList(),
VulnerabilityStatus.CREATED,
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy