package com.ffii.fpsms.modules.master.enums

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

@Converter(autoApply = true)
class BomStatusConverter : AttributeConverter<BomStatus, String> {
    override fun convertToDatabaseColumn(attribute: BomStatus?): String? = attribute?.value

    override fun convertToEntityAttribute(dbData: String?): BomStatus? =
        dbData?.let { BomStatus.fromValue(it) }
}
