security-c4po/security-c4po-api/src/main/kotlin/com/securityc4po/api/pentest/Pentest.kt

31 lines
843 B
Kotlin

package com.securityc4po.api.pentest
import com.securityc4po.api.ResponseBody
import org.springframework.data.mongodb.core.index.Indexed
import java.util.UUID
data class Pentest(
@Indexed(background = true, unique = true)
val id: String = UUID.randomUUID().toString(),
val projectId: String,
val category: PentestCategory,
val title: String,
val refNumber: String,
val status: PentestStatus,
val findingIds: List<String> = emptyList(),
val commentIds: List<String> = emptyList()
)
fun Pentest.toPentestResponseBody(): ResponseBody {
return mapOf(
"id" to id,
"projectId" to projectId,
"category" to category,
"title" to title,
"refNumber" to refNumber,
"status" to status,
"findingIds" to findingIds,
"commentIds" to commentIds
)
}