use of org.estatio.module.capex.dom.bankaccount.verification.BankAccountVerificationStateTransitionType in project estatio by estatio.
the class IncomingInvoiceApprovalStateSubscriber method on.
@Programmatic
@com.google.common.eventbus.Subscribe
@org.axonframework.eventhandling.annotation.EventHandler
public void on(BankAccountVerificationStateTransitionType.TransitionEvent ev) {
final StateTransitionEvent.Phase phase = ev.getPhase();
if (phase == StateTransitionEvent.Phase.TRANSITIONED) {
final BankAccountVerificationStateTransitionType transitionType = ev.getTransitionType();
final BankAccount bankAccount = ev.getDomainObject();
switch(transitionType) {
case INSTANTIATE:
break;
case VERIFY_BANK_ACCOUNT:
final List<IncomingInvoice> incomingInvoices = findIncomingInvoicesUsing(bankAccount);
for (IncomingInvoice incomingInvoice : incomingInvoices) {
stateTransitionService.trigger(incomingInvoice, CONFIRM_BANK_ACCOUNT_VERIFIED, null, null);
}
break;
case REJECT_PROOF:
break;
case PROOF_UPDATED:
break;
case RESET:
break;
}
}
}
Aggregations