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

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

// Suggested Pick Lot Type
@Converter(autoApply = true)
class SuggestedPickLotTypeConverter : AttributeConverter<SuggestedPickLotType, String>{
    override fun convertToDatabaseColumn(status: SuggestedPickLotType?): String? {
        return status?.value
    }

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