package org.synyx.urlaubsverwaltung.workingtime;

import org.synyx.urlaubsverwaltung.absence.DateRange;
import org.synyx.urlaubsverwaltung.person.Person;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Optional;

public interface WorkingTimeService {

    /**
     * Returns the used working time of the given person and date.
     *
     * @param person to check for working time
     * @param date   on this given date
     * @return working time of person, otherwise empty optional
     */
    Optional<WorkingTime> getWorkingTime(Person person, LocalDate date);

    /**
     * Returns a list of working times for the given person.
     * <p>
     * Note: The federal state of the working times are either
     * the default federate state based on the settings
     * or the user specific. But never empty.
     *
     * @param person to get all working times
     * @return list of all working times of a person
     */
    List<WorkingTime> getByPerson(Person person);

    /**
     * Returns a map of date ranges and the associated working time.
     * <p>
     * Note: The federal state of the working time is either
     * the default federate state based on the settings
     * or the user specific. But never empty.
     *
     * @param person    to get the working times
     * @param dateRange to specify the
     * @return map of date ranges and the associated working times of a person
     */
    Map<DateRange, WorkingTime> getWorkingTimesByPersonAndDateRange(Person person, DateRange dateRange);

    /**
     * Returns a map of date ranges and the associated federal state.
     * <p>
     * Note: The federal state of the {@link DateRange} is either
     * the default federate state based on the settings
     * or the user specific. But never empty.
     *
     * @param person    to get the federal states
     * @param dateRange to specify the
     * @return map of date ranges and the associated federal state of a person
     */
    Map<DateRange, FederalState> getFederalStatesByPersonAndDateRange(Person person, DateRange dateRange);

    List<WorkingTime> getByPersons(List<Person> persons);

    FederalState getFederalStateForPerson(Person person, LocalDate date);

    FederalState getSystemDefaultFederalState();
}

@@ -2167,78 +2167,571 @@
     
-FederalState getFederalStateForPerson(Person person, LocalDate date);%0A
+/**%0A     * Returns the federal state of a person.%0A     * %3Cp%3E%0A     * Note: That the federal state is either%0A     * the default federate state based on the settings%0A     * or the user specific.%0A     *%0A     * @param person to get the current federal state of%0A     * @param date   of this given date%0A     * @return the federal state of the given date and person%0A     */%0A    FederalState getFederalStateForPerson(Person person, LocalDate date);%0A%0A    /**%0A     * Returns the default federal state based on the settings%0A     *%0A     * @return default federal state%0A     */
 %0A   

Improve federal state javadoc of working time service