package app.voltplan.cable.data.db

import androidx.room.TypeConverter

/** Stores `List<String>` (BOM completed item IDs) as a newline-delimited blob. */
class Converters {
    @TypeConverter
    fun fromStringList(value: List<String>?): String =
        value?.joinToString("\n") ?: ""

    @TypeConverter
    fun toStringList(value: String?): List<String> =
        if (value.isNullOrEmpty()) emptyList() else value.split("\n").filter { it.isNotEmpty() }
}
