I'm trying to do something for a JSON parser. I have a bunch of properties named "%type%Sold" and "%type%Base" which contain a CountryCode and an amount. There's like 5 different times these repeat. I'm trying to figure out the best way to structure the model for this. I was trying to use sealed classes with data classes, but that seems rather unwieldy. Here's what I've got so far:
sealed class Amount(
val currency: Currency,
val value: Long,
val type: String
) {
data class Sold(override val currency: Currency, override val amount: Long): Amount(currency, amount, "Sold)