/**
 * 
 */
package com.nisum.mytime.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.nisum.mytime.model.EmployeeVisa;
import com.nisum.mytime.model.TravelRequest;
import com.nisum.mytime.model.Visa;
import com.nisum.mytime.repository.EmployeeRolesRepo;
import com.nisum.mytime.repository.EmployeeVisaRepo;
import com.nisum.mytime.repository.TravelRepo;
import com.nisum.mytime.repository.VisaRepo;

/**
 * @author nisum
 *
 */
@Service
public class VisaServiceImpl implements VisaService {

    @Autowired
    private VisaRepo visaRepo;
    @Autowired
    private TravelRepo travelRepo;

    @Autowired
    private EmployeeVisaRepo employeeVisaRepo;

    @Autowired
    private UserService userService;
    
    @Autowired
    private EmployeeRolesRepo employeeRolesRepo;
    

    @Override
    public List<Visa> getAllVisas() {
        return visaRepo.findAll();
    }

    @Override
    public List<EmployeeVisa> getAllEmployeeVisas() {
        return employeeVisaRepo.findAll();
    }

    @Override
    public EmployeeVisa addEmployeeVisas(EmployeeVisa e) {
        return employeeVisaRepo.save(e);
    }

    @Override
    public EmployeeVisa updateEmployeeVisas(EmployeeVisa e) {
        return employeeVisaRepo.save(e);
    }

    @Override
    public void deleteEmployeeVisas(EmployeeVisa e) {
        employeeVisaRepo.delete(e);
    }

    @Override
    public List<TravelRequest> getAllTravels() {
        return travelRepo.findAll();
    }

    @Override
    public TravelRequest addTravelRequest(TravelRequest e) {
        return travelRepo.save(e);
    }

    @Override
    public TravelRequest updateTravelRequest(TravelRequest e) {
        return travelRepo.save(e);
    }

    @Override
    public void deleteEmployeeVisas(TravelRequest e) {
        travelRepo.delete(e);
    }

 }
