public static CustomerEntity map()

in service/src/main/java/org/apache/fineract/cn/customer/internal/mapper/CustomerMapper.java [36:64]


  public static CustomerEntity map(final Customer customer) {
    final CustomerEntity customerEntity = new CustomerEntity();
    customerEntity.setIdentifier(customer.getIdentifier());
    customerEntity.setType(customer.getType());
    customerEntity.setGivenName(customer.getGivenName());
    customerEntity.setMiddleName(customer.getMiddleName());
    customerEntity.setSurname(customer.getSurname());
    if(customer.getDateOfBirth() !=null) {
      customerEntity.setDateOfBirth(Date.valueOf(customer.getDateOfBirth().toLocalDate()));
    }
    customerEntity.setMember(customer.getMember());
    customerEntity.setAccountBeneficiary(customer.getAccountBeneficiary());
    customerEntity.setReferenceCustomer(customer.getReferenceCustomer());
    customerEntity.setAssignedOffice(customer.getAssignedOffice());
    customerEntity.setAssignedEmployee(customer.getAssignedEmployee());
    customerEntity.setCurrentState(customer.getCurrentState());
    if (customer.getApplicationDate() != null) {
      final String editedApplicationDate;
      if (!customer.getApplicationDate().endsWith("Z")) {
        editedApplicationDate = customer.getApplicationDate() + "Z";
      } else {
        editedApplicationDate = customer.getApplicationDate();
      }
      customerEntity.setApplicationDate(DateConverter.dateFromIsoString(editedApplicationDate));
    }
    customerEntity.setCreatedBy(UserContextHolder.checkedGetUser());
    customerEntity.setCreatedOn(LocalDateTime.now(Clock.systemUTC()));
    return customerEntity;
  }