From 4cce1e2d5ba83dc6ccd720fc4c383a85ecf8772d Mon Sep 17 00:00:00 2001 From: Rahul Somasunderam Date: Thu, 2 Mar 2023 19:50:34 -0800 Subject: [PATCH] refactor: Remove getter/setter for revertedBy Leaving it in the body forces defining them. --- .../kotlin/grooves/example/push/Transaction.kt | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/grooves-example-pushstyle/src/main/kotlin/grooves/example/push/Transaction.kt b/grooves-example-pushstyle/src/main/kotlin/grooves/example/push/Transaction.kt index d435ea5d..6959a644 100644 --- a/grooves-example-pushstyle/src/main/kotlin/grooves/example/push/Transaction.kt +++ b/grooves-example-pushstyle/src/main/kotlin/grooves/example/push/Transaction.kt @@ -10,19 +10,13 @@ sealed class Transaction( override val id: String, override var aggregate: Account?, override var timestamp: Date, - override var position: Long -) : - BaseEvent { + override var position: Long, + override var revertedBy: RevertEvent? = null +) : BaseEvent { override fun getAggregateObservable(): Publisher = Flowable.fromIterable(listOfNotNull(aggregate)) - override var revertedBy: RevertEvent? - get() = revertedBy - set(value) { - revertedBy = value - } - data class Deposit( override val id: String, override var aggregate: Account?, @@ -30,8 +24,7 @@ sealed class Transaction( override var position: Long, val atmId: String, val amount: Long - ) : - Transaction(id, aggregate, timestamp, position) + ) : Transaction(id, aggregate, timestamp, position) data class Withdraw( override val id: String, @@ -40,6 +33,5 @@ sealed class Transaction( override var position: Long, val atmId: String, val amount: Long - ) : - Transaction(id, aggregate, timestamp, position) + ) : Transaction(id, aggregate, timestamp, position) } \ No newline at end of file