package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.TestlistRepository;
import com.realnet.basicp1.Entity.Testlist;
 import java.util.List;
import com.realnet.users.entity1.AppUser;
import com.realnet.users.service1.AppUserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
	import org.springframework.stereotype.Service;

@Service
 public class TestlistInsertService1 {
@Autowired
private TestlistRepository Repository;
@Autowired
	private AppUserServiceImpl userService; 


public Testlist insertaction(Testlist testlist	) {


	testlist.setUpdatedBy(getUser().getUserId());
		testlist.setCreatedBy(getUser().getUserId());
		testlist.setAccountId(getUser().getAccount().getAccount_id()); 
	testlist.setDescription("textarea");
testlist.setName("text");
final Testlist save = Repository.save(testlist);
		return save;
} 
public AppUser getUser() {
		AppUser user = userService.getLoggedInUser();
		return user;

	}}