package dp.kotul.templategroupsbackend.model.solrsearch.tamplategroup

import com.fasterxml.jackson.annotation.JsonAlias
import com.fasterxml.jackson.annotation.JsonProperty
import dp.kotul.solrapimodel.solrsearch.TemplateType
import java.time.Instant

data class TemplateGroupSolr(
        @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
        val id: String,
        val assetType: String,
        @JsonAlias("templateGroupId", "org_id")
        val templateGroupId: Int,
        @JsonAlias("templateTypes", "template_types_ss")
        val templateTypes: List<TemplateType> = emptyList(),
        @JsonAlias("templateCount", "template_count_i")
        val templateCount: Int,
        @JsonAlias("name", "title")
        val name: String,
        @JsonAlias("createdDate", "created_date")
        val createdDate: Instant,
        @JsonAlias("lastModified", "modified_date")
        val lastModified: Instant
) {
        val types = templateTypes.map { it.value }
}
