package com.realnet.taxi_rental.Services;
import java.util.*;
import com.realnet.taxi_rental.Repository.Vehicle_add_onRepository;
import com.realnet.taxi_rental.Entity.Vehicle_add_on;

import com.realnet.taxi_rental.Entity.Vehicle_add_on_ListFilter1;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
	import org.springframework.stereotype.Service;

@Service
 public class Vehicle_add_on_ListFilter1Service {
@Autowired
private Vehicle_add_onRepository Repository;




 public   List<Vehicle_add_on_ListFilter1>   getlistbuilder() {
	List<Vehicle_add_on> list= Repository.findAll();
		ArrayList<Vehicle_add_on_ListFilter1> l = new ArrayList<>();
		for (Vehicle_add_on data : list) {
boolean isactive = data.getActive();

				if (isactive) {{	
Vehicle_add_on_ListFilter1 dummy = new Vehicle_add_on_ListFilter1();
			dummy.setId(data.getId());
  dummy.setName(data.getName());
  dummy.setDescription(data.getDescription());
  dummy.setPrice_per_day(data.getPrice_per_day());
  dummy.setPrice_per_trip(data.getPrice_per_trip());
	l.add(dummy);
}} 
} 		
return l;}



 public   List<Vehicle_add_on_ListFilter1>   getlistbuilderparam( ) {
	List<Vehicle_add_on> list= Repository.findAll();
		ArrayList<Vehicle_add_on_ListFilter1> l = new ArrayList<>();
		for (Vehicle_add_on data : list) {
boolean isactive = data.getActive();

				if (isactive) {{	
Vehicle_add_on_ListFilter1 dummy = new Vehicle_add_on_ListFilter1();
			dummy.setId(data.getId());
  dummy.setName(data.getName());
  dummy.setDescription(data.getDescription());
  dummy.setPrice_per_day(data.getPrice_per_day());
  dummy.setPrice_per_trip(data.getPrice_per_trip());
	l.add(dummy);
}} 
} 		
return l;}
}