package com.ffii.fpsms.modules.productProcess.enums

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

@Converter(autoApply = true)
class ProductProcessStatusConverter : AttributeConverter<ProductProcessStatus, String> {
    override fun convertToDatabaseColumn(attribute: ProductProcessStatus?): String? {
        return attribute?.value
    }

    override fun convertToEntityAttribute(dbData: String?): ProductProcessStatus? {
        return dbData?.let { ProductProcessStatus.fromValue(it) }
    }
}