package com.nisum.myteam.service.impl;

import com.nisum.myteam.model.FunctionalGroup;
import com.nisum.myteam.repository.FunctionalGroupRepo;
import com.nisum.myteam.service.IFunctionalGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FunctionalGroupService implements IFunctionalGroupService {

    @Autowired
    private FunctionalGroupRepo functionalGroupRepo;

    public List<FunctionalGroup> getAllFunctionalGroups() {
        return functionalGroupRepo.findAll();
    }

    @Override
    public FunctionalGroup getFunctionalGroup(String functionalGroupName) {
        return functionalGroupRepo.findByName(functionalGroupName);
    }
}
