mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-16 13:59:22 +00:00
temporal solution of generating problem
This commit is contained in:
@@ -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)
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user