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
    )
}
