Skip to content
Permalink
Browse files
added dependencies to shared gradle file
  • Loading branch information
ebenezergraham committed Jun 15, 2018
1 parent 5e44714 commit 4bf46aa995ba4708f651da141b62ac672e2457da
Showing 5 changed files with 51 additions and 17 deletions.
@@ -46,12 +46,23 @@ springBoot {
dependencies {
compile(
[group: 'com.twilio.sdk', name: 'twilio', version: '7.17.+'],
[group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '1.4.3.RELEASE'],

[group: 'org.apache.fineract.cn.customer', name: 'api', version: versions.fineractcncustomer],
[group: 'org.apache.fineract.cn.office', name: 'api', version: versions.fineractcnoffice],
[group: 'org.apache.fineract.cn.portfolio', name: 'api', version: versions.fineractcnportfolio],
[group: 'org.apache.fineract.cn.group', name: 'api', version: versions.fineractcngroup],

//[group: 'org.apache.fineract.cn.deposit-account-management', name: 'api', version: versions.fineractcndeposit],
//[group: 'org.apache.fineract.cn.teller', name: 'api', version: versions.fineractcnteller],
//[group: 'org.apache.fineract.cn.reporting', name: 'api', version: versions.fineractcnreporting],
//[group: 'org.apache.fineract.cn.cheques', name: 'api', version: versions.kuelapcheques],
//[group: 'org.apache.fineract.cn.payroll', name: 'api', version: versions.fineractcnpayroll],
//[group: 'org.apache.fineract.cn.notification', name: 'api', version: versions.fineractcnnotification],

[group: 'org.springframework.cloud', name: 'spring-cloud-starter-config'],
[group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka'],
[group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'],
//check this dependency
[group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '1.4.3.RELEASE'],
[group: 'org.apache.fineract.cn.notification', name: 'api', version: project.version],
[group: 'org.apache.fineract.cn.anubis', name: 'library', version: versions.frameworkanubis],
[group: 'com.google.code.gson', name: 'gson'],
@@ -54,4 +54,4 @@ public void sendSMS(String receiver, String template) {
System.out.println(message.getSid());
System.out.println(message.getStatus());
}
}
}
@@ -26,6 +26,7 @@
import org.apache.fineract.cn.customer.api.v1.domain.Customer;
import org.apache.fineract.cn.notification.service.internal.service.EmailSender;
import org.apache.fineract.cn.notification.service.internal.service.SMSSender;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.messaging.handler.annotation.Header;
@@ -38,12 +39,15 @@ public class CustomerEventListener {
private CustomerManager customerManager;
private SMSSender smsSender;
private EmailSender emailSender;
private final Logger logger;

@Autowired
public CustomerEventListener( final CustomerManager customerManager, SMSSender smsSender, EmailSender emailSender ) {
public CustomerEventListener( final CustomerManager customerManager,
SMSSender smsSender, EmailSender emailSender, @Autowired Logger logger ) {
this.customerManager = customerManager;
this.smsSender = smsSender;
this.emailSender = emailSender;
this.logger = logger;
smsSender.sendSMS("+23058409206","just to be sure listen has been instantiated");
}

@@ -55,7 +59,10 @@ public void customerCreatedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final
final String payload) {
System.out.println(payload);
Customer customer = customerManager.findCustomer(payload);
System.out.println("This is the customer created: " + customer.getGivenName());
System.out.println("This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
this.logger.info("Logger --- This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
if (customer.getContactDetails().size() > 0) {
customer.getContactDetails().forEach(contactDetail -> {
if (contactDetail.getType().equals(ContactDetail.Type.PHONE)) {
@@ -77,7 +84,12 @@ public void customerCreatedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final
)
public void customerActivatedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {

Customer customer = customerManager.findCustomer(payload);
System.out.println("This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
this.logger.info("Logger --- This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
if(customer.getCurrentState().equalsIgnoreCase("ACTIVE")){
customer.getContactDetails().forEach(contact-> {
if (contact.getType().equals(ContactDetail.Type.PHONE)) {
@@ -99,6 +111,10 @@ public void customerActivatedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) fin
public void customerLockedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {
Customer customer = customerManager.findCustomer(payload);
System.out.println("This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
this.logger.info("Logger --- This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
if(customer.getCurrentState().equalsIgnoreCase("LOCKED")){
customer.getContactDetails().forEach(contact-> {
if (contact.getType().equals(ContactDetail.Type.PHONE)) {
@@ -120,6 +136,11 @@ public void customerLockedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final
public void customerUnlockedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {
Customer customer = customerManager.findCustomer(payload);

System.out.println("This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
this.logger.info("Logger --- This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
if(customer.getCurrentState().equalsIgnoreCase("LOCKED")){
customer.getContactDetails().forEach(contact-> {
if (contact.getType().equals(ContactDetail.Type.PHONE)) {
@@ -141,6 +162,11 @@ public void customerUnlockedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) fina
public void customerClosedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {
Customer customer = customerManager.findCustomer(payload);
System.out.println("This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
this.logger.info("Logger --- This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);

if(customer.getCurrentState().equalsIgnoreCase("CLOSED")){
customer.getContactDetails().forEach(contact-> {
if (contact.getType().equals(ContactDetail.Type.PHONE)) {
@@ -162,6 +188,10 @@ public void customerClosedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final
public void customerReopenedEvent(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {
Customer customer = customerManager.findCustomer(payload);
System.out.println("This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
this.logger.info("Logger --- This is the customer created: "
+ customer.getGivenName() +"--payload" + payload +"--tenant"+ tenant);
if(customer.getCurrentState().equalsIgnoreCase("LOCKED")){
customer.getContactDetails().forEach(contact-> {
if (contact.getType().equals(ContactDetail.Type.PHONE)) {
@@ -30,6 +30,7 @@
import org.springframework.stereotype.Component;

@Component
@SuppressWarnings("unused")
public class OfficeEventListener {

private OrganizationManager organizationManager;
@@ -50,7 +50,8 @@ public PortfolioEventListener(PortfolioManager portfolioManager, SMSSender smsSe
destination = IndividualLoanEventConstants.DESTINATION,
selector = IndividualLoanEventConstants.SELECTOR_DENY_INDIVIDUALLOAN_CASE
)
public void onDeny(final String payload) {
public void onDeny(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {

}

@@ -99,7 +100,7 @@ public void onCheckLate(@Header(TenantHeaderFilter.TENANT_HEADER) final String t
destination = IndividualLoanEventConstants.DESTINATION,
selector = IndividualLoanEventConstants.SELECTOR_OPEN_INDIVIDUALLOAN_CASE
)
public void onOpen(//@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
public void onOpen(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {

}
@@ -128,7 +129,7 @@ public void onClose(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenan
destination = EventConstants.DESTINATION,
selector = EventConstants.SELECTOR_POST_GROUP
)
public void onGroupCreated(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
public void onGroupCreated(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {

}
@@ -142,13 +143,4 @@ public void onGroupActivated(@Header(TenantHeaderFilter.TENANT_HEADER) final Str
final String payload) {
}

@JmsListener(
subscription = EventConstants.DESTINATION,
destination = EventConstants.DESTINATION,
selector = EventConstants.SELECTOR_PUT_GROUP
)
public void onGroupUpdated(@Header(TenantHeaderFilter.TENANT_HEADER) final String tenant,
final String payload) {
}

}

0 comments on commit 4bf46aa

Please sign in to comment.