package asa.service.impl;

import asa.service.ConstantsInterface;
import asa.service.AppointmentService;
import asa.dao.ScheduleDAO ;
import asa.bean.Appointment;
import asa.model.Schedule;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.BeanUtils;
import java.util.*;


@Service("appointmentService")
public class AppointmentServiceImpl implements ConstantsInterface,AppointmentService{
	
	@Autowired
	private ScheduleDAO scheduleDAO;		
		
    public List<Appointment> get(){
	return new ArrayList<Appointment>();
    }

    
	public boolean add(Appointment appointment){
	Schedule schedule= new Schedule();
      BeanUtils.copyProperties(appointment,schedule);
	System.out.println(appointment.getDate()+" - "+schedule.getDate());
     
       if(scheduleDAO.insert(schedule)==null){
       		System.out.println("add Appointment failed");
        	return false;
       }
		
      //success
      return true;
    }
	
}

@@ -570,43 +570,271 @@
 )%7B%0A%09
-return new ArrayList%3CAppointment%3E()
+List%3CAppointment%3E list = new ArrayList%3C%3E();%0A%09List%3CSchedule%3E queried = scheduleDAO.findAll();%0A%09queried.forEach(query-%3E%7B%0A%09%09Appointment appointment = new Appointment();%0A%09%09BeanUtils.copyProperties(query,appointment);%0A%09%09list.add(appointment);%0A%09%7D);%0A%09    %0A%09  return list
 ;%0A  

Update AppointmentServiceImpl.java