package ru.nbch.credit_tracker.service.signal;

import org.springframework.stereotype.Service;
import ru.nbch.credit_tracker.entities.dto.PhoneFidMap;
import ru.nbch.credit_tracker.entities.user_request.monitoring_request.Subject;
import ru.nbch.credit_tracker.mapper.signal.PhoneFidMapMapper;

import java.util.List;

@Service
public class PhoneFidMapService {

    private final PhoneFidMapMapper mapper;

    public PhoneFidMapService(PhoneFidMapMapper mapper) {
        this.mapper = mapper;
    }

    public void registerSubjects(List<Subject> subjects, Integer packageId) {
        mapper.registerSubjects(subjects, packageId);
    }

    public List<PhoneFidMap> findFullPhoneFidMap(Integer packageId,  int offset,  int limit) {
        return mapper.findFullPhoneFidMap(packageId, offset, limit);
    }

    public void updatePhoneFidMaps(List<PhoneFidMap> subjects) {
        mapper.updatePhoneFidMaps(subjects);
    }

    public void updatePhoneFidMapsErrors(List<PhoneFidMap> subjects) {
        mapper.updatePhoneFidMapsErrors(subjects);
    }

    public PhoneFidMap findPhoneFidMapById(Integer id) {
        return mapper.findPhoneFidMapById(id);
    }

    public boolean hasNonNullfids(Integer packageId) {
        return mapper.hasNonNullFids(packageId);
    }
}
