2023-02-25 13:56:12 +00:00
|
|
|
package dev.inmo.micro_utils.repos.generator.test
|
|
|
|
|
|
|
|
import dev.inmo.micro_utils.repos.annotations.GenerateCRUDModel
|
|
|
|
import dev.inmo.micro_utils.repos.annotations.GenerateCRUDModelExcludeOverride
|
2024-04-04 13:28:59 +00:00
|
|
|
import kotlinx.serialization.SerialName
|
2023-02-25 13:56:12 +00:00
|
|
|
import kotlinx.serialization.Serializable
|
|
|
|
import kotlin.jvm.JvmInline
|
|
|
|
|
|
|
|
@Serializable
|
|
|
|
@JvmInline
|
|
|
|
value class TestId(
|
|
|
|
val long: Long
|
|
|
|
)
|
|
|
|
|
2023-02-26 08:37:41 +00:00
|
|
|
typealias ParentTypeId = TestId
|
|
|
|
|
2023-02-25 13:56:12 +00:00
|
|
|
@GenerateCRUDModel(IRegisteredTest::class)
|
|
|
|
sealed interface Test {
|
|
|
|
val property1: String
|
|
|
|
val property2: Int
|
2023-06-20 14:20:47 +00:00
|
|
|
@Serializable
|
2024-04-04 13:28:59 +00:00
|
|
|
@SerialName("custom_parent_name")
|
2023-02-26 08:37:41 +00:00
|
|
|
val parent: ParentTypeId?
|
2023-02-25 13:56:12 +00:00
|
|
|
|
|
|
|
@GenerateCRUDModelExcludeOverride
|
|
|
|
val excludedProperty: String
|
|
|
|
get() = "excluded"
|
|
|
|
}
|
|
|
|
|
|
|
|
sealed interface IRegisteredTest : Test {
|
|
|
|
val id: TestId
|
|
|
|
|
|
|
|
@GenerateCRUDModelExcludeOverride
|
|
|
|
val excludedProperty2: Boolean
|
|
|
|
get() = false
|
|
|
|
}
|