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


public Support insertaction(Support support	) {


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

	}}