package com.realnet.order_estimation.Services;
import com.realnet.order_estimation.Repository.Product_selectionRepository;
import com.realnet.order_estimation.Entity.Product_selection;
 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 Product_selectionInsertService1 {
@Autowired
private Product_selectionRepository Repository;
@Autowired
	private AppUserServiceImpl userService; 


public Product_selection insertaction(Product_selection product_selection	) {


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

	}}