@EventHandler public void on(AccountCreatedEvent event){ this.accountId = event.getAccountId(); this.accountName = event.getAccountName(); this.balance = new BigDecimal(event.getAmount()); LOGGER.info("Account {} is created with balance {}", accountId, this.balance); }
@CommandHandler public BankAccount(CreateAccountCommand command){ LOGGER.debug("Construct a new BankAccount"); apply(new AccountCreatedEvent(command.getAccountId(), command.getAccountName(), command.getAmount())); }
@CommandHandler public BankAccount(CreateAccountCommand command){ LOGGER.debug("Construct a new BankAccount"); apply(new AccountCreatedEvent(command.getAccountId(), command.getAccountName(), command.getAmount())); }
@EventHandler public void on(AccountCreatedEvent event){ this.accountId = event.getAccountId(); this.accountName = event.getAccountName(); this.balance = new BigDecimal(event.getAmount()); LOGGER.info("Account {} is created with balance {}", accountId, this.balance); }
@CommandHandler public BankAccount(CreateAccountCommand command){ LOGGER.debug("Construct a new BankAccount"); apply(new AccountCreatedEvent(command.getAccountId(), command.getAccountName(), command.getAmount())); }
@EventHandler public void on(AccountCreatedEvent event){ this.accountId = event.getAccountId(); this.accountName = event.getAccountName(); this.balance = new BigDecimal(event.getAmount()); LOGGER.info("Account {} is created with balance {}", accountId, this.balance); }