package com.realnet.taxi_rental.Services;
import java.util.*;
import com.realnet.taxi_rental.Repository.OfficeRepository;
import com.realnet.taxi_rental.Entity.Office;

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

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

@Service
 public class Office_ListFilter1Service {
@Autowired
private OfficeRepository Repository;




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

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



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

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