package com.realnet.angulardatatype.Services;
import com.realnet.angulardatatype.Repository.Basicp3Repository;
import com.realnet.angulardatatype.Entity.Basicp3;
 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 Basicp3InsertService2 {
@Autowired
private Basicp3Repository Repository;
@Autowired
	private AppUserServiceImpl userService; 


public Basicp3 insertaction(Basicp3 basicp3	) {


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

	}}