@Test public void testHandleOffsetAccountPayable() throws Exception { OffsetAccountPayableFeeCommand command = new OffsetAccountPayableFeeCommand(payableFeeId, offsetId, tradeTime); payableFixture.given( new AccountPayableFeeCreatedEvent( payableFeeId, FeeStatus.PENDING, sellCommissionAmount, FeeType.RECEIVE_COIN, tradeTime, dueDate, portfolioId.toString(), userId.toString(), BusinessType.TRADE_EXECUTED, orderTransactionId.toString())) .when(command) .expectEvents( new AccountPayableFeeOffsetedEvent( payableFeeId, offsetId, tradeTime)); }
@CommandHandler public void handleOffsetAccountPayable(OffsetAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); }
ReceivablePayableCommandHandler { @CommandHandler public void handleOffsetAccountPayable(OffsetAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); } }
ReceivablePayableCommandHandler { @CommandHandler public void handleOffsetAccountPayable(OffsetAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); }  }
ReceivablePayableCommandHandler { @CommandHandler public void handleOffsetAccountPayable(OffsetAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); }  @CommandHandler void handleCreateAccountReceivable(CreateAccountReceivableFeeCommand command); @CommandHandler void handleConfirmAccountReceivable(ConfirmAccountReceivableFeeCommand command); @CommandHandler void handleOffsetAccountReceivable(OffsetAccountReceivableFeeCommand command); @CommandHandler void handleCancelAccountReceivable(CancelAccountReceivableFeeCommand command); @CommandHandler void handleCreateAccountPayable(CreateAccountPayableFeeCommand command); @CommandHandler void handleConfirmAccountPayable(ConfirmAccountPayableFeeCommand command); @CommandHandler void handleOffsetAccountPayable(OffsetAccountPayableFeeCommand command); @CommandHandler void handleCancelAccountPayable(CancelAccountPayableFeeCommand command); @Resource(name = "accountReceivableFeeRepository") void setAccountReceivableFeeRepository(Repository<AccountReceivableFee> accountReceivableFeeRepository); @Resource(name = "accountReceivableFeeRepository") void setAccountPayableFeeRepository(Repository<AccountPayableFee> accountPayableFeeRepository); }
ReceivablePayableCommandHandler { @CommandHandler public void handleOffsetAccountPayable(OffsetAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); }  @CommandHandler void handleCreateAccountReceivable(CreateAccountReceivableFeeCommand command); @CommandHandler void handleConfirmAccountReceivable(ConfirmAccountReceivableFeeCommand command); @CommandHandler void handleOffsetAccountReceivable(OffsetAccountReceivableFeeCommand command); @CommandHandler void handleCancelAccountReceivable(CancelAccountReceivableFeeCommand command); @CommandHandler void handleCreateAccountPayable(CreateAccountPayableFeeCommand command); @CommandHandler void handleConfirmAccountPayable(ConfirmAccountPayableFeeCommand command); @CommandHandler void handleOffsetAccountPayable(OffsetAccountPayableFeeCommand command); @CommandHandler void handleCancelAccountPayable(CancelAccountPayableFeeCommand command); @Resource(name = "accountReceivableFeeRepository") void setAccountReceivableFeeRepository(Repository<AccountReceivableFee> accountReceivableFeeRepository); @Resource(name = "accountReceivableFeeRepository") void setAccountPayableFeeRepository(Repository<AccountPayableFee> accountPayableFeeRepository);  }