package com.realnet.basic1.Services;
import com.realnet.basic1.Repository.FormbRepository;
import com.realnet.basic1.Entity.Formb;
 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 FormbInsertService5 {
@Autowired
private FormbRepository Repository;
@Autowired
	private AppUserServiceImpl userService; 


public Formb insertaction(Formb formb	) {


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

	}}