temporal solution of generating problem

This commit is contained in:
2023-02-26 14:37:41 +06:00
parent d2e6d2ec80
commit 8215f9d2c6
4 changed files with 178 additions and 148 deletions

View File

@@ -13,6 +13,7 @@ import kotlinx.serialization.Serializable
public data class NewTest(
public override val property1: String,
public override val property2: Int,
public override val parent: ParentTypeId?,
) : Test
@Serializable
@@ -21,8 +22,10 @@ public data class RegisteredTest(
public override val id: TestId,
public override val property1: String,
public override val property2: Int,
public override val parent: ParentTypeId?,
) : Test, IRegisteredTest
public fun Test.asNew(): NewTest = NewTest(property1, property2)
public fun Test.asNew(): NewTest = NewTest(property1, property2, parent)
public fun Test.asRegistered(id: TestId): RegisteredTest = RegisteredTest(id, property1, property2)
public fun Test.asRegistered(id: TestId): RegisteredTest = RegisteredTest(id, property1, property2,
parent)

View File

@@ -11,10 +11,13 @@ value class TestId(
val long: Long
)
typealias ParentTypeId = TestId
@GenerateCRUDModel(IRegisteredTest::class)
sealed interface Test {
val property1: String
val property2: Int
val parent: ParentTypeId?
@GenerateCRUDModelExcludeOverride
val excludedProperty: String