Package org.talend.services.crm.types

Examples of org.talend.services.crm.types.RYLCStatusType


  public org.talend.services.crm.types.RYLCStatusType getCRMStatus(
      org.talend.services.crm.types.CustomerDetailsType customer) {
    //
    logData("getCRMStatus", "request", customer);
    // Get status
    RYLCStatusType status = getCustomerStatus(customer);

    logData("getCRMStatus", "response", status);
    return status;
  }
View Full Code Here


    return customer;
  }

  private RYLCStatusType getCustomerStatus(CustomerDetailsType customer) {
    RYLCStatusType status = factory.createRYLCStatusType();

    // Defaults
    status.setCode(RYLCStatusCodeType.INACTIVE);
    status.setCreditPoints(new BigInteger("0"));
    status.setDescription("You are not registered.");
    status.setCustomerId(customer.getId());
   
    String user = customer.getUsername();
 
    if (user != null) {
      if (user.contains("jdoe")) {
        status.setCode(RYLCStatusCodeType.ACTIVE);
        status.setCreditPoints(new BigInteger("230"));
        status.setDescription("All your bookings are closed!");
      } else if (user.contains("bbrindle")) {
        status.setCode(RYLCStatusCodeType.ACTIVE);
        status.setCreditPoints(new BigInteger("1050"));
        status.setDescription("You can pay with your bonus points!");
      } else if (user.contains("rlambert")) {
        status.setCode(RYLCStatusCodeType.ACTIVE);
        status.setCreditPoints(new BigInteger("660"));
        status.setDescription("All your bookings are closed!");
      } else if (user.contains("aebert")) {
        status.setCode(RYLCStatusCodeType.ACTIVE);
        status.setCreditPoints(new BigInteger("790"));
        status.setDescription("Last reservation was canceled by reservation system!");
      }
      customer.setUsername(user);
    }
    return status;
  }
View Full Code Here

TOP

Related Classes of org.talend.services.crm.types.RYLCStatusType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.