Skip to content

Commit

Permalink
Merge pull request #979 from rahulsom/cleanup-kotlin
Browse files Browse the repository at this point in the history
refactor: Remove getter/setter for revertedBy
  • Loading branch information
rahulsom authored Mar 3, 2023
2 parents b78508f + 4cce1e2 commit 194cec0
Showing 1 changed file with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,21 @@ sealed class Transaction(
override val id: String,
override var aggregate: Account?,
override var timestamp: Date,
override var position: Long
) :
BaseEvent<Account, String, Transaction> {
override var position: Long,
override var revertedBy: RevertEvent<Account, String, Transaction>? = null
) : BaseEvent<Account, String, Transaction> {

override fun getAggregateObservable(): Publisher<Account> =
Flowable.fromIterable(listOfNotNull(aggregate))

override var revertedBy: RevertEvent<Account, String, Transaction>?
get() = revertedBy
set(value) {
revertedBy = value
}

data class Deposit(
override val id: String,
override var aggregate: Account?,
override var timestamp: Date,
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,
Expand All @@ -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)
}

0 comments on commit 194cec0

Please sign in to comment.