package com.realnet.taxi_rental.Services;
import java.util.*;
import com.realnet.taxi_rental.Repository.ProductsRepository;
import com.realnet.taxi_rental.Entity.Products;

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

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

@Service
 public class Products_ListFilter1Service {
@Autowired
private ProductsRepository Repository;




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

				if (isactive) {{	
Products_ListFilter1 dummy = new Products_ListFilter1();
			dummy.setId(data.getId());
  dummy.setName(data.getName());
  dummy.setCategory(data.getCategory());
  dummy.setFeatures(data.getFeatures());
  dummy.setDescription(data.getDescription());
	l.add(dummy);
}} 
} 		
return l;}



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

				if (isactive) {{	
Products_ListFilter1 dummy = new Products_ListFilter1();
			dummy.setId(data.getId());
  dummy.setName(data.getName());
  dummy.setCategory(data.getCategory());
  dummy.setFeatures(data.getFeatures());
  dummy.setDescription(data.getDescription());
	l.add(dummy);
}} 
} 		
return l;}
}