package com.dowstats.data.dto.controllers

import com.dowstats.data.dto.controllers.EntityCompressDtoObject.compressDto
import com.dowstats.data.entities.sergant.Sergeant

data class SergeantUnitShortDto(
    val id: Long?,
    val filename: String,
    val name: String?,
    val icon: String?,
    val unit: EntityCompressDto
)

object SergeantUnitShortDtoObject{
    fun MutableSet<Sergeant>.toShortDtoSet() =
        this.map {
            SergeantUnitShortDto(
                it.id!!,
                it.filename!!,
                it.name,
                it.icon,
                it.unit!!.compressDto()
            )
        }.toSet()
}