package space.nstart.pcp.pcp_types_lib.utils.json

import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.JsonSerializer
import com.fasterxml.jackson.databind.SerializerProvider
import space.nstart.pcp.pcp_types_lib.message.KafkaEvent

class KafkaEventSerializer: JsonSerializer<KafkaEvent>() {
    override fun serialize(value: KafkaEvent, gen: JsonGenerator, serializers: SerializerProvider) {
        gen.writeString(value.enumCast()?.name)
    }
}