How to derive type from other property type
I am relatively new to Kotlin and typed languages. Looking for some advice on to best implement my data models in Kiotlin.
Here is my current code:
data class Commitment(
val type: CommitmentType = CommitmentType,
val configuration: CommitmentConfiguration,
etc...
)
sealed interface CommitmentConfiguration {
val title: String get() = ""
etc...
}
data class BindingCommitmentConfiguration(
val strictMode: Boolean = false,
etc...
) : CommitmentConfiguration
enum class...