package org.synyx.urlaubsverwaltung.application.service;

import org.synyx.urlaubsverwaltung.application.domain.Application;
import org.synyx.urlaubsverwaltung.application.domain.ApplicationStatus;
import org.synyx.urlaubsverwaltung.person.Person;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Optional;


/**
 * This service provides access to the {@link Application} entities. Except for saving, the access is read-only.
 * Business interactions are found in
 * {@link org.synyx.urlaubsverwaltung.application.service.ApplicationInteractionService}.
 */
public interface ApplicationService {

    /**
     * Gets an {@link Application} by its primary key.
     *
     * @param  id  to get the {@link Application} by.
     *
     * @return  optional {@link Application} for the given id
     */
    Optional<Application> getApplicationById(Integer id);


    /**
     * Saves a new {@link Application}.
     *
     * @param  application  to be saved
     */
    void save(Application application);


    /**
     * Gets all {@link Application}s with the given state.
     *
     * @param  state  of the {@link Application}s for leave to be fetched
     *
     * @return  all {@link Application}s for leave with the given state
     */
    List<Application> getApplicationsForACertainState(ApplicationStatus state);


    /**
     * Gets all {@link Application}s with vacation time between startDate x and endDate y for the given person.
     *
     * @param  startDate {@link ZonedDateTime}
     * @param  endDate {@link ZonedDateTime}
     * @param  person {@link Person}
     *
     * @return  all {@link Application}s of the given person with vacation time between startDate x and endDate y
     */
    List<Application> getApplicationsForACertainPeriodAndPerson(LocalDate startDate, LocalDate endDate,
                                                                Person person);


    /**
     * Gets all {@link Application}s with vacation time between startDate x and endDate y for the given state.
     *
     * @param  startDate {@link ZonedDateTime}
     * @param  endDate {@link ZonedDateTime}
     * @param  status {@link ApplicationStatus}
     *
     * @return  all {@link Application}s with the given state and vacation time between startDate x and endDate y
     */
    List<Application> getApplicationsForACertainPeriodAndState(LocalDate startDate, LocalDate endDate,
                                                               ApplicationStatus status);


    /**
     * Gets all {@link Application}s with vacation time between startDate x and endDate y for the given person and
     * state.
     *
     * @param  startDate {@link ZonedDateTime}
     * @param  endDate {@link ZonedDateTime}
     * @param  person {@link Person}
     * @param  status {@link ApplicationStatus}
     *
     * @return  all {@link Application}s of the given person with vacation time between startDate x and endDate y and
     *          with a certain state
     */
    List<Application> getApplicationsForACertainPeriodAndPersonAndState(LocalDate startDate, LocalDate endDate,
                                                                        Person person, ApplicationStatus status);


    /**
     * Get the total hours of overtime reduction for a certain person.
     *
     * @param  person  to get the total hours of overtime reduction for
     *
     * @return  the total overtime reduction of a person, never {@code null}
     */
    BigDecimal getTotalOvertimeReductionOfPerson(Person person);
}

@@ -303,40 +303,8 @@
 te;%0A
-import java.time.ZonedDateTime;%0A
 impo
@@ -322,16 +322,16 @@
 l.List;%0A
+
 import j
@@ -1517,36 +1517,32 @@
 Date %7B@link 
-ZonedDateTim
+LocalDat
 e%7D%0A     * @p
@@ -1558,36 +1558,32 @@
 Date %7B@link 
-ZonedDateTim
+LocalDat
 e%7D%0A     * @p
@@ -2079,36 +2079,32 @@
 Date %7B@link 
-ZonedDateTim
+LocalDat
 e%7D%0A     * @p
@@ -2120,36 +2120,32 @@
 Date %7B@link 
-ZonedDateTim
+LocalDat
 e%7D%0A     * @p
@@ -2679,36 +2679,32 @@
 Date %7B@link 
-ZonedDateTim
+LocalDat
 e%7D%0A     * @p
@@ -2728,20 +2728,16 @@
 ink 
-ZonedDateTim
+LocalDat
 e%7D%0A 

Fix javadoc