package com.realnet.taxi_rental.Services;
import java.util.*;
import com.realnet.taxi_rental.Repository.Car_categoryRepository;
import com.realnet.taxi_rental.Entity.Car_category;

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

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

@Service
 public class Car_category_ListFilter1Service {
@Autowired
private Car_categoryRepository Repository;




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

				if (isactive) {{	
Car_category_ListFilter1 dummy = new Car_category_ListFilter1();
			dummy.setId(data.getId());
  dummy.setName(data.getName());
  dummy.setDescription(data.getDescription());
	l.add(dummy);
}} 
} 		
return l;}



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

				if (isactive) {{	
Car_category_ListFilter1 dummy = new Car_category_ListFilter1();
			dummy.setId(data.getId());
  dummy.setName(data.getName());
  dummy.setDescription(data.getDescription());
	l.add(dummy);
}} 
} 		
return l;}
}