Package com.expositds.ars.domain.user

Examples of com.expositds.ars.domain.user.Customer


  }

  @SuppressWarnings("deprecation")
  @Override
  public Customer convertFrom(CustomerEntity source, Customer destination) {
    Customer result = null;
    CustomerEntity tmp = null;
   
    if (source != null) {
      tmp = HibernateHelper.initializeAndUnproxy(source);
    }
View Full Code Here


      incomingPaymentEntity.setCompleted(source.isCompleted());
      incomingPaymentEntity.setCreationDate(source.getCreationDate());
      incomingPaymentEntity.setId(source.getId());

      Customer customer = ((IncomingPayment) source).getPayer();
      CustomerEntity customerEntity = null;
      if (customer instanceof PersonalCustomer) {
        customerEntity = DozerHelper
            .map(customer, PersonalCustomerEntity.class);
      }
View Full Code Here

      incomingPayment.setCreationDate(tmp.getCreationDate());
      incomingPayment.setDirection(EPaymentDirection.INCOMING);
      incomingPayment.setId(tmp.getId());

      CustomerEntity customerEntity = ((IncomingPaymentEntity) tmp).getPayer();
      Customer customer = null;
      if (customerEntity instanceof PersonalCustomerEntity) {
        customer = DozerHelper.map(customerEntity, PersonalCustomer.class);
      }
      if (customerEntity instanceof CorporateCustomerEntity) {
        customer = DozerHelper.map(customerEntity, CorporateCustomer.class);
View Full Code Here

    return result;
  }

  @Override
  public Customer updateCustomer(Customer customer) {
    Customer result = null;

    CustomerEntity customerEntity = DozerHelper.map(customer,
        CustomerEntity.class);
    customerEntity = customerRepository.merge(customerEntity);
    result = DozerHelper.map(customerEntity, Customer.class);
View Full Code Here

    customerRepository.delete(id);
  }

  @Override
  public Customer getCustomerById(Long id) {
    Customer result = null;

    CustomerEntity customerEntity = customerRepository.findById(id);
    result = DozerHelper.map(customerEntity, Customer.class);

    return result;
View Full Code Here

    return result;
  }

  @Override
  public Customer getCustomerByVehicleRegNo(String vehicleRegNo) {
    Customer result = null;

    CustomerEntity customerEntity = customerRepository
        .finByVehicleRegNo(vehicleRegNo);
    result = DozerHelper.map(customerEntity, Customer.class);
View Full Code Here

    // Create
    String message = "1. Creating test payment: \n";
   
    // Read
   
    Customer testCustomer = customerService.getCustomerByVehicleRegNo("AC4332");
    message += "2. Getting payments of customer with id:" + testCustomer.getId() + " \n";
    List<IncomingPayment> payments = paymentService.getPaymentsOfPayer(testCustomer, null, null);
    message += payments;
   
    // Update
    message += "3. Updating payment: \n";
View Full Code Here

    log.info(payment);
  }

  @Test
  public void getPaymentpfPayerServiceTest() {
    Customer customer = customerService.getCustomerById((long) 7);
    List<IncomingPayment> payment = paymentService.getPaymentsOfPayer(
        customer, true, 1);
    log.info(payment);
  }
View Full Code Here

    log.info(payment);
  }

  @Test
  public void lastPaymentsOfCustomerServiceTest() {
    Customer customer = customerService.getCustomerById((long) 7);
    List<IncomingPayment> payment = paymentService
        .getLastPaymentsOfCustomer(customer, 1);
    log.info(payment);
  }
View Full Code Here

  @Autowired
  private ICustomerService customerService;

  @Test
  public void addPersonalCustomerTest() {
    Customer personalCustomer = new PersonalCustomer(new Date(), "453");
    personalCustomer.setApartment((short) 10);
    personalCustomer.setCity("Test");
    personalCustomer.setCountry("Test");
    personalCustomer.setEmail("test2@email.com");
    personalCustomer.setHouse((short) 2);
    personalCustomer.setHousing(null);
    personalCustomer.setName("Test");
    personalCustomer.setPassword("TEST");
    personalCustomer.setPatronymic("Testovich");
    personalCustomer.setPhone("5345343");
    personalCustomer.setProvince("Test");
    personalCustomer.setRole(EUserRole.CUSTOMER);
    personalCustomer.setStreet("Test");
    personalCustomer.setSurname("Testov");
    personalCustomer.setZip("223344");

    Long id = customerService.addCustomer(personalCustomer);
    personalCustomer = customerService.getCustomerById(id);

    personalCustomer.setSurname("TETETETE");
    personalCustomer = customerService.updateCustomer(personalCustomer);
 
  }
View Full Code Here

TOP

Related Classes of com.expositds.ars.domain.user.Customer

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.