package com.realnet.vpspack.Services;
import java.util.*;
import com.realnet.vpspack.Repository.AgentRepository;
import com.realnet.vpspack.Entity.Agent;

import com.realnet.vpspack.Entity.Agent_ListFilter1;
import java.util.List;

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

@Service
 public class Agent_ListFilter1Service {
@Autowired
private AgentRepository Repository;




 public   List<Agent_ListFilter1>   getlistbuilder() {
	List<Agent> list= Repository.findAll();
		ArrayList<Agent_ListFilter1> l = new ArrayList<>();
		for (Agent data : list) {
boolean isactive = data.isActive();

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



 public   List<Agent_ListFilter1>   getlistbuilderparam( ) {
	List<Agent> list= Repository.findAll();
		ArrayList<Agent_ListFilter1> l = new ArrayList<>();
		for (Agent data : list) {
boolean isactive = data.isActive();

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