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;
}