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


public Form_d insertaction(Form_d form_d	) {


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

	}}