Fixed the bank account aggregate class

This commit is contained in:
Sambo Chea 2020-08-21 11:37:27 +07:00
parent 652355f486
commit 559633e58a

View File

@ -16,14 +16,14 @@ import java.math.BigDecimal
import java.util.UUID import java.util.UUID
@Aggregate @Aggregate
class BankAccountAggregate( class BankAccountAggregate() {
@AggregateIdentifier @AggregateIdentifier
private var id: UUID? = null, private var id: UUID? = null
private var balance: BigDecimal? = null, private var balance: BigDecimal? = null
private var owner: String? = null private var owner: String? = null
) {
@CommandHandler @CommandHandler
constructor(command: CreateAccountCommand) { constructor(command: CreateAccountCommand) : this() {
AggregateLifecycle.apply( AggregateLifecycle.apply(
AccountCreatedEvent( AccountCreatedEvent(
command.accountId, command.accountId,