package com.realnet.basicp1.Services;
import com.realnet.basicp1.Repository.ListaRepository;
import com.realnet.basicp1.Entity.Lista;
 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 ListaInsertService8 {
@Autowired
private ListaRepository Repository;
@Autowired
	private AppUserServiceImpl userService; 


public Lista insertaction(Lista lista	) {


	lista.setUpdatedBy(getUser().getUserId());
		lista.setCreatedBy(getUser().getUserId());
		lista.setAccountId(getUser().getAccount().getAccount_id()); 
	final Lista save = Repository.save(lista);
		return save;
} 
public AppUser getUser() {
		AppUser user = userService.getLoggedInUser();
		return user;

	}}