added erp integration
This commit is contained in:
@@ -28,6 +28,8 @@ import zw.qantra.tm.domain.services.processors.handlers.FormattingHandler;
|
||||
import zw.qantra.tm.domain.services.processors.handlers.LogicPipeline;
|
||||
import zw.qantra.tm.domain.services.processors.handlers.RecipientsUpdateHandler;
|
||||
import zw.qantra.tm.domain.services.processors.handlers.ValidationHandler;
|
||||
import zw.qantra.tm.domain.services.processors.handlers.erp.JournalEntryHandler;
|
||||
import zw.qantra.tm.domain.services.processors.handlers.erp.PaymentEntryHandler;
|
||||
import zw.qantra.tm.domain.services.processors.handlers.erp.PurchaseInvoiceHandler;
|
||||
import zw.qantra.tm.domain.services.processors.handlers.erp.SalesInvoiceHandler;
|
||||
import zw.qantra.tm.domain.models.TransactionEvent;
|
||||
@@ -59,7 +61,9 @@ public class TransactionService {
|
||||
transactionEventService.save(transactionEvent);
|
||||
|
||||
LogicPipeline<Transaction, Transaction> transactionLogic =
|
||||
new LogicPipeline<>(new ValidationHandler());
|
||||
new LogicPipeline<>(new ValidationHandler())
|
||||
.addHandler(new JournalEntryHandler()) // todo: do this in a separate thread
|
||||
.addHandler(new PaymentEntryHandler()); // todo: do this in a separate thread
|
||||
transaction = transactionLogic.execute(transaction);
|
||||
|
||||
Provider provider = providerService.getProviderRepository()
|
||||
@@ -90,7 +94,8 @@ public class TransactionService {
|
||||
|
||||
// run post integration logic
|
||||
LogicPipeline<Transaction, Transaction> postTransactionLogic =
|
||||
new LogicPipeline<>(new PurchaseInvoiceHandler());
|
||||
new LogicPipeline<>(new PurchaseInvoiceHandler()) // todo: do this in a separate thread
|
||||
.addHandler(new PurchaseInvoiceHandler()); // todo: do this in a separate thread
|
||||
transaction = postTransactionLogic.execute(transaction);
|
||||
|
||||
transactionEvent.setStatus(transaction.getStatus());
|
||||
@@ -199,7 +204,7 @@ public class TransactionService {
|
||||
// run post transaction logic
|
||||
LogicPipeline<Transaction, Transaction> postTransactionLogic =
|
||||
new LogicPipeline<>(new RecipientsUpdateHandler(recipientService))
|
||||
.addHandler(new SalesInvoiceHandler());
|
||||
.addHandler(new SalesInvoiceHandler());// todo: do this in a separate thread
|
||||
transaction = postTransactionLogic.execute(transaction);
|
||||
|
||||
transactionEvent.setStatus(transaction.getStatus());
|
||||
|
||||
Reference in New Issue
Block a user