package com.ffii.fpsms.modules.stock.enums

import jakarta.persistence.AttributeConverter
import jakarta.persistence.Converter

// Escalation Log Status
@Converter(autoApply = true)
class EscalationLogStatusConverter : AttributeConverter<EscalationLogStatus, String>{
    override fun convertToDatabaseColumn(status: EscalationLogStatus?): String? {
        return status?.value
    }

    override fun convertToEntityAttribute(value: String?): EscalationLogStatus? {
        return value?.let { v ->
            EscalationLogStatus.entries.find { it.value == v }
        }
    }
}