commit 79e44ca9db7cc0871668957158fc12d1dcc27b94
Author: D0miq <dpoch@email.com>
Date:   Sun Jun 2 01:07:32 2019 +0200

    Documentation domain and dto, unit test domain, error input domain

diff --git a/server/src/main/java/cz/zcu/yamanager/business/ApiManager.java b/server/src/main/java/cz/zcu/yamanager/business/ApiManager.java
index 98ab2f2..402211a 100644
--- a/server/src/main/java/cz/zcu/yamanager/business/ApiManager.java
+++ b/server/src/main/java/cz/zcu/yamanager/business/ApiManager.java
@@ -12,10 +12,14 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Component;
 
+import java.time.Duration;
 import java.time.LocalDate;
+import java.time.temporal.TemporalUnit;
 import java.util.Collections;
 import java.util.List;
 
+import static java.time.temporal.ChronoUnit.MINUTES;
+
 @Component
 public class ApiManager implements Manager {
 
@@ -46,18 +50,15 @@ public class ApiManager implements Manager {
             users = this.userRepository.getAllBasicUsers(status);
         }
 
-        if(users == null) {
-            return Collections.emptyList();
-        } else {
-            LocalDate today = LocalDate.now();
-            LocalDate weekBefore = today.minusDays(ApiManager.DAYS_IN_WEEK);
-            LocalDate weekAfter = today.plusDays(ApiManager.DAYS_IN_WEEK);
-            for (BasicProfileUser user : users) {
-                user.setCalendar(this.vacationRepository.getVacationDays(user.getId(), weekBefore, weekAfter));
-            }
-
-            return users;
+        LocalDate today = LocalDate.now();
+        LocalDate weekBefore = today.minusDays(ApiManager.DAYS_IN_WEEK);
+        LocalDate weekAfter = today.plusDays(ApiManager.DAYS_IN_WEEK);
+        for (BasicProfileUser user : users) {
+            user.setCalendar(this.vacationRepository.getVacationDays(user.getId(), weekBefore, weekAfter));
         }
+
+        return users;
+
     }
 
     @Override
@@ -69,7 +70,7 @@ public class ApiManager implements Manager {
             requests = this.requestRepository.getAllVacationRequests(status);
         }
 
-        return requests == null ? Collections.emptyList() : requests;
+        return requests;
     }
 
     @Override
@@ -81,15 +82,12 @@ public class ApiManager implements Manager {
             requests = this.requestRepository.getAllAuthorizations(status);
         }
 
-        return requests == null ? Collections.emptyList() : requests;
+        return requests;
     }
 
     @Override
     public FullUserProfile getUserProfile(Long userId) throws RESTFullException {
-        FullUserProfile userProfile = this.userRepository.getFullUser(userId);
-        System.out.println("Notification: " + userProfile.getNotification());
-        System.out.println("Approval: " + userProfile.getStatus());
-        return userProfile;
+        return this.userRepository.getFullUser(userId);
     }
 
     @Override
@@ -111,7 +109,7 @@ public class ApiManager implements Manager {
             vacations = this.vacationRepository.getVacationDays(userId, fromDate, status);
         }
 
-        return vacations == null ? Collections.emptyList() : vacations;
+        return vacations;
     }
 
     @Override
@@ -121,13 +119,22 @@ public class ApiManager implements Manager {
 
     @Override
     public void createVacation(Long userId, VacationDay vacationDay) throws RESTFullException {
+        UserRole role = this.userRepository.getUserRole(userId);
+        vacationDay.setStatus(role == UserRole.EMPLOYER ? Status.ACCEPTED : Status.PENDING);
+
+        if(vacationDay.getType() == VacationType.VACATION) {
+            this.userRepository.decreaseVacationCount(userId, vacationDay.getFrom().until(vacationDay.getTo(), MINUTES) / 60f);
+        } else {
+            this.userRepository.increaseTakenSickdays(userId);
+        }
+
         this.vacationRepository.insertVacationDay(userId, vacationDay);
     }
 
     @Override
     public void changeSettings(Long userId, UserSettings settings) throws RESTFullException {
         settings.setId(userId);
-        if(settings.getRole() == null && settings.getSickdayCount() == null && settings.getVacationCount() == null) {
+        if(settings.getRole() == null && settings.getSickDayCount() == null && settings.getVacationCount() == null) {
             this.userRepository.updateNotification(settings);
         } else {
             this.userRepository.updateUserSettings(settings);
diff --git a/server/src/main/java/cz/zcu/yamanager/business/mock/ManagerMock.java b/server/src/main/java/cz/zcu/yamanager/business/mock/ManagerMock.java
index 2a81f6b..608986a 100644
--- a/server/src/main/java/cz/zcu/yamanager/business/mock/ManagerMock.java
+++ b/server/src/main/java/cz/zcu/yamanager/business/mock/ManagerMock.java
@@ -109,11 +109,11 @@ public class ManagerMock implements Manager {
         if (userSettings.containsKey(id)) {
             UserSettings settings = userSettings.get(id);
             user.setVacationCount(settings.getVacationCount());
-            user.setSickdayCount(settings.getSickdayCount());
+            user.setSickDayCount(settings.getSickDayCount());
             user.setRole(settings.getRole());
         } else {
             user.setVacationCount(8.5F);
-            user.setSickdayCount(3);
+            user.setSickDayCount(3);
             user.setRole(UserRole.EMPLOYER);
         }
 
@@ -125,7 +125,7 @@ public class ManagerMock implements Manager {
     private DefaultSettings createDefaultSettings() {
         DefaultSettings settings = new DefaultSettings();
 
-        settings.setSickdayCount(3);
+        settings.setSickDayCount(3);
         settings.setNotification(LocalDateTime.now());
 
         return settings;
diff --git a/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java b/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java
index 88cd354..6fa5417 100644
--- a/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java
+++ b/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java
@@ -1,114 +1,129 @@
 package cz.zcu.yamanager.domain;
 
-import java.time.LocalDate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.time.LocalDateTime;
 
 /**
- * A domain class {@code DefaultSettings} represents a single record in the Default_settings table of a database.
- * It contains default settings of the application.
+ * The domain class {@code DefaultSettings} represents a single record in the 'default_settings' table of a database.
+ * It contains default settings of users' informations that are known to the application. Informations consist of a number of
+ * available sick days, date and time of an email notification. Default settings are mainly used when the user is added to
+ * the application which means he/she can't have his/her own values.
  */
 public class DefaultSettings {
-
     /**
-     * ID of the default settings.
+     * The logger.
      */
-    private final int id;
+    private static final Logger log = LoggerFactory.getLogger(DefaultSettings.class);
 
     /**
-     * Default remaining vacation hours.
+     * The ID of default settings.
      */
-    private int noVacations;
+    private final long id;
 
     /**
-     * Default remaining sick days.
+     * The default number of available sick days.
      */
-    private int noSickDays;
+    private int sickDayCount;
 
     /**
-     * Default date of an email warning about an incoming reset of the vacation hours and sick days.
+     * The default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
      */
-    private LocalDate alertDate;
+    private LocalDateTime notification;
 
     /**
-     * Creates a new instance of the class {@code DefaultSettings}.
-     * @param id ID of the default settings.
-     * @param noVacations Default remaining vacation hours.
-     * @param noSickDays Default remaining sick days.
-     * @param alertDate Default date of an email warning about an incoming reset of the vacation hours and sick days.
+     * Creates an empty default settings for testing purposes only.
+     * It just sets id to zero.
      */
-    public DefaultSettings(int id, int noVacations, int noSickDays, LocalDate alertDate) {
-        this.id = id;
-        this.noVacations = noVacations;
-        this.noSickDays = noSickDays;
-        this.alertDate = alertDate;
+    public DefaultSettings() {
+        DefaultSettings.log.trace("Creating a new instance of the class DefaultSettings.");
+        this.id = 0;
     }
 
     /**
-     * Gets an ID of the default settings.
-     * @return The ID of the default settings.
+     * Creates a new default settings with the specified id, number of available sick days, date and time of a notification.
+     *
+     * @param id           the ID of default settings
+     * @param sickDayCount the default number of available sick days
+     * @param notification the default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days
+     * @throws IllegalArgumentException when the given sickDayCount value is negative
      */
-    public int getId() {
-        return id;
-    }
+    public DefaultSettings(final long id, final int sickDayCount, final LocalDateTime notification) throws IllegalArgumentException {
+        DefaultSettings.log.trace("Creating a new instance of the class DefaultSettings.");
+        DefaultSettings.log.debug("DefaultSettings: id={},\nsickDayCount={},\nnotification={}", id, sickDayCount, notification);
 
-    /**
-     * Gets a default remaining vacation hours.
-     * @return The default remaining vacation hours.
-     */
-    public int getNoVacations() {
-        return noVacations;
+        this.id = id;
+        this.setSickDayCount(sickDayCount);
+        this.notification = notification;
     }
 
     /**
-     * Sets a new default remaining vacation hours.
-     * @param noVacations The new default remaining vacation hours.
+     * Returns the ID of this default settings.
+     *
+     * @return the ID of this default settings
      */
-    public void setNoVacations(int noVacations) {
-        this.noVacations = noVacations;
+    public long getId() {
+        return this.id;
     }
 
     /**
-     * Gets a default remaining sick days.
-     * @return The default remaining sick days.
+     * Returns the default number of available sick days in this default settings.
+     *
+     * @return the default number of available sick days
      */
-    public int getNoSickDays() {
-        return noSickDays;
+    public int getSickDayCount() {
+        return this.sickDayCount;
     }
 
     /**
-     * Sets a new default remaining sick days.
-     * @param noSickDays The new default remaining sick days.
+     * Replaces the default number of available sick days in this default settings with the given one.
+     * If the given number is negative the method throws an exception.
+     *
+     * @param sickDayCount the new default number of available sick days
+     * @throws IllegalArgumentException when the given value is negative
      */
-    public void setNoSickDays(int noSickDays) {
-        this.noSickDays = noSickDays;
+    public void setSickDayCount(final int sickDayCount) throws IllegalArgumentException {
+        DefaultSettings.log.debug("Setting a new number of available sick days: {}.", sickDayCount);
+
+        if (sickDayCount < 0) {
+            DefaultSettings.log.warn("The number of available sick days was negative.");
+            throw new IllegalArgumentException("sick.day.count.error");
+        }
+
+        this.sickDayCount = sickDayCount;
     }
 
     /**
-     * Gets a default date of an email warning about an incoming reset of the vacation hours and sick days.
-     * @return The default date of an email warning about an incoming reset of the vacation hours and sick days.
+     * Returns the default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
+     *
+     * @return the default date and time
      */
-    public LocalDate getAlertDate() {
-        return alertDate;
+    public LocalDateTime getNotification() {
+        return this.notification;
     }
 
     /**
-     * Sets a new default date of an email warning about an incoming reset of the vacation hours and sick days.
-     * @param alertDate The new default date of an email warning about an incoming reset of the vacation hours and sick days.
+     * Replaces the default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days with the specified one.
+     *
+     * @param notification the new default date and time
      */
-    public void setAlertDate(LocalDate alertDate) {
-        this.alertDate = alertDate;
+    public void setNotification(final LocalDateTime notification) {
+        DefaultSettings.log.debug("Setting a new default date and time of sending an email warning: {}.", notification);
+        this.notification = notification;
     }
 
     /**
-     * Gets a string representation of the class {@code DefaultSettings}.
-     * @return The string representation of the class.
+     * Returns a string representation of this default settings. The representation consists of the id, number of sick days and notification of the default settings.
+     *
+     * @return the string representation of this default settings
      */
     @Override
     public String toString() {
         return "DefaultSettings{" +
-                "id=" + id +
-                ", noVacations=" + noVacations +
-                ", noSickDays=" + noSickDays +
-                ", alertDate=" + alertDate +
+                "id=" + this.id +
+                ", sickDayCount=" + this.sickDayCount +
+                ", notification=" + this.notification +
                 '}';
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/domain/Right.java b/server/src/main/java/cz/zcu/yamanager/domain/Right.java
deleted file mode 100644
index 4d33ec0..0000000
--- a/server/src/main/java/cz/zcu/yamanager/domain/Right.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package cz.zcu.yamanager.domain;
-
-/**
- * A domain class {@code Right} represents a single record in the Right table of a database.
- * It holds informations about a user's right, which says what can a user do in the application.
- * Rights are grouped to roles ({@code Role}).
- */
-public class Right {
-
-    /**
-     * ID of the right.
-     */
-    private final int id;
-
-    /**
-     * Name of the right.
-     */
-    private String name;
-
-    /**
-     * Description of the right.
-     */
-    private String description;
-
-    /**
-     * Creates a new instance of the class {@code Right}.
-     * @param id ID of the right.
-     * @param name Name of the right.
-     * @param description Description of the right.
-     */
-    public Right(int id, String name, String description) {
-        this.id = id;
-        this.name = name;
-        this.description = description;
-    }
-
-    /**
-     * Gets an ID of the right.
-     * @return The ID of the right.
-     */
-    public int getId() {
-        return this.id;
-    }
-
-    /**
-     * Gets a name of the right.
-     * @return The name of the right.
-     */
-    public String getName() {
-        return this.name;
-    }
-
-    /**
-     * Sets a new name.
-     * @param name The new name.
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * Gets a description of the right.
-     * @return The description of the right.
-     */
-    public String getDescription() {
-        return this.description;
-    }
-
-    /**
-     * Sets a new description.
-     * @param description The new description.
-     */
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    /**
-     * Gets a string representation of the class {@code Right}.
-     * @return The string representation of the class.
-     */
-    @Override
-    public String toString() {
-        return "Right{" +
-                "id=" + this.id +
-                ", name='" + this.name + '\'' +
-                ", description='" + this.description + '\'' +
-                '}';
-    }
-}
\ No newline at end of file
diff --git a/server/src/main/java/cz/zcu/yamanager/domain/Role.java b/server/src/main/java/cz/zcu/yamanager/domain/Role.java
deleted file mode 100644
index 004f6de..0000000
--- a/server/src/main/java/cz/zcu/yamanager/domain/Role.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package cz.zcu.yamanager.domain;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A domain class {@code Role} represents a single record in the Role table of a database.
- * Role groups user's rights to a bigger wholes.
- */
-public class Role {
-
-    /**
-     * ID of the role.
-     */
-    private final int id;
-
-    /**
-     * Name of the role.
-     */
-    private String name;
-
-    /**
-     * List of rights of the role.
-     */
-    private List<Right> rightList;
-
-    /**
-     * Creates a new instance of the class {@code Role}.
-     * @param id ID of the role.
-     * @param name Name of the role.
-     * @param rightList List of rights of the role.
-     */
-    public Role(int id, String name, List<Right> rightList) {
-        this.id = id;
-        this.name = name;
-        this.rightList = rightList;
-    }
-
-    /**
-     * Gets an ID of the role.
-     * @return The ID of the right.
-     */
-    public int getId() {
-        return this.id;
-    }
-
-    /**
-     * Gets a name of the role.
-     * @return The name of the role.
-     */
-    public String getName() {
-        return this.name;
-    }
-
-    /**
-     * Sets a new name.
-     * @param name The new name.
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * Returns a copy of a list of rights.
-     * @return The copy of the list of rights.
-     */
-    public List<Right> getRightList() {
-        return new ArrayList<>(this.rightList);
-    }
-
-    /**
-     * Sets a copy of the given list of rights.
-     * @param rightList The given list of rights.
-     */
-    public void setRightList(List<Right> rightList) {
-        this.rightList = new ArrayList<>(rightList);
-    }
-
-    /**
-     * Gets a string representation of the class {@code Role}.
-     * @return The string representation of the class.
-     */
-    @Override
-    public String toString() {
-        return "Role{" +
-                "id=" + id +
-                ", name='" + name + '\'' +
-                ", rightList=" + rightList +
-                '}';
-    }
-}
\ No newline at end of file
diff --git a/server/src/main/java/cz/zcu/yamanager/domain/SickDay.java b/server/src/main/java/cz/zcu/yamanager/domain/SickDay.java
deleted file mode 100644
index 56b490f..0000000
--- a/server/src/main/java/cz/zcu/yamanager/domain/SickDay.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package cz.zcu.yamanager.domain;
-
-import java.time.LocalDate;
-
-/**
- * A domain class {@code SickDay} represents a single record in the Sick_days table of a database.
- * Class holds informations of a sick day taken by a user.
- */
-public class SickDay {
-
-    /**
-     * ID of the sick day.
-     */
-    private final int id;
-
-    /**
-     * Date of the sick day.
-     */
-    private LocalDate date;
-
-    /**
-     * Approval status of the sick day.
-     */
-    private Status status;
-
-    /**
-     * Creates a new instance of the class {@code SickDay}.
-     * @param id ID of the sick day.
-     * @param date Date of the sick day.
-     * @param status Approval status of the sick day.
-     */
-    public SickDay(int id, LocalDate date, Status status) {
-        this.id = id;
-        this.date = date;
-        this.status = status;
-    }
-
-    /**
-     * Gets an ID of the sick day.
-     * @return The ID of the sick day.
-     */
-    public int getId() {
-        return id;
-    }
-
-    /**
-     * Gets a date of the sick day.
-     * @return The date of the sick day.
-     */
-    public LocalDate getDate() {
-        return date;
-    }
-
-    /**
-     * Sets a new date.
-     * @param date The new date.
-     */
-    public void setDate(LocalDate date) {
-        this.date = date;
-    }
-
-    /**
-     * Gets an approval status of the sick day.
-     * @return The approval status of the sick day.
-     */
-    public Status getStatus() {
-        return status;
-    }
-
-    /**
-     * Sets a new approval status.
-     * @param status The new approval status.
-     */
-    public void setStatus(Status status) {
-        this.status = status;
-    }
-
-    /**
-     * Gets a string representation of the class {@code SickDay}.
-     * @return The string representation of the class.
-     */
-    @Override
-    public String toString() {
-        return "SickDay{" +
-                "id=" + id +
-                ", date=" + date +
-                ", status=" + status +
-                '}';
-    }
-}
diff --git a/server/src/main/java/cz/zcu/yamanager/domain/Status.java b/server/src/main/java/cz/zcu/yamanager/domain/Status.java
deleted file mode 100644
index af7fdd0..0000000
--- a/server/src/main/java/cz/zcu/yamanager/domain/Status.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package cz.zcu.yamanager.domain;
-
-/**
- * A domain class {@code Status} represents a single record in the Approval_status table of a database.
- * Approval status indicates state of user's authorization or vacation/sick days confirmation.
- */
-public class Status {
-
-    /**
-     * ID of the status.
-     */
-    private final int id;
-
-    /**
-     * Name of the status.
-     */
-    private String name;
-
-    /**
-     * Creates a new instance of the class {@code Status}.
-     * @param id ID of the status.
-     * @param name Name of the status.
-     */
-    public Status(int id, String name) {
-        this.id = id;
-        this.name = name;
-    }
-
-    /**
-     * Gets an ID of the status.
-     * @return The ID of the status.
-     */
-    public int getId() {
-        return id;
-    }
-
-    /**
-     * Gets a name of the status.
-     * @return The name of the status.
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Sets a new name.
-     * @param name The new name.
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * Gets a string representation of the class {@code Status}.
-     * @return The string representation of the class.
-     */
-    @Override
-    public String toString() {
-        return "Status{" +
-                "id=" + id +
-                ", name='" + name + '\'' +
-                '}';
-    }
-}
diff --git a/server/src/main/java/cz/zcu/yamanager/domain/Test.java b/server/src/main/java/cz/zcu/yamanager/domain/Test.java
deleted file mode 100644
index 0c93da2..0000000
--- a/server/src/main/java/cz/zcu/yamanager/domain/Test.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package cz.zcu.yamanager.domain;
-
-public class Test {
-
-    private final long id;
-    private final String message;
-
-    public Test(long id, String message) {
-        this.id = id;
-        this.message = message;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("Test[id=%d, message='%s']", id, message);
-    }
-}
\ No newline at end of file
diff --git a/server/src/main/java/cz/zcu/yamanager/domain/User.java b/server/src/main/java/cz/zcu/yamanager/domain/User.java
index a59f18e..7100c21 100644
--- a/server/src/main/java/cz/zcu/yamanager/domain/User.java
+++ b/server/src/main/java/cz/zcu/yamanager/domain/User.java
@@ -1,284 +1,472 @@
 package cz.zcu.yamanager.domain;
 
-import java.time.LocalDate;
+import cz.zcu.yamanager.dto.Status;
+import cz.zcu.yamanager.dto.UserRole;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.time.LocalDateTime;
 
 /**
- * A domain class {@code User} represents a single record in the User table of a database.
- * User hold all informations about a user which logged to the application.
+ * The domain class {@code User} represents a single record in the 'end_user' table of a database.
+ * User holds all informations about a user which is logged to the application.
  */
 public class User {
+    /**
+     * The maximal length of a name.
+     */
+    private static final int NAME_LENGTH = 45;
+
+    /**
+     * The maximal length of an email address.
+     */
+    private static final int EMAIL_ADDRESS_LENGTH = 100;
 
     /**
-     * User's ID.
+     * The logger.
      */
-    private final int id;
+    private static final Logger log = LoggerFactory.getLogger(User.class);
 
     /**
-     * User's first name.
+     * The user's ID.
+     */
+    private final long id;
+
+    /**
+     * The user's first name.
      */
     private String firstName;
 
     /**
-     * User's last name.
+     * The user's last name.
      */
     private String lastName;
 
     /**
-     * User's remaining vacation hours.
+     * The number of user's remaining hours of an overtime.
+     */
+    private float vacationCount;
+
+    /**
+     * The number of user's sick days available during a year.
      */
-    private int noVacations;
+    private int totalSickDayCount;
 
     /**
-     * User's remaining sick days.
+     * The number of user's taken sick days.
      */
-    private int noSickDays;
+    private int takenSickDayCount;
 
     /**
-     * Date of an email warning about an incoming reset of the vacation hours and sick days.
+     * The date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
      */
-    private LocalDate alertDate;
+    private LocalDateTime notification;
 
     /**
-     * Token for the Google oAuth.
+     * The token for the Google oAuth.
      */
     private String token;
 
     /**
-     * User's email address.
+     * The user's email address.
      */
     private String email;
 
     /**
-     * URL of a user's photo.
+     * The URL of a user's photo.
      */
     private String photo;
 
     /**
-     * User's role.
+     * The date and time of a user's creation.
+     */
+    private final LocalDateTime creationDate;
+
+    /**
+     * The user's role.
      */
-    private Role role;
+    private UserRole role;
 
     /**
-     * User's approval status.
+     * The user's authorization status.
      */
     private Status status;
 
     /**
-     * Creates a new instance of the class {@code User}.
-     * @param id User's ID.
-     * @param firstName User's first name.
-     * @param lastName User's last name.
-     * @param noVacations User's remaining vacation hours.
-     * @param noSickDays User's remaining sick days.
-     * @param alertDate Date of email warning about an incoming reset of the vacation hours and sick days.
-     * @param token Token for the Google oAuth.
-     * @param email User's email address.
-     * @param photo URL of a user's photo.
-     * @param role User's role.
-     * @param status User's approval status.
-     */
-    public User(int id, String firstName, String lastName, int noVacations, int noSickDays, LocalDate alertDate, String token, String email, String photo, Role role, Status status) {
+     * Creates an empty user for testing purposes only.
+     * It just sets id to zero and creation date to now.
+     */
+    public User() {
+        User.log.trace("Creating a new instance of the class User.");
+        this.id = 0;
+        this.creationDate = LocalDateTime.now();
+    }
+
+    /**
+     * Creates a new user and sets all its attributes.
+     *
+     * @param id                the user's ID
+     * @param firstName         the user's first name
+     * @param lastName          the user's last name.
+     * @param vacationCount     the number of user's remaining hours of an overtime
+     * @param totalSickDayCount the number of user's sick days available during a year
+     * @param takenSickDayCount the number of user's taken sick days
+     * @param notification      the date and time of sending an email warning about an incoming reset of remaining overtimes and sick days
+     * @param token             the token for the Google oAuth
+     * @param email             the user's email address
+     * @param photo             the URL of a user's photo
+     * @param creationDate      the date and time of a user's creation
+     * @param role              the user's role
+     * @param status            the user's authorization status
+     * @throws IllegalArgumentException when the vacationCount, totalSickDayCount or takenSickDayCount are negative or first name, last name or email exceed the maximal permitted number of characters
+     */
+    public User(final long id, final String firstName, final String lastName, final float vacationCount, final int totalSickDayCount, final int takenSickDayCount, final LocalDateTime notification, final String token, final String email, final String photo, final LocalDateTime creationDate, final UserRole role, final Status status) throws IllegalArgumentException {
+        User.log.trace("Creating a new instance of the class User.");
+        User.log.debug("User: id={},\nfirstName={},\nlastName={},\nvacationCount={},\ntotalSickDayCount={},\ntakenSickDayCount={},\nnotification={},\ntoken={},\nemail={},\nphoto={},\ncreationDate={},\nrole={},\nstatus={}", id, firstName, lastName, vacationCount, totalSickDayCount, takenSickDayCount, notification, token, email, photo, creationDate, role, status);
+
         this.id = id;
-        this.firstName = firstName;
-        this.lastName = lastName;
-        this.noVacations = noVacations;
-        this.noSickDays = noSickDays;
-        this.alertDate = alertDate;
+        this.setFirstName(firstName);
+        this.setLastName(lastName);
+        this.setVacationCount(vacationCount);
+        this.setTotalSickDayCount(totalSickDayCount);
+        this.setTakenSickDayCount(takenSickDayCount);
+        this.notification = notification;
         this.token = token;
-        this.email = email;
+        this.setEmail(email);
         this.photo = photo;
+        this.creationDate = creationDate;
         this.role = role;
         this.status = status;
     }
 
     /**
-     * Gets a user's ID.
-     * @return The user's ID.
+     * Returns the user's ID.
+     *
+     * @return the user's ID
      */
-    public int getId() {
-        return id;
+    public long getId() {
+        return this.id;
     }
 
     /**
-     * Gets a user's first name.
-     * @return The user's first name.
+     * Returns the user's first name.
+     *
+     * @return the user's first name
      */
     public String getFirstName() {
-        return firstName;
+        return this.firstName;
     }
 
     /**
-     * Sets a new first name.
-     * @param firstName The new first name.
+     * Replaces the user's first name with the new specified value.
+     * If the given name is longer than the maximal allowed number of characters the method throws an exception.
+     *
+     * @param firstName the new first name
+     * @throws IllegalArgumentException when the given name is longer than the maximal allowed number of characters
      */
-    public void setFirstName(String firstName) {
+    public void setFirstName(final String firstName) throws IllegalArgumentException {
+        User.log.debug("Setting a new first name: {}", firstName);
+
+        if (firstName.length() > User.NAME_LENGTH) {
+            User.log.warn("The length of the given first name exceeded the limit.");
+            throw new IllegalArgumentException("name.length.error");
+        }
+
         this.firstName = firstName;
     }
 
     /**
-     * Gets a user's last name.
-     * @return The user's last name.
+     * Returns the user's last name.
+     *
+     * @return the user's last name
      */
     public String getLastName() {
-        return lastName;
+        return this.lastName;
     }
 
     /**
-     * Sets a new last name.
-     * @param lastName The new last name.
+     * Replaces the user's last name with the given one.
+     * If the given name is longer than the maximal allowed number of characters the method throws an exception.
+     *
+     * @param lastName the new last name
+     * @throws IllegalArgumentException when the given name is longer than the maximal allowed number of characters
      */
-    public void setLastName(String lastName) {
+    public void setLastName(final String lastName) throws IllegalArgumentException {
+        User.log.debug("Setting a new last name: {}", lastName);
+
+        if (lastName.length() > User.NAME_LENGTH) {
+            User.log.warn("The length of the given last name exceeded the limit.");
+            throw new IllegalArgumentException("name.length.error");
+        }
+
         this.lastName = lastName;
     }
 
     /**
-     * Gets a user's remaining vacation hours.
-     * @return The user's remaining vacation hours.
+     * Returns the number of user's remaining hours of an overtime.
+     *
+     * @return the number of user's remaining hours of the overtime
      */
-    public int getNoVacations() {
-        return noVacations;
+    public float getVacationCount() {
+        return this.vacationCount;
     }
 
     /**
-     * Sets a new number of remaining vacation hours.
-     * If the given value is negative the number of vacation hours is set to zero.
-     * @param noVacations The new number of remaining vacation hours.
+     * Replaces the number of user's remaining hours of an overtime with the specified value.
+     * If the given number is negative the method throws an exception.
+     *
+     * @param vacationCount the new number of remaining hours of the overtime.
+     * @throws IllegalArgumentException when the given value is negative
      */
-    public void setNoVacations(int noVacations) {
-        this.noVacations = noVacations < 0 ? 0 : noVacations;
+    public void setVacationCount(final float vacationCount) throws IllegalArgumentException {
+        User.log.debug("Setting a new number of remaining overtime: {}", vacationCount);
+
+        if (vacationCount < 0) {
+            User.log.warn("The given number of remaining overtime must not be negative.");
+            throw new IllegalArgumentException("vacation.count.error");
+        }
+
+        this.vacationCount = vacationCount;
     }
 
     /**
-     * Gets a user's remaining sick days.
-     * @return The user's remaining sick days.
+     * Increases the number of user's remaining hours of an overtime by the given amount.
+     *
+     * @param amount the amount of hours
      */
-    public int getNoSickDays() {
-        return noSickDays;
+    public void increaseVacationCount(final float amount) {
+        User.log.debug("Increasing the number of remaining overtime by {}", amount);
+        this.vacationCount += amount;
     }
 
     /**
-     * Sets a new number of remaining sick days.
-     * If the given value is negative the number of sick days is set to zero.
-     * @param noSickDays The new number of remaining sick days.
+     * Decreases the number of user's remaining hours of an overtime by the given amount.
+     * If the new number of remaining hours is below zero the method throws an exception.
+     *
+     * @param amount the amount of hours
+     * @throws IllegalArgumentException when the result of the subtraction is negative
      */
-    public void setNoSickDays(int noSickDays) {
-        this.noSickDays = noSickDays < 0 ? 0 : noSickDays;
+    public void decreaseVacationCount(final float amount) throws IllegalArgumentException {
+        User.log.debug("Decreasing the number of remaining overtime by {}", amount);
+
+        if (this.vacationCount - amount < 0) {
+            User.log.warn("The result of the decrease must not be negative.");
+            throw new IllegalArgumentException("vacation.count.error");
+        }
+
+        this.vacationCount -= amount;
+    }
+
+    /**
+     * Returns the number of user's sick days available during a year.
+     *
+     * @return the number of user's sick days available during the year
+     */
+    public int getTotalSickDayCount() {
+        return this.totalSickDayCount;
+    }
+
+    /**
+     * Replaces the number of user's sick days available during a year with the new value.
+     * If the given number is negative the method throws an exception.
+     *
+     * @param totalSickDayCount the new number of sick days available during the year
+     * @throws IllegalArgumentException when the given value is negative
+     */
+    public void setTotalSickDayCount(final int totalSickDayCount) throws IllegalArgumentException {
+        User.log.debug("Setting a new number of user's sick days available during a year: {}", totalSickDayCount);
+
+        if (totalSickDayCount < 0) {
+            User.log.warn("The given number of user's sick days available during a year must not be negative.");
+            throw new IllegalArgumentException("sick.day.count.error");
+        }
+
+        this.totalSickDayCount = totalSickDayCount;
+    }
+
+    /**
+     * Returns the number of user's taken sick days.
+     *
+     * @return the number of user's taken sick days
+     */
+    public int getTakenSickDayCount() {
+        return this.takenSickDayCount;
+    }
+
+    /**
+     * Replaces the number of user's taken sick days with the new value.
+     * If the given number is negative the method throws an exception.
+     *
+     * @param takenSickDayCount the new number of taken sick days
+     * @throws IllegalArgumentException when the given value is negative
+     */
+    public void setTakenSickDayCount(final int takenSickDayCount) throws IllegalArgumentException {
+        User.log.debug("Setting a new number of user's taken sick days: {}", takenSickDayCount);
+
+        if (takenSickDayCount < 0) {
+            User.log.warn("The given number number of user's taken sick days must not be negative.");
+            throw new IllegalArgumentException("sick.day.count.error");
+        }
+
+        this.takenSickDayCount = takenSickDayCount;
     }
 
     /**
-     * Gets a date of an email warning about an incoming reset of the vacation hours and sick days.
-     * @return The date of the email warning about the incoming reset of the vacation hours and sick days.
+     * Returns the date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
+     *
+     * @return the date and time
      */
-    public LocalDate getAlertDate() {
-        return alertDate;
+    public LocalDateTime getNotification() {
+        return this.notification;
     }
 
     /**
-     * Sets a new date of an email warning about an incoming reset of the vacation hours and sick days.
-     * @param alertDate The new date of the email warning about the incoming reset of the vacation hours and sick days.
+     * Replaces the date and time of sending an email warning about an incoming reset of remaining overtimes and sick days with the given value.
+     *
+     * @param notification the new date and time
      */
-    public void setAlertDate(LocalDate alertDate) {
-        this.alertDate = alertDate;
+    public void setNotification(final LocalDateTime notification) {
+        User.log.debug("Setting a new date and time of sending an email warning: {}", notification);
+        this.notification = notification;
     }
 
     /**
-     * Gets a user's token for the Google oAuth.
-     * @return The user's token for the Google oAuth.
+     * Returns the user's token for the Google oAuth.
+     *
+     * @return the user's token for the Google oAuth
      */
     public String getToken() {
-        return token;
+        return this.token;
     }
 
     /**
-     * Sets a new token for the Google oAuth.
-     * @param token The new token for the Google oAuth.
+     * Replaces the user's token for the Google oAuth with the specified string.
+     *
+     * @param token the new token for the Google oAuth
      */
-    public void setToken(String token) {
+    public void setToken(final String token) {
+        User.log.debug("Setting a new token: {}", token);
         this.token = token;
     }
 
     /**
-     * Gets a user's email address.
-     * @return The user's email address.
+     * Returns the user's email address.
+     *
+     * @return the user's email address
      */
     public String getEmail() {
-        return email;
+        return this.email;
     }
 
     /**
-     * Sets a new email address.
-     * @param email The new email address.
+     * Replaces the user's email address with the new given value.
+     * If the given email is longer than the maximal allowed number of characters the method throws an exception.
+     *
+     * @param email the new email address
+     * @throws IllegalArgumentException when the given email is longer than the maximal allowed number of characters
      */
-    public void setEmail(String email) {
+    public void setEmail(final String email) throws IllegalArgumentException {
+        User.log.debug("Setting a new email address: {}", email);
+
+        if (email.length() > User.EMAIL_ADDRESS_LENGTH) {
+            User.log.warn("The length of the email address exceeded the limit.");
+            throw new IllegalArgumentException("email.length.error");
+        }
+
         this.email = email;
     }
 
     /**
-     * Gets a URL of a user's photo.
-     * @return The URL of the user's photo.
+     * Returns the URL of a user's photo.
+     *
+     * @return the URL of the user's photo
      */
     public String getPhoto() {
-        return photo;
+        return this.photo;
     }
 
     /**
-     * Sets a new URL of a user's photo.
-     * @param photo The new URL of a user's photo.
+     * Replaces the URL of a user's photo with the given link.
+     *
+     * @param photo the new URL of the user's photo
      */
-    public void setPhoto(String photo) {
+    public void setPhoto(final String photo) {
+        User.log.debug("Setting a new url of a photo: {}", photo);
         this.photo = photo;
     }
 
     /**
-     * Gets a user's role.
-     * @return The user's role.
+     * Returns the date and time of a user's creation.
+     *
+     * @return the date and time of the user's creation
+     */
+    public LocalDateTime getCreationDate() {
+        return this.creationDate;
+    }
+
+    /**
+     * Returns the user's role.
+     *
+     * @return the user's role
      */
-    public Role getRole() {
-        return role;
+    public UserRole getRole() {
+        return this.role;
     }
 
     /**
-     * Sets a new role.
-     * @param role The new role.
+     * Replaces the user's role with the new provided value.
+     *
+     * @param role the new role
      */
-    public void setRole(Role role) {
+    public void setRole(final UserRole role) {
+        User.log.debug("Setting a new user's role: {}", role);
         this.role = role;
     }
 
     /**
-     * Gets a user's approval status.
-     * @return The user's approval status.
+     * Returns the user's authorization status.
+     *
+     * @return the user's authorization status
      */
     public Status getStatus() {
-        return status;
+        return this.status;
     }
 
     /**
-     * Sets a new approval status.
-     * @param status The new approval status.
+     * Replaces the authorization status with the handed value.
+     *
+     * @param status the new authorization status
      */
-    public void setStatus(Status status) {
+    public void setStatus(final Status status) {
+        User.log.debug("Setting a new authorization status: {}", status);
         this.status = status;
     }
 
     /**
-     * Gets a string representation of the class {@code User}.
-     * @return The string representation of the class.
+     * Gets a string representation of this user. The representation contains the id, first name, last name,
+     * number of user's remaining hours of an overtime, number of user's sick days available during a year,
+     * number of user's taken sick days, date and time of sending an email warning about an incoming reset of
+     * remaining overtimes and sick days, token for the Google oAuth, email address, URL of a photo, role and
+     * authorization status.
+     *
+     * @return the string representation of this user
      */
     @Override
     public String toString() {
         return "User{" +
-                "id=" + id +
-                ", firstName='" + firstName + '\'' +
-                ", lastName='" + lastName + '\'' +
-                ", noVacations=" + noVacations +
-                ", noSickDays=" + noSickDays +
-                ", alertDate=" + alertDate +
-                ", token='" + token + '\'' +
-                ", email='" + email + '\'' +
-                ", photo='" + photo + '\'' +
-                ", role=" + role +
-                ", status=" + status +
+                "id=" + this.id +
+                ", firstName='" + this.firstName + '\'' +
+                ", lastName='" + this.lastName + '\'' +
+                ", vacationCount=" + this.vacationCount +
+                ", totalSickDayCount=" + this.totalSickDayCount +
+                ", takenSickDayCount=" + this.takenSickDayCount +
+                ", notification=" + this.notification +
+                ", token='" + this.token + '\'' +
+                ", email='" + this.email + '\'' +
+                ", photo='" + this.photo + '\'' +
+                ", creationDate=" + this.creationDate +
+                ", role=" + this.role +
+                ", status=" + this.status +
                 '}';
     }
 }
\ No newline at end of file
diff --git a/server/src/main/java/cz/zcu/yamanager/domain/VacationDay.java b/server/src/main/java/cz/zcu/yamanager/domain/VacationDay.java
index 0c9457e..3184594 100644
--- a/server/src/main/java/cz/zcu/yamanager/domain/VacationDay.java
+++ b/server/src/main/java/cz/zcu/yamanager/domain/VacationDay.java
@@ -1,139 +1,307 @@
 package cz.zcu.yamanager.domain;
 
+import cz.zcu.yamanager.dto.Status;
+import cz.zcu.yamanager.dto.VacationType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.naming.OperationNotSupportedException;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.LocalTime;
 
 /**
- * A domain class {@code VacationDay} represents a single record in the Vacation_day table of a database.
- * Class holds informations of a vacation day taken by a user.
+ * The domain class {@code VacationDay} represents a single record in the 'vacation_day' table of a database.
+ * Class holds informations of an overtime or a sick day taken by a user.
  */
 public class VacationDay {
+    /**
+     * The logger.
+     */
+    private static final Logger log = LoggerFactory.getLogger(VacationDay.class);
 
     /**
-     * ID of the vacation day.
+     * The ID of this vacation.
      */
     private final int id;
 
     /**
-     * Date of the vacation day.
+     * The date of this vacation.
      */
     private LocalDate date;
 
     /**
-     * Starting time of a vacation.
+     * The starting time of this vacation.
      */
     private LocalTime from;
 
     /**
-     * Ending time of a vacation.
+     * The ending time of this vacation.
      */
     private LocalTime to;
 
     /**
-     * Approval status of the vacation day.
+     * The date and time of a creation of this vacation.
+     */
+    private final LocalDateTime creationDate;
+
+    /**
+     * The approval status of this vacation.
      */
     private Status status;
 
     /**
-     * Creates a new instance of the class {@code VacationDay}.
-     * @param id ID of the vacation day.
-     * @param date Date of the vacation day.
-     * @param from Starting time of a vacation.
-     * @param to Ending time of a vacation.
-     * @param status Approval status of the vacation day.
+     * The type of this vacation.
+     */
+    private VacationType type;
+
+    /**
+     * Creates an empty vacation for testing purposes only.
+     * It just sets id to zero and creation date to nowte.
      */
-    public VacationDay(int id, LocalDate date, LocalTime from, LocalTime to, Status status) {
+    public VacationDay() {
+        VacationDay.log.trace("Creating a new instance of the class VacationDay.");
+        this.id = 0;
+        this.creationDate = LocalDateTime.now();
+    }
+
+    /**
+     * Creates a new sick day with the specified id, date, date when a sick day request was created and its approval status.
+     *
+     * @param id           the ID of the sick day
+     * @param date         the date of the sick day
+     * @param creationDate the date and time of the creation of the sick day
+     * @param status       the approval status of the sick day
+     */
+    public VacationDay(final int id, final LocalDate date, final LocalDateTime creationDate, final Status status) {
+        this(id, date, null, null, creationDate, status, VacationType.SICKDAY);
+    }
+
+    /**
+     * Creates a new overtime with the specified id, date, starting time, ending time, date when an overtime request was created and its approval status.
+     *
+     * @param id           the ID of the overtime
+     * @param date         the date of the overtime
+     * @param from         the starting time of the overtime
+     * @param to           the ending time of the overtime
+     * @param creationDate the date and time of the creation of the overtime
+     * @param status       the approval status of the overtime
+     */
+    public VacationDay(final int id, final LocalDate date, final LocalTime from, final LocalTime to, final LocalDateTime creationDate, final Status status) {
+        this(id, date, from, to, creationDate, status, VacationType.VACATION);
+    }
+
+    /**
+     * Creates a new overtime or sick day with all attributes.
+     *
+     * @param id           the ID of a vacation
+     * @param date         the date of a vacation
+     * @param from         the starting time of a vacation
+     * @param to           the ending time of a vacation
+     * @param creationDate the date and time of a creation of a vacation
+     * @param status       the approval status of a vacation
+     * @param type         the type of a vacation
+     */
+    private VacationDay(final int id, final LocalDate date, final LocalTime from, final LocalTime to, final LocalDateTime creationDate, final Status status, final VacationType type) {
+        VacationDay.log.trace("Creating a new instance of the class VacationDay.");
+        VacationDay.log.debug("VacationDay: id={},\ndate={},\nfrom={},\nto={},\ncreationDate={},\nstatus={},\ntype={}", id, date, from, to, creationDate, status, type);
+
         this.id = id;
         this.date = date;
-        this.from = from;
-        this.to = to;
+        this.setTime(from, to);
+        this.creationDate = creationDate;
         this.status = status;
+        this.type = type;
     }
 
     /**
-     * Gets an ID of the vacation day.
-     * @return The ID of the vacation day.
+     * Returns the ID of this vacation.
+     *
+     * @return the ID of this vacation
      */
     public int getId() {
-        return id;
+        return this.id;
     }
 
     /**
-     * Gets a date of the vacation day.
-     * @return The date of the vacation day.
+     * Returns the date of this vacation.
+     *
+     * @return the date of this vacation
      */
     public LocalDate getDate() {
-        return date;
+        return this.date;
     }
 
     /**
-     * Sets a new date.
-     * @param date The new date.
+     * Replaces the date of this vacation with the specified date.
+     *
+     * @param date the new date
      */
-    public void setDate(LocalDate date) {
+    public void setDate(final LocalDate date) {
+        VacationDay.log.debug("Settings a new value of a date: {}", date);
         this.date = date;
     }
 
     /**
-     * Gets a starting time of a vacation.
-     * @return The starting time of a vacation.
+     * Returns the starting time of this vacation.
+     *
+     * @return the starting time of this vacation
      */
     public LocalTime getFrom() {
-        return from;
+        return this.from;
     }
 
     /**
-     * Sets a new starting time.
-     * @param from The new starting time.
+     * Replaces the starting time of this vacation with the given time.
+     * If the given time is later or equals the ending time of this vacation the method throws an exception.
+     *
+     * @param from the new starting time
+     * @throws IllegalArgumentException when the given time is later or equals the ending time of this vacation
      */
-    public void setFrom(LocalTime from) {
+    public void setFrom(final LocalTime from) throws IllegalArgumentException {
+        VacationDay.log.debug("Settings a new value of the starting time of this vacation: {}", from);
+
+        if(this.type == VacationType.SICKDAY) {
+            VacationDay.log.info("The sick day must not have a starting time.");
+            this.from = null;
+        }
+
+        if (this.to != null && from.compareTo(this.to) >= 0) {
+            VacationDay.log.warn("The vacation must not start after it ends. from={}, to={}", from, this.to);
+            throw new IllegalArgumentException("time.order.error");
+        }
+
         this.from = from;
     }
 
     /**
-     * Gets an ending time of a vacation.
-     * @return The ending time of a vacation.
+     * Returns the ending time of this vacation.
+     *
+     * @return the ending time of this vacation
      */
     public LocalTime getTo() {
-        return to;
+        return this.to;
     }
 
     /**
-     * Sets a new ending time.
-     * @param to The new ending time.
+     * Replaces the ending time of this vacation with the provided time.
+     * If the given time is earlier or equals the starting time of this vacation the method throws an exception.
+     *
+     * @param to the new ending time
+     * @throws IllegalArgumentException when the given time is earlier or equals the starting time of this vacation
      */
-    public void setTo(LocalTime to) {
+    public void setTo(final LocalTime to) throws IllegalArgumentException {
+        VacationDay.log.debug("Settings a new value of the ending time of this vacation: {}", to);
+
+        if(this.type == VacationType.SICKDAY) {
+            VacationDay.log.info("The sick day must not have an ending time.");
+            this.to = null;
+        }
+
+        if (this.from != null && to.compareTo(this.from) <= 0) {
+            VacationDay.log.warn("The vacation must not end after it starts. from={}, to={}", this.from, to);
+            throw new IllegalArgumentException("time.order.error");
+        }
+
         this.to = to;
     }
 
     /**
-     * Gets an approval status of the vacation day.
-     * @return The approval status of the vacation day.
+     * Replaces the starting and ending time of this vacation with the provided values.
+     * If the starting time is later or equals the ending time the method throws an exception.
+     *
+     * @param from the new starting time
+     * @param to   the new ending time
+     * @throws IllegalArgumentException when the ending time is earlier or equals the starting time
+     */
+    public void setTime(final LocalTime from, final LocalTime to) throws IllegalArgumentException {
+        VacationDay.log.debug("Settings a new value of the starting {} and the ending {} time of this vacation.", from, to);
+
+        if(this.type == VacationType.SICKDAY) {
+            VacationDay.log.info("The sick day must not have a starting and an ending time.");
+            this.from = null;
+            this.to = null;
+        }
+
+        if (from.compareTo(to) >= 0) {
+            VacationDay.log.warn("The vacation must not start after it ends. from={}, to={}", from, to);
+            throw new IllegalArgumentException("time.order.error");
+        }
+
+        this.from = from;
+        this.to = to;
+    }
+
+    /**
+     * Returns the date and time of a creation of this vacation.
+     *
+     * @return the date and time of the creation of this vacation
+     */
+    public LocalDateTime getCreationDate() {
+        return this.creationDate;
+    }
+
+    /**
+     * Returns the approval status of this vacation.
+     *
+     * @return the approval status of this vacation
      */
     public Status getStatus() {
-        return status;
+        return this.status;
     }
 
     /**
-     * Sets a new approval status.
-     * @param status The new approval status.
+     * Replaces the approval status of this vacation with the given value.
+     *
+     * @param status the new approval status
      */
-    public void setStatus(Status status) {
+    public void setStatus(final Status status) {
+        VacationDay.log.debug("Setting a new approval status: {}", status);
         this.status = status;
     }
 
     /**
-     * Gets a string representation of the class {@code VacationDay}.
-     * @return The string representation of the class.
+     * Returns the type of this vacation.
+     *
+     * @return the type of this vacation
+     */
+    public VacationType getType() {
+        return this.type;
+    }
+
+    /**
+     * Replaces the type of this vacation with the handed type.
+     * If the given type is a SICKDAY the method sets the starting and the ending time to null.
+     *
+     * @param type the new type
+     */
+    public void setType(final VacationType type) {
+        VacationDay.log.debug("Setting a new type of this vacation: {}", type);
+
+        if(type == VacationType.SICKDAY) {
+            VacationDay.log.info("The sick day must not have a starting and an ending time.");
+            this.from = null;
+            this.to = null;
+        }
+
+        this.type = type;
+    }
+
+    /**
+     * Gets a string representation of this vacation. The representation consists of its id, date, starting time, ending time, creation date, status and type.
+     *
+     * @return the string representation of this vacation
      */
     @Override
     public String toString() {
         return "VacationDay{" +
-                "id=" + id +
-                ", date=" + date +
-                ", from=" + from +
-                ", to=" + to +
-                ", status=" + status +
+                "id=" + this.id +
+                ", date=" + this.date +
+                ", from=" + this.from +
+                ", to=" + this.to +
+                ", creationDate=" + this.creationDate +
+                ", status=" + this.status +
+                ", type=" + this.type +
                 '}';
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/AuthorizationRequest.java b/server/src/main/java/cz/zcu/yamanager/dto/AuthorizationRequest.java
index 1b0b169..10ccc99 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/AuthorizationRequest.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/AuthorizationRequest.java
@@ -2,51 +2,124 @@ package cz.zcu.yamanager.dto;
 
 import java.time.LocalDateTime;
 
+/**
+ * An instance of the messenger class {@code AuthorizationRequest} is just a different view of a user.
+ * It stores information relevant to a user's authorization in the application.
+ * This class is used to communication with a frontend.
+ */
 public class AuthorizationRequest {
-
+    /**
+     * The user's ID.
+     */
     private Long id;
+
+    /**
+     * The user's first name.
+     */
     private String firstName;
+
+    /**
+     * The user's last name.
+     */
     private String lastName;
+
+    /**
+     * The user's authorization status.
+     */
     private Status status;
+
+    /**
+     * The date and time of a creation of this request.
+     */
     private LocalDateTime timestamp;
 
+    /**
+     * Returns the user's ID.
+     *
+     * @return the user's ID
+     */
     public Long getId() {
-        return id;
+        return this.id;
     }
 
-    public void setId(Long id) {
+    /**
+     * Replaces the user's ID with the specified value.
+     *
+     * @param id the new user's ID
+     */
+    public void setId(final Long id) {
         this.id = id;
     }
 
+    /**
+     * Returns the user's first name.
+     *
+     * @return the user's first name
+     */
     public String getFirstName() {
-        return firstName;
+        return this.firstName;
     }
 
-    public void setFirstName(String firstName) {
+    /**
+     * Replaces the user's first name with the new specified value.
+     *
+     * @param firstName the new first name
+     */
+    public void setFirstName(final String firstName) {
         this.firstName = firstName;
     }
 
+    /**
+     * Returns the user's last name.
+     *
+     * @return the user's last name
+     */
     public String getLastName() {
-        return lastName;
+        return this.lastName;
     }
 
-    public void setLastName(String lastName) {
+    /**
+     * Replaces the user's last name with the given one.
+     *
+     * @param lastName the new last name
+     */
+    public void setLastName(final String lastName) {
         this.lastName = lastName;
     }
 
+    /**
+     * Returns the user's authorization status.
+     *
+     * @return the user's authorization status
+     */
     public Status getStatus() {
-        return status;
+        return this.status;
     }
 
-    public void setStatus(Status status) {
+    /**
+     * Replaces the authorization status with the handed value.
+     *
+     * @param status the new authorization status
+     */
+    public void setStatus(final Status status) {
         this.status = status;
     }
 
+    /**
+     * Returns the date and time of a creation of this user's request.
+     *
+     * @return the date and time of the creation of this user's request
+     */
     public LocalDateTime getTimestamp() {
-        return timestamp;
+        return this.timestamp;
     }
 
-    public void setTimestamp(LocalDateTime timestamp) {
+    /**
+     * Replaces the date and time of a creation of this user's request with the given value.
+     *
+     * @param timestamp the new date and time of the creation of this user's request
+     */
+    public void setTimestamp(final LocalDateTime timestamp) {
         this.timestamp = timestamp;
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/BasicProfileUser.java b/server/src/main/java/cz/zcu/yamanager/dto/BasicProfileUser.java
index e062a83..37e95a8 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/BasicProfileUser.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/BasicProfileUser.java
@@ -2,50 +2,124 @@ package cz.zcu.yamanager.dto;
 
 import java.util.List;
 
+/**
+ * An instance of the messenger class {@code BasicProfileUser} represents a basic profile of a user in a database.
+ * The basic profile contains default, the most important informations which helps identify a user like a name or photo.
+ * This class is used to communicate with a frontend.
+ */
 public class BasicProfileUser {
+    /**
+     * The user's ID.
+     */
     private Long id;
+
+    /**
+     * The user's first name.
+     */
     private String firstName;
+
+    /**
+     * The user's last name.
+     */
     private String lastName;
+
+    /**
+     * The URL of a user's photo.
+     */
     private String photo;
+
+    /**
+     * The list of user's vacations.
+     */
     private List<VacationDay> calendar;
 
+    /**
+     * Returns the user's ID.
+     *
+     * @return the user's ID
+     */
     public Long getId() {
-        return id;
+        return this.id;
     }
 
-    public void setId(Long id) {
+    /**
+     * Replaces the user's ID with the specified value.
+     *
+     * @param id the new user's ID
+     */
+    public void setId(final Long id) {
         this.id = id;
     }
 
+    /**
+     * Returns the user's first name.
+     *
+     * @return the user's first name
+     */
     public String getFirstName() {
-        return firstName;
+        return this.firstName;
     }
 
-    public void setFirstName(String firstName) {
+    /**
+     * Replaces the user's first name with the new specified value.
+     *
+     * @param firstName the new first name
+     */
+    public void setFirstName(final String firstName) {
         this.firstName = firstName;
     }
 
+    /**
+     * Returns the user's last name.
+     *
+     * @return the user's last name
+     */
     public String getLastName() {
-        return lastName;
+        return this.lastName;
     }
 
-    public void setLastName(String lastName) {
+    /**
+     * Replaces the user's last name with the given one.
+     *
+     * @param lastName the new last name
+     */
+    public void setLastName(final String lastName) {
         this.lastName = lastName;
     }
 
+    /**
+     * Returns the URL of a user's photo.
+     *
+     * @return the URL of the user's photo
+     */
     public String getPhoto() {
-        return photo;
+        return this.photo;
     }
 
-    public void setPhoto(String photo) {
+    /**
+     * Replaces the URL of a user's photo with the given link.
+     *
+     * @param photo the new URL of the user's photo
+     */
+    public void setPhoto(final String photo) {
         this.photo = photo;
     }
 
+    /**
+     * Returns the list of user's vacations.
+     *
+     * @return the list of user's vacations
+     */
     public List<VacationDay> getCalendar() {
-        return calendar;
+        return this.calendar;
     }
 
-    public void setCalendar(List<VacationDay> calendar) {
+    /**
+     * Replaces the list of user's vacations with the given list.
+     *
+     * @param calendar the new list of vacations
+     */
+    public void setCalendar(final List<VacationDay> calendar) {
         this.calendar = calendar;
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/BasicRequest.java b/server/src/main/java/cz/zcu/yamanager/dto/BasicRequest.java
index 11a16b9..2eaa11e 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/BasicRequest.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/BasicRequest.java
@@ -1,23 +1,54 @@
 package cz.zcu.yamanager.dto;
 
+/**
+ * An instance of the messenger class {@code BasicRequest} can represent an authorization or a vacation request.
+ * The class is used for changing a status of the authorization or the vacation request when a client sends a request on an api endpoint.
+ * This class is used to communicate with a frontend.
+ */
 public class BasicRequest {
-
+    /**
+     * The ID of this request.
+     */
     private Long id;
+
+    /**
+     * The approval/authorization status of this request.
+     */
     private Status status;
 
+    /**
+     * Returns the ID of this request.
+     *
+     * @return the ID of this request
+     */
     public Long getId() {
-        return id;
+        return this.id;
     }
 
-    public void setId(Long id) {
+    /**
+     * Replaces the user's ID with the specified value.
+     *
+     * @param id the new user's ID
+     */
+    public void setId(final Long id) {
         this.id = id;
     }
 
+    /**
+     * Returns the approval/authorization status of this request.
+     *
+     * @return the approval status of this vacation
+     */
     public Status getStatus() {
-        return status;
+        return this.status;
     }
 
-    public void setStatus(Status status) {
+    /**
+     * Replaces the approval/authorization status of this request with the given value.
+     *
+     * @param status the new approval/authorization status
+     */
+    public void setStatus(final Status status) {
         this.status = status;
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/DefaultSettings.java b/server/src/main/java/cz/zcu/yamanager/dto/DefaultSettings.java
index b84fdd4..c6983fe 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/DefaultSettings.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/DefaultSettings.java
@@ -2,24 +2,56 @@ package cz.zcu.yamanager.dto;
 
 import java.time.LocalDateTime;
 
+/**
+ * The messenger class {@code DefaultSettings} contains default settings of users' informations that are known to the application.
+ * Informations consist of a number of available sick days, date and time of an email notification.
+ * Default settings are mainly used when the user is added to the application which means he/she can't have his/her own values.
+ * This class is used to communicate with a frontend.
+ */
 public class DefaultSettings {
-
-    private Integer sickdayCount;
+    /**
+     * The default number of available sick days.
+     */
+    private Integer sickDayCount;
+
+    /**
+     * The default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
+     */
     private LocalDateTime notification;
 
-    public Integer getSickdayCount() {
-        return sickdayCount;
+    /**
+     * Returns the default number of available sick days in this default settings.
+     *
+     * @return the default number of available sick days
+     */
+    public Integer getSickDayCount() {
+        return this.sickDayCount;
     }
 
-    public void setSickdayCount(Integer sickdayCount) {
-        this.sickdayCount = sickdayCount;
+    /**
+     * Replaces the default number of available sick days in this default settings with the given one.
+     *
+     * @param sickDayCount the new default number of available sick days
+     */
+    public void setSickDayCount(final Integer sickDayCount) {
+        this.sickDayCount = sickDayCount;
     }
 
+    /**
+     * Returns the default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
+     *
+     * @return the default date and time
+     */
     public LocalDateTime getNotification() {
-        return notification;
+        return this.notification;
     }
 
-    public void setNotification(LocalDateTime notification) {
+    /**
+     * Replaces the default date and time of sending an email warning about an incoming reset of remaining overtimes and sick days with the specified one.
+     *
+     * @param notification the new default date and time
+     */
+    public void setNotification(final LocalDateTime notification) {
         this.notification = notification;
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/FullUserProfile.java b/server/src/main/java/cz/zcu/yamanager/dto/FullUserProfile.java
index d8b61bc..091aff8 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/FullUserProfile.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/FullUserProfile.java
@@ -1,107 +1,262 @@
 package cz.zcu.yamanager.dto;
 
-
 import java.time.LocalDateTime;
 
+/**
+ * The messenger class {@code FullUserProfile} holds all informations about a user which is logged to the application.
+ * This class is used to communicate with a frontend.
+ */
 public class FullUserProfile {
-
+    /**
+     * The user's ID.
+     */
     private Long id;
+
+    /**
+     * The user's first name.
+     */
     private String firstName;
+
+    /**
+     * The user's last name.
+     */
     private String lastName;
+
+    /**
+     * The URL of a user's photo.
+     */
     private String photo;
+
+    /**
+     * The number of user's remaining hours of an overtime.
+     */
     private Float vacationCount;
-    private Integer sickdayCount;
-    private Integer takenSickdayCount;
+
+    /**
+     * The number of user's sick days available during a year.
+     */
+    private Integer sickDayCount;
+
+    /**
+     * The number of user's taken sick days.
+     */
+    private Integer takenSickDayCount;
+
+    /**
+     * The user's authorization status.
+     */
     private Status status;
+
+    /**
+     * The user's role.
+     */
     private UserRole role;
+
+    /**
+     * The date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
+     */
     private LocalDateTime notification;
+
+    /**
+     * The user's email address.
+     */
     private String email;
 
+    /**
+     * Returns the user's email address.
+     *
+     * @return the user's email address
+     */
     public String getEmail() {
-        return email;
+        return this.email;
     }
 
-    public void setEmail(String email) {
+    /**
+     * Replaces the user's email address with the new given value.
+     *
+     * @param email the new email address
+     */
+    public void setEmail(final String email) {
         this.email = email;
     }
 
+    /**
+     * Returns the user's ID.
+     *
+     * @return the user's ID
+     */
     public Long getId() {
-        return id;
+        return this.id;
     }
 
-    public void setId(Long id) {
+    /**
+     * Replaces the user's ID with the specified value.
+     *
+     * @param id the new user's ID
+     */
+    public void setId(final Long id) {
         this.id = id;
     }
 
+    /**
+     * Returns the user's first name.
+     *
+     * @return the user's first name
+     */
     public String getFirstName() {
-        return firstName;
+        return this.firstName;
     }
 
-    public Integer getTakenSickdayCount() {
-        return takenSickdayCount;
+    /**
+     * Returns the number of user's taken sick days.
+     *
+     * @return the number of user's taken sick days
+     */
+    public Integer getTakenSickDayCount() {
+        return this.takenSickDayCount;
     }
 
-    public void setTakenSickdayCount(Integer takenSickdayCount) {
-        this.takenSickdayCount = takenSickdayCount;
+    /**
+     * Replaces the number of user's taken sick days with the new value.
+     *
+     * @param takenSickDayCount the new number of taken sick days
+     */
+    public void setTakenSickDayCount(final Integer takenSickDayCount) {
+        this.takenSickDayCount = takenSickDayCount;
     }
 
-    public void setFirstName(String firstName) {
+    /**
+     * Replaces the user's first name with the new specified value.
+     *
+     * @param firstName the new first name
+     */
+    public void setFirstName(final String firstName) {
         this.firstName = firstName;
     }
 
+    /**
+     * Returns the user's last name.
+     *
+     * @return the user's last name
+     */
     public String getLastName() {
-        return lastName;
+        return this.lastName;
     }
 
-    public void setLastName(String lastName) {
+    /**
+     * Replaces the user's last name with the given one.
+     *
+     * @param lastName the new last name
+     */
+    public void setLastName(final String lastName) {
         this.lastName = lastName;
     }
 
+    /**
+     * Returns the URL of a user's photo.
+     *
+     * @return the URL of the user's photo
+     */
     public String getPhoto() {
-        return photo;
+        return this.photo;
     }
 
-    public void setPhoto(String photo) {
+    /**
+     * Replaces the URL of a user's photo with the given link.
+     *
+     * @param photo the new URL of the user's photo
+     */
+    public void setPhoto(final String photo) {
         this.photo = photo;
     }
 
+    /**
+     * Returns the number of user's remaining hours of an overtime.
+     *
+     * @return the number of user's remaining hours of the overtime
+     */
     public Float getVacationCount() {
-        return vacationCount;
+        return this.vacationCount;
     }
 
-    public void setVacationCount(Float vacationCount) {
+    /**
+     * Replaces the number of user's remaining hours of an overtime with the specified value.
+     *
+     * @param vacationCount the new number of remaining hours of the overtime.
+     */
+    public void setVacationCount(final Float vacationCount) {
         this.vacationCount = vacationCount;
     }
 
-    public Integer getSickdayCount() {
-        return sickdayCount;
+    /**
+     * Returns the number of user's sick days available during a year.
+     *
+     * @return the number of user's sick days available during the year
+     */
+    public Integer getSickDayCount() {
+        return this.sickDayCount;
     }
 
-    public void setSickdayCount(Integer sickdayCount) {
-        this.sickdayCount = sickdayCount;
+    /**
+     * Replaces the number of user's sick days available during a year with the new value.
+     *
+     * @param sickDayCount the new number of sick days available during the year
+     */
+    public void setSickDayCount(final Integer sickDayCount) {
+        this.sickDayCount = sickDayCount;
     }
 
+    /**
+     * Returns the user's authorization status.
+     *
+     * @return the user's authorization status
+     */
     public Status getStatus() {
-        return status;
+        return this.status;
     }
 
-    public void setStatus(Status status) {
+    /**
+     * Replaces the authorization status with the handed value.
+     *
+     * @param status the new authorization status
+     */
+    public void setStatus(final Status status) {
         this.status = status;
     }
 
+    /**
+     * Returns the user's role.
+     *
+     * @return the user's role
+     */
     public UserRole getRole() {
-        return role;
+        return this.role;
     }
 
-    public void setRole(UserRole role) {
+    /**
+     * Replaces the user's role with the new provided value.
+     *
+     * @param role the new role
+     */
+    public void setRole(final UserRole role) {
         this.role = role;
     }
 
+    /**
+     * Returns the date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
+     *
+     * @return the date and time
+     */
     public LocalDateTime getNotification() {
-        return notification;
+        return this.notification;
     }
 
-    public void setNotification(LocalDateTime notification) {
+    /**
+     * Replaces the date and time of sending an email warning about an incoming reset of remaining overtimes and sick days with the given value.
+     *
+     * @param notification the new date and time
+     */
+    public void setNotification(final LocalDateTime notification) {
         this.notification = notification;
     }
 }
\ No newline at end of file
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/RequestType.java b/server/src/main/java/cz/zcu/yamanager/dto/RequestType.java
index 0c5a7ad..5f9425c 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/RequestType.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/RequestType.java
@@ -1,13 +1,31 @@
 package cz.zcu.yamanager.dto;
 
-public enum  RequestType {
-    VACATION, AUTHORIZATION;
+/**
+ * The enum {@code RequestType} represents different types of a request.
+ */
+public enum RequestType {
+    /**
+     * The request for a vacation.
+     */
+    VACATION,
 
-    public static RequestType getType(String type) {
+    /**
+     * The request for an authorization.
+     */
+    AUTHORIZATION;
+
+    /**
+     * Creates the type of a request from the provided string.
+     * The method is case insensitive. If the given string does not correspond to any values of the enum the method returns null.
+     *
+     * @param type the string representation of the type of a request
+     * @return the value of the enum or null
+     */
+    public static RequestType getType(final String type) {
         if (type == null || type.isEmpty()) return null;
         try {
-            return valueOf(type.toUpperCase());
-        } catch (IllegalArgumentException e) {
+            return RequestType.valueOf(type.toUpperCase());
+        } catch (final IllegalArgumentException e) {
             return null;
         }
     }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/Status.java b/server/src/main/java/cz/zcu/yamanager/dto/Status.java
index 9cef5b8..0cc6085 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/Status.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/Status.java
@@ -1,13 +1,36 @@
 package cz.zcu.yamanager.dto;
 
+/**
+ * The enum {@code Status} represents states of authorization and vacation approval process.
+ */
 public enum Status {
-    ACCEPTED, PENDING, REJECTED;
+    /**
+     * The subject of a request is accepted.
+     */
+    ACCEPTED,
 
-    public static Status getStatus(String status) {
+    /**
+     * The subject of a request is waiting for an answer.
+     */
+    PENDING,
+
+    /**
+     * The subject of a request is rejected.
+     */
+    REJECTED;
+
+    /**
+     * Creates the status from the provided string.
+     * The method is case insensitive. If the given string does not correspond to any values of the enum the method returns null.
+     *
+     * @param status the string representation of the status
+     * @return the value of the enum or null
+     */
+    public static Status getStatus(final String status) {
         if (status == null || status.isEmpty()) return null;
         try {
-            return valueOf(status.toUpperCase());
-        } catch (IllegalArgumentException e) {
+            return Status.valueOf(status.toUpperCase());
+        } catch (final IllegalArgumentException e) {
             return null;
         }
     }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/UserRole.java b/server/src/main/java/cz/zcu/yamanager/dto/UserRole.java
index df15673..e1b7f9a 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/UserRole.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/UserRole.java
@@ -1,13 +1,31 @@
 package cz.zcu.yamanager.dto;
 
-public enum  UserRole {
-    EMPLOYEE, EMPLOYER;
+/**
+ * The enum {@code UserRole} represents different roles of a user.
+ */
+public enum UserRole {
+    /**
+     * The user is an employee.
+     */
+    EMPLOYEE,
 
-    public static UserRole getUserRole(String role) {
+    /**
+     * The user is na employer. This user has more rights than an employee.
+     */
+    EMPLOYER;
+
+    /**
+     * Creates the role from the provided string.
+     * The method is case insensitive. If the given string does not correspond to any values of the enum the method returns null.
+     *
+     * @param role the string representation of the role
+     * @return the value of the enum or null
+     */
+    public static UserRole getUserRole(final String role) {
         if (role == null || role.isEmpty()) return null;
         try {
-            return valueOf(role.toUpperCase());
-        } catch (IllegalArgumentException e) {
+            return UserRole.valueOf(role.toUpperCase());
+        } catch (final IllegalArgumentException e) {
             return null;
         }
     }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/UserSettings.java b/server/src/main/java/cz/zcu/yamanager/dto/UserSettings.java
index d28540f..919cb27 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/UserSettings.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/UserSettings.java
@@ -2,51 +2,123 @@ package cz.zcu.yamanager.dto;
 
 import java.time.LocalDateTime;
 
+/**
+ * The messenger class {@code UserSettings} is used to change user settings by an employer.
+ * This class is used in communication with a frontend.
+ */
 public class UserSettings {
-
+    /**
+     * The user's ID.
+     */
     private Long id;
+
+    /**
+     * The number of user's remaining hours of an overtime.
+     */
     private Float vacationCount;
-    private Integer sickdayCount;
+
+    /**
+     * The number of user's sick days available during a year.
+     */
+    private Integer sickDayCount;
+
+    /**
+     * The user's role.
+     */
     private UserRole role;
+
+    /**
+     * The date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
+     */
     private LocalDateTime notification;
 
+    /**
+     * Returns the user's ID.
+     *
+     * @return the user's ID
+     */
     public Long getId() {
-        return id;
+        return this.id;
     }
 
-    public void setId(Long id) {
+    /**
+     * Replaces the user's ID with the specified value.
+     *
+     * @param id the new user's ID
+     */
+    public void setId(final Long id) {
         this.id = id;
     }
 
+    /**
+     * Returns the number of user's remaining hours of an overtime.
+     *
+     * @return the number of user's remaining hours of the overtime
+     */
     public Float getVacationCount() {
-        return vacationCount;
+        return this.vacationCount;
     }
 
-    public void setVacationCount(Float vacationCount) {
+    /**
+     * Replaces the number of user's remaining hours of an overtime with the specified value.
+     *
+     * @param vacationCount the new number of remaining hours of the overtime.
+     */
+    public void setVacationCount(final Float vacationCount) {
         this.vacationCount = vacationCount;
     }
 
-    public Integer getSickdayCount() {
-        return sickdayCount;
+    /**
+     * Returns the number of user's sick days available during a year.
+     *
+     * @return the number of user's sick days available during the year
+     */
+    public Integer getSickDayCount() {
+        return this.sickDayCount;
     }
 
-    public void setSickdayCount(Integer sickdayCount) {
-        this.sickdayCount = sickdayCount;
+    /**
+     * Replaces the number of user's sick days available during a year with the new value.
+     *
+     * @param sickDayCount the new number of sick days available during the year
+     */
+    public void setSickDayCount(final Integer sickDayCount) {
+        this.sickDayCount = sickDayCount;
     }
 
+    /**
+     * Returns the user's role.
+     *
+     * @return the user's role
+     */
     public UserRole getRole() {
-        return role;
+        return this.role;
     }
 
-    public void setRole(UserRole role) {
+    /**
+     * Replaces the user's role with the new provided value.
+     *
+     * @param role the new role
+     */
+    public void setRole(final UserRole role) {
         this.role = role;
     }
 
+    /**
+     * Returns the date and time of sending an email warning about an incoming reset of remaining overtimes and sick days.
+     *
+     * @return the date and time
+     */
     public LocalDateTime getNotification() {
-        return notification;
+        return this.notification;
     }
 
-    public void setNotification(LocalDateTime notification) {
+    /**
+     * Replaces the date and time of sending an email warning about an incoming reset of remaining overtimes and sick days with the given value.
+     *
+     * @param notification the new date and time
+     */
+    public void setNotification(final LocalDateTime notification) {
         this.notification = notification;
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/VacationDay.java b/server/src/main/java/cz/zcu/yamanager/dto/VacationDay.java
index 9f65d43..2e2503e 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/VacationDay.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/VacationDay.java
@@ -3,60 +3,146 @@ package cz.zcu.yamanager.dto;
 import java.time.LocalDate;
 import java.time.LocalTime;
 
+/**
+ * The messenger class {@code VacationDay} holds informations of an overtime or a sick day taken by a user.
+ * This class is used in communication with a frontend.
+ */
 public class VacationDay {
-
+    /**
+     * The ID of this vacation.
+     */
     private Long id;
+
+    /**
+     * The date of this vacation.
+     */
     private LocalDate date;
+
+    /**
+     * The starting time of this vacation.
+     */
     private LocalTime from;
+
+    /**
+     * The ending time of this vacation.
+     */
     private LocalTime to;
+
+    /**
+     * The type of this vacation.
+     */
     private VacationType type;
+
+    /**
+     * The approval status of this vacation.
+     */
     private Status status;
 
+    /**
+     * Returns the ID of this vacation.
+     *
+     * @return the ID of this vacation
+     */
     public Long getId() {
-        return id;
+        return this.id;
     }
 
-    public void setId(Long id) {
+    /**
+     * Replaces the ID of this vacation with the specified value.
+     *
+     * @param id the new ID
+     */
+    public void setId(final Long id) {
         this.id = id;
     }
 
+    /**
+     * Returns the date of this vacation.
+     *
+     * @return the date of this vacation
+     */
     public LocalDate getDate() {
-        return date;
+        return this.date;
     }
 
-    public void setDate(LocalDate date) {
+    /**
+     * Replaces the date of this vacation with the specified date.
+     *
+     * @param date the new date
+     */
+    public void setDate(final LocalDate date) {
         this.date = date;
     }
 
+    /**
+     * Returns the starting time of this vacation.
+     *
+     * @return the starting time of this vacation
+     */
     public LocalTime getFrom() {
-        return from;
+        return this.from;
     }
 
-    public void setFrom(LocalTime from) {
+    /**
+     * Replaces the starting time of this vacation with the given time.
+     *
+     * @param from the new starting time
+     */
+    public void setFrom(final LocalTime from) {
         this.from = from;
     }
 
+    /**
+     * Returns the ending time of this vacation.
+     *
+     * @return the ending time of this vacation
+     */
     public LocalTime getTo() {
-        return to;
+        return this.to;
     }
 
-    public void setTo(LocalTime to) {
+    /**
+     * Replaces the ending time of this vacation with the provided time.
+     *
+     * @param to the new ending time
+     */
+    public void setTo(final LocalTime to) {
         this.to = to;
     }
 
+    /**
+     * Returns the type of this vacation.
+     *
+     * @return the type of this vacation
+     */
     public VacationType getType() {
-        return type;
+        return this.type;
     }
 
-    public void setType(VacationType type) {
+    /**
+     * Replaces the type of this vacation with the handed type.
+     *
+     * @param type the new type
+     */
+    public void setType(final VacationType type) {
         this.type = type;
     }
 
+    /**
+     * Returns the approval status of this vacation.
+     *
+     * @return the approval status of this vacation
+     */
     public Status getStatus() {
-        return status;
+        return this.status;
     }
 
-    public void setStatus(Status status) {
+    /**
+     * Replaces the approval status of this vacation with the given value.
+     *
+     * @param status the new approval status
+     */
+    public void setStatus(final Status status) {
         this.status = status;
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/VacationRequest.java b/server/src/main/java/cz/zcu/yamanager/dto/VacationRequest.java
index ecaad58..4afcf32 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/VacationRequest.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/VacationRequest.java
@@ -4,87 +4,216 @@ import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 
+/**
+ * An instance of the messenger class {@code VacationRequest} is just a different view of a user's vacation.
+ * It stores information relevant to the vacation which helps an employer to accept or reject the user's vacation.
+ * This class is used in a communication with a frontend.
+ */
 public class VacationRequest {
-
+    /**
+     * The ID of this vacation request.
+     */
     private Long id;
+
+    /**
+     * The user's first name.
+     */
     private String firstName;
+
+    /**
+     * The user's last name.
+     */
     private String lastName;
+
+    /**
+     * The date of this vacation request.
+     */
     private LocalDate date;
+
+    /**
+     * The starting time of this vacation request.
+     */
     private LocalTime from;
+
+    /**
+     * The ending time of this vacation request.
+     */
     private LocalTime to;
+
+    /**
+     * The type of this vacation request.
+     */
     private VacationType type;
+
+    /**
+     * The approval status of this vacation request.
+     */
     private Status status;
+
+    /**
+     * The date and time of a creation of this vacation request.
+     */
     private LocalDateTime timestamp;
 
+    /**
+     * Returns the ID of this vacation request.
+     *
+     * @return the ID of this vacation request
+     */
     public Long getId() {
-        return id;
+        return this.id;
     }
 
-    public void setId(Long id) {
+    /**
+     * Replaces the ID of this vacation request with the specified value.
+     *
+     * @param id the new ID
+     */
+    public void setId(final Long id) {
         this.id = id;
     }
 
+    /**
+     * Returns the user's first name.
+     *
+     * @return the user's first name
+     */
     public String getFirstName() {
-        return firstName;
+        return this.firstName;
     }
 
-    public void setFirstName(String firstName) {
+    /**
+     * Replaces the user's first name with the new specified value.
+     *
+     * @param firstName the new first name
+     */
+    public void setFirstName(final String firstName) {
         this.firstName = firstName;
     }
 
+    /**
+     * Returns the user's last name.
+     *
+     * @return the user's last name
+     */
     public String getLastName() {
-        return lastName;
+        return this.lastName;
     }
 
-    public void setLastName(String lastName) {
+    /**
+     * Replaces the user's last name with the given one.
+     *
+     * @param lastName the new last name
+     */
+    public void setLastName(final String lastName) {
         this.lastName = lastName;
     }
 
+    /**
+     * Returns the date of this vacation request.
+     *
+     * @return the date of this vacation request
+     */
     public LocalDate getDate() {
-        return date;
+        return this.date;
     }
 
-    public void setDate(LocalDate date) {
+    /**
+     * Replaces the date of this vacation request with the specified date.
+     *
+     * @param date the new date
+     */
+    public void setDate(final LocalDate date) {
         this.date = date;
     }
 
+    /**
+     * Returns the starting time of this vacation request.
+     *
+     * @return the starting time of this vacation request
+     */
     public LocalTime getFrom() {
-        return from;
+        return this.from;
     }
 
-    public void setFrom(LocalTime from) {
+    /**
+     * Replaces the starting time of this vacation request with the given time.
+     *
+     * @param from the new starting time
+     */
+    public void setFrom(final LocalTime from) {
         this.from = from;
     }
 
+    /**
+     * Returns the ending time of this vacation request.
+     *
+     * @return the ending time of this vacation request
+     */
     public LocalTime getTo() {
-        return to;
+        return this.to;
     }
 
-    public void setTo(LocalTime to) {
+    /**
+     * Replaces the ending time of this vacation request with the provided time.
+     *
+     * @param to the new ending time
+     */
+    public void setTo(final LocalTime to) {
         this.to = to;
     }
 
+    /**
+     * Returns the type of this vacation request.
+     *
+     * @return the type of this vacation request
+     */
     public VacationType getType() {
-        return type;
+        return this.type;
     }
 
-    public void setType(VacationType type) {
+    /**
+     * Replaces the type of this vacation request with the handed type.
+     *
+     * @param type the new type
+     */
+    public void setType(final VacationType type) {
         this.type = type;
     }
 
+    /**
+     * Returns the approval status of this vacation request.
+     *
+     * @return the approval status of this vacation request
+     */
     public Status getStatus() {
-        return status;
+        return this.status;
     }
 
-    public void setStatus(Status status) {
+    /**
+     * Replaces the approval status of this vacation request with the given value.
+     *
+     * @param status the new approval status
+     */
+    public void setStatus(final Status status) {
         this.status = status;
     }
 
+    /**
+     * Returns the date and time of a creation of this vacation request.
+     *
+     * @return the date and time of the creation of this vacation request
+     */
     public LocalDateTime getTimestamp() {
-        return timestamp;
+        return this.timestamp;
     }
 
-    public void setTimestamp(LocalDateTime timestamp) {
+    /**
+     * Replaces the date and time of a creation of this vacation request with the specified timestamp.
+     *
+     * @param timestamp the date and time of the creation of this vacation request
+     */
+    public void setTimestamp(final LocalDateTime timestamp) {
         this.timestamp = timestamp;
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/dto/VacationType.java b/server/src/main/java/cz/zcu/yamanager/dto/VacationType.java
index e3d5226..c8aed06 100644
--- a/server/src/main/java/cz/zcu/yamanager/dto/VacationType.java
+++ b/server/src/main/java/cz/zcu/yamanager/dto/VacationType.java
@@ -1,13 +1,31 @@
 package cz.zcu.yamanager.dto;
 
+/**
+ * The enum {@code VacationType} represents different types of a vacation.
+ */
 public enum VacationType {
-    SICKDAY, VACATION;
+    /**
+     * The vacation represents a sick day.
+     */
+    SICKDAY,
 
-    public static VacationType getVacationType(String type) {
+    /**
+     * The vacation represents an overtime.
+     */
+    VACATION;
+
+    /**
+     * Creates the type of a vacation from the provided string.
+     * The method is case insensitive. If the given string does not correspond to any values of the enum the method returns null.
+     *
+     * @param type the string representation of the type of a vacation
+     * @return the value of the enum or null
+     */
+    public static VacationType getVacationType(final String type) {
         if (type == null || type.isEmpty()) return null;
         try {
-            return valueOf(type.toUpperCase());
-        } catch (IllegalArgumentException e) {
+            return VacationType.valueOf(type.toUpperCase());
+        } catch (final IllegalArgumentException e) {
             return null;
         }
     }
diff --git a/server/src/main/java/cz/zcu/yamanager/repository/RequestRepository.java b/server/src/main/java/cz/zcu/yamanager/repository/RequestRepository.java
index c7f0b77..576f7c0 100644
--- a/server/src/main/java/cz/zcu/yamanager/repository/RequestRepository.java
+++ b/server/src/main/java/cz/zcu/yamanager/repository/RequestRepository.java
@@ -7,13 +7,16 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Repository;
 
-import java.security.InvalidParameterException;
 import java.sql.ResultSet;
 import java.sql.Time;
 import java.util.List;
 
 /**
  * An instance of the class RequestRepository handles queries which selects and updates requests in a database.
+ * Requests are of two types. The first is an authorization request which is just a different view of a user.
+ * It shows information relevant to a user's authorization in the application. The second one is called a vacation
+ * request which works like the authorization request but for vacations and contains informations showed to an employer
+ * to help him approve or reject the vacation.
  */
 @Repository
 public class RequestRepository {
@@ -28,9 +31,9 @@ public class RequestRepository {
     private final JdbcTemplate jdbc;
 
     /**
-     * Creates a new instance of the class RequestRepository which selects and updates requests in a database.
+     * Creates a manager which can select and update requests in a database with the specified connection.
      *
-     * @param jdbc A connection to the database.
+     * @param jdbc the connection to the database
      */
     @Autowired
     public RequestRepository(final JdbcTemplate jdbc) {
@@ -39,9 +42,12 @@ public class RequestRepository {
     }
 
     /**
-     * Gets all authorization request from a database.
+     * Gets all authorization requests from a database. Method returns all authorization requests despite
+     * its authorization status. It returns accepted, pending even rejected users.
+     * Every line of output is converted to an AuthorizationRequest object filled with data from the database.
+     * If there aren't any authorization requests (that means any users) in the database, the method returns an empty list.
      *
-     * @return A list of all authorization requests.
+     * @return the list of all authorization requests
      */
     public List<AuthorizationRequest> getAllAuthorizations() {
         RequestRepository.log.trace("Selecting all authorization requests from a database.");
@@ -59,15 +65,18 @@ public class RequestRepository {
     }
 
     /**
-     * Gets all authorization request with the given status from a database.
+     * Gets all authorization request with the given authorization status from a database.
+     * Every line of output is converted to an AuthorizationRequest object filled with data from the database.
+     * If there aren't any authorization requests (that means any users) with the given status in the database,
+     * the method returns an empty list.
      *
-     * @param status The approval status of the requests.
-     * @return A list of all authorization requests.
+     * @param status the approval status of the requests
+     * @return the list of all authorization requests with the given status
      */
     public List<AuthorizationRequest> getAllAuthorizations(final Status status) {
-        RequestRepository.log.debug("Selecting all authorization requests from a database with requested status: {}", status);
+        RequestRepository.log.trace("Selecting all authorization requests from a database with requested status.");
+        RequestRepository.log.debug("Status: {}", status);
 
-        if (status == null) throw new InvalidParameterException();
         return this.jdbc.query("SELECT id, first_name, last_name, creation_date FROM end_user WHERE status = ?",
                 new Object[]{status.name()},
                 (ResultSet rs, int rowNum) -> {
@@ -82,39 +91,43 @@ public class RequestRepository {
     }
 
     /**
-     * Updates a status of an authorization request with the given id.
+     * Updates the status of an authorization request with the given id.
      *
-     * @param id     The id of the request.
-     * @param status The new status of the request.
+     * @param id     the id of the request
+     * @param status the new status of the request
      */
     public void updateAuthorization(final long id, final Status status) {
-        RequestRepository.log.debug("Updating authorization request with id {} in a database to {}.", id, status);
+        RequestRepository.log.trace("Updating status of an authorization request.");
+        RequestRepository.log.debug("Id: {}, status: {}.", id, status);
 
         this.jdbc.update("UPDATE end_user SET status=? WHERE id=?", status.name(), id);
     }
 
     /**
-     * Updates a status of an authorization request from a BasicRequest object.
+     * Updates the status of an authorization request from the specified BasicRequest object.
      *
-     * @param request The BasicRequest object with new values of the vacation request.
+     * @param request the BasicRequest object with new values of the vacation request
      */
     public void updateAuthorization(final BasicRequest request) {
-        updateAuthorization(request.getId(), request.getStatus());
+        this.updateAuthorization(request.getId(), request.getStatus());
     }
 
     /**
-     * Updates a status of an authorization request from an AuthorizationRequest object.
+     * Updates the status of an authorization request from the given AuthorizationRequest object.
      *
-     * @param request The AuthorizationRequest object with new values of the authorization request.
+     * @param request the AuthorizationRequest object with new values of the authorization request
      */
     public void updateAuthorization(final AuthorizationRequest request) {
-        updateAuthorization(request.getId(), request.getStatus());
+        this.updateAuthorization(request.getId(), request.getStatus());
     }
 
     /**
-     * Gets all vacation request from a database.
+     * Gets all vacation requests from a database. Method returns all vacation requests despite
+     * its authorization status. It returns accepted, pending even rejected vacations.
+     * Every line of output is converted to a VacationRequest object filled with data from the database.
+     * If there aren't any vacation requests in the database, the method returns an empty list.
      *
-     * @return A list of all vacation requests.
+     * @return the list of all vacation requests
      */
     public List<VacationRequest> getAllVacationRequests() {
         RequestRepository.log.trace("Selecting all vacation requests from a database.");
@@ -128,6 +141,12 @@ public class RequestRepository {
                     request.setFirstName(rs.getString("u.first_name"));
                     request.setLastName(rs.getString("u.last_name"));
                     request.setDate(rs.getDate("v.vacation_date").toLocalDate());
+
+                    /*
+                        When a result contains a sickday it doesn't have specified a start and end time because
+                        it can be taken only as a whole day. In this case the v.time_from and v.time_to are null.
+                        Which must be handled.
+                     */
                     final Time timeFrom = rs.getTime("v.time_from");
                     if (timeFrom != null) {
                         request.setFrom(timeFrom.toLocalTime());
@@ -146,15 +165,17 @@ public class RequestRepository {
     }
 
     /**
-     * Gets all vacation request with the given status from a database.
+     * Gets all vacation requests with the given approval status from a database.
+     * Every line of output is converted to a VacationRequest object filled with data from the database.
+     * If there aren't any vacation requests with the given status in the database, the method returns an empty list.
      *
-     * @param status The approval status of the requests.
-     * @return A list of all vacation requests.
+     * @param status the approval status of the requests
+     * @return the list of all vacation requests with the given status
      */
     public List<VacationRequest> getAllVacationRequests(final Status status) {
-        RequestRepository.log.debug("Selecting all vacation requests from a database with requested status: {}", status);
+        RequestRepository.log.trace("Selecting all vacation requests from a database with requested status.");
+        RequestRepository.log.debug("Status: {}", status);
 
-        if (status == null) throw new InvalidParameterException();
         return this.jdbc.query("SELECT v.id, v.vacation_date, v.time_from, v.time_to, v.creation_date, v.vacation_type, v.status, u.first_name, u.last_name " +
                         "FROM vacation_day v " +
                         "INNER JOIN end_user u ON v.user_id = u.id " +
@@ -166,6 +187,12 @@ public class RequestRepository {
                     request.setFirstName(rs.getString("u.first_name"));
                     request.setLastName(rs.getString("u.last_name"));
                     request.setDate(rs.getDate("v.vacation_date").toLocalDate());
+
+                     /*
+                        When a result contains a sickday it doesn't have specified start and end time because
+                        it can be taken only as a whole day. In this case the v.time_from and v.time_to are null.
+                        Which must be handled.
+                     */
                     final Time timeFrom = rs.getTime("v.time_from");
                     if (timeFrom != null) {
                         request.setFrom(timeFrom.toLocalTime());
@@ -186,11 +213,12 @@ public class RequestRepository {
     /**
      * Updates a status of a vacation request with the given id.
      *
-     * @param id     The id of the request.
-     * @param status The new status of the request.
+     * @param id     the id of the request
+     * @param status the new status of the request
      */
     public void updateVacationRequest(final long id, final Status status) {
-        RequestRepository.log.debug("Updating vacation request with id {} in a database to {}.", id, status);
+        RequestRepository.log.trace("Updating status of a vacation request");
+        RequestRepository.log.debug("Id: {}, status: {}.", id, status);
 
         this.jdbc.update("UPDATE vacation_day SET status=? WHERE id=?", status.name(), id);
     }
@@ -198,18 +226,18 @@ public class RequestRepository {
     /**
      * Updates a status of a vacation request from a BasicRequest object.
      *
-     * @param request The BasicRequest object with new values of the vacation request.
+     * @param request the BasicRequest object with new values of the vacation request
      */
     public void updateVacationRequest(final BasicRequest request) {
-        updateVacationRequest(request.getId(), request.getStatus());
+        this.updateVacationRequest(request.getId(), request.getStatus());
     }
 
     /**
      * Updates a status of a vacation request from a VacationRequest object.
      *
-     * @param request The VacationRequest object with new values of the vacation request.
+     * @param request the VacationRequest object with new values of the vacation request
      */
     public void updateVacationRequest(final VacationRequest request) {
-        updateAuthorization(request.getId(), request.getStatus());
+        this.updateAuthorization(request.getId(), request.getStatus());
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/repository/TestRepository.java b/server/src/main/java/cz/zcu/yamanager/repository/TestRepository.java
deleted file mode 100644
index a29369f..0000000
--- a/server/src/main/java/cz/zcu/yamanager/repository/TestRepository.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package cz.zcu.yamanager.repository;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public class TestRepository {
-
-    private static final Logger log = LoggerFactory.getLogger(TestRepository.class);
-
-    private final JdbcTemplate jdbc;
-
-    @Autowired
-    public TestRepository(JdbcTemplate jdbc) {
-        this.jdbc = jdbc;
-    }
-
-    /*
-    public List<AuthorizationRequest> getAllUserRequests() {
-        return jdbc.query("SELECT id, first_name, last_name FROM end_user", (ResultSet rs, int rowNum) -> {
-            AuthorizationRequest request = new AuthorizationRequest();
-            request.setId(rs.getLong("id"));
-            request.setUserName(rs.getString("first_name"), rs.getString("last_name"));
-
-            // No timestamp
-
-            return request;
-        });
-    }
-
-    public List<AuthorizationRequest> getAllPendingUserRequests() {
-        return jdbc.query("SELECT id, first_name, last_name FROM end_user WHERE status_id=2", (ResultSet rs, int rowNum) -> {
-            AuthorizationRequest request = new AuthorizationRequest();
-            request.setId(rs.getLong("id"));
-            request.setUserName(rs.getString("first_name"), rs.getString("last_name"));
-
-            // No timestamp
-
-            return request;
-        });
-    }
-
-    public void updateApproval(BasicRequest request) {
-        if (request.getType() == RequestType.AUTHORIZATION) {
-            jdbc.update("UPDATE end_user SET status_id=? WHERE id=?", request.getStatus().ordinal(), request.getId());
-        } else {
-            jdbc.update("UPDATE vacation_day SET status_id=? WHERE id=?", request.getStatus().ordinal(), request.getId());
-        }
-    }
-
-    public List<VacationDay> getCalendarItems(long userId, LocalDate from, LocalDate to) {
-        return jdbc.query("SELECT vacation_date, time_from, time_to, type_id, status_id FROM vacation_day WHERE user_id=? AND vacation_date >= ? AND vacation_date <= ?",
-                new Object[]{userId, from, to}, (ResultSet rs, int rowNum) -> {
-            VacationDay item = new VacationDay();
-            item.setDate(rs.getDate("day.vacation_date").toLocalDate());
-            item.setFrom(rs.getTime("day.time_from").toLocalTime());
-            item.setTo(rs.getTime("day.time_to").toLocalTime());
-            item.setType(VacationType.values()[rs.getByte("type_id")]);
-            item.setStatus(RequestStatus.values()[rs.getByte("status_id")]);
-            return item;
-        });
-    }
-
-    public void insertCalendarItem(VacationDay item) {
-        jdbc.update("INSERT INTO vacation_day (vacation_date, time_from, time_to, user_id, status_id, type_id) VALUES (?,?,?,?,?,?)",
-                item.getDate(), item.getFrom(), item.getTo(), item.getUserId(), item.getStatus().ordinal(), item.getType().ordinal());
-    }
-
-    public void updateCalendarItem(VacationDay item) {
-        jdbc.update("UPDATE vacation_day SET vacation_date=?, time_from=?, time_to=?, user_id=?, status_id=?, type_id=? WHERE id=?",
-                item.getDate(), item.getFrom(), item.getTo(), item.getUserId(), item.getStatus().ordinal(), item.getType().ordinal(), item.getId());
-    }
-
-    public DefaultSettings getLastSettings() {
-        return jdbc.queryForObject("SELECT * FROM default_settings ORDER BY id DESC LIMIT 1", (ResultSet rs, int rowNum) -> {
-            DefaultSettings settings = new DefaultSettings();
-            settings.setSickDay(rs.getShort("no_sick_days"), VacationUnit.DAY);
-            settings.setNotification(rs.getTimestamp("alert").toLocalDateTime());
-            return settings;
-        });
-    }
-
-    public void insertSettings(DefaultSettings settings) {
-        jdbc.update("INSERT INTO default_settings (no_sick_days, alert) VALUES (?, ?)", settings.getSickDay().getValue(), settings.getNotification());
-    }
-
-    public List<BasicProfileUser> getAllBasicUsers() {
-        return jdbc.query("SELECT id, first_name, last_name, photo FROM end_user", (ResultSet rs, int rowNum) -> {
-            BasicProfileUser user = new BasicProfileUser();
-            user.setId(rs.getLong("id"));
-            user.setName(rs.getString("first_name"), rs.getString("last_name"));
-            user.setPhoto(rs.getString("photo"));
-            return user;
-        });
-    }
-
-    public FullUserProfile getFullUser(long id) {
-        return jdbc.queryForObject("SELECT first_name, last_name, no_vacation, no_sick_days, alert, photo, role_id, status_id FROM end_user WHERE id=?",
-                new Object[]{id}, (ResultSet rs, int rowNum) -> {
-            FullUserProfile user = new FullUserProfile();
-            user.setId(id);
-            user.setName(rs.getString("first_name"), rs.getString("last_name"));
-            user.setVacation(rs.getFloat("no_vacation"), VacationUnit.HOUR);
-            user.setSickDay(rs.getShort("no_sick_days"), VacationUnit.DAY);
-            user.setNotification(rs.getTimestamp("alert").toLocalDateTime());
-            user.setPhoto(rs.getString("photo"));
-            user.setRole(UserRole.values()[rs.getByte("role_id")]);
-            user.setStatus(Status.values()[rs.getByte("status_id")]);
-            return user;
-        });
-    }
-
-    public FullUserProfile getFullUser(String token) {
-        return jdbc.queryForObject("SELECT id, first_name, last_name, no_vacation, no_sick_days, alert, photo, role_id, status_id FROM end_user WHERE token=?",
-                new Object[]{token}, (ResultSet rs, int rowNum) -> {
-            FullUserProfile user = new FullUserProfile();
-            user.setId(rs.getLong("id"));
-            user.setName(rs.getString("first_name"), rs.getString("last_name"));
-            user.setVacation(rs.getFloat("no_vacation"), VacationUnit.HOUR);
-            user.setSickDay(rs.getShort("no_sick_days"), VacationUnit.DAY);
-            user.setNotification(rs.getTimestamp("alert").toLocalDateTime());
-            user.setPhoto(rs.getString("photo"));
-            user.setRole(UserRole.values()[rs.getByte("role_id")]);
-            user.setStatus(Status.values()[rs.getByte("status_id")]);
-            return user;
-        });
-    }
-    */
-}
diff --git a/server/src/main/java/cz/zcu/yamanager/repository/UserRepository.java b/server/src/main/java/cz/zcu/yamanager/repository/UserRepository.java
index 1032704..07d56f0 100644
--- a/server/src/main/java/cz/zcu/yamanager/repository/UserRepository.java
+++ b/server/src/main/java/cz/zcu/yamanager/repository/UserRepository.java
@@ -14,6 +14,9 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+/**
+ * An instance of the class UserRepository handles queries which selects and updates users and their settings in a database.
+ */
 @Repository
 public class UserRepository {
     /**
@@ -27,19 +30,28 @@ public class UserRepository {
     private final JdbcTemplate jdbc;
 
     /**
-     * Creates a new instance of the class UserRepository which selects and updates users in a database.
+     * Creates a new instance of the class UserRepository which selects and updates users and their settings in a database.
      *
      * @param jdbc A connection to the database.
      */
     @Autowired
-    public UserRepository(JdbcTemplate jdbc) {
-        log.trace("Creating a new instance of the class UserRepository");
+    public UserRepository(final JdbcTemplate jdbc) {
+        UserRepository.log.trace("Creating a new instance of the class UserRepository");
         this.jdbc = jdbc;
     }
 
+    /**
+     * Gets basic profile of each user from a database. The basic profile contains default, the most important
+     * informations which helps identify a user like a name or photo. Every line of output is converted to a BasicProfileUser
+     * object filled with data from the database. If there aren't any users in the database, the method returns an empty list.
+     *
+     * @return A list of all basic profiles.
+     */
     public List<BasicProfileUser> getAllBasicUsers() {
-        return jdbc.query("SELECT id, first_name, last_name, photo FROM end_user", (ResultSet rs, int rowNum) -> {
-            BasicProfileUser user = new BasicProfileUser();
+        UserRepository.log.trace("Selecting basic profiles of all users from a database.");
+
+        return this.jdbc.query("SELECT id, first_name, last_name, photo FROM end_user", (ResultSet rs, int rowNum) -> {
+            final BasicProfileUser user = new BasicProfileUser();
             user.setId(rs.getLong("id"));
             user.setFirstName(rs.getString("first_name"));
             user.setLastName(rs.getString("last_name"));
@@ -48,10 +60,22 @@ public class UserRepository {
         });
     }
 
-    public List<BasicProfileUser> getAllBasicUsers(Status status) {
-        return jdbc.query("SELECT id, first_name, last_name, photo FROM end_user WHERE status = ?",
+    /**
+     * Gets basic profile of each user with the given authorization status from a database. The basic profile contains
+     * default, the most important informations which helps identify a user like a name or a photo.
+     * Every line of output is converted to a BasicProfileUser object filled with data from the database.
+     * If there aren't any users with the given authorization status in the database, the method returns an empty list.
+     *
+     * @param status The authentication status.
+     * @return A list of all basic profiles with the given status.
+     */
+    public List<BasicProfileUser> getAllBasicUsers(final Status status) {
+        UserRepository.log.trace("Selecting basic profiles of all users with a required status from a database.");
+        UserRepository.log.debug("Status: {}", status);
+
+        return this.jdbc.query("SELECT id, first_name, last_name, photo FROM end_user WHERE status = ?",
                 new Object[]{status.name()}, (ResultSet rs, int rowNum) -> {
-                    BasicProfileUser user = new BasicProfileUser();
+                    final BasicProfileUser user = new BasicProfileUser();
                     user.setId(rs.getLong("id"));
                     user.setFirstName(rs.getString("first_name"));
                     user.setLastName(rs.getString("last_name"));
@@ -60,8 +84,16 @@ public class UserRepository {
                 });
     }
 
-    public FullUserProfile getFullUser(long id) {
-        List<SqlParameter> paramList = new ArrayList<>();
+    /**
+     *
+     * @param id
+     * @return
+     */
+    public FullUserProfile getFullUser(final long id) {
+        UserRepository.log.trace("Selecting full profiles of a user with a specified id from a database ");
+        UserRepository.log.debug("Id: {}", id);
+
+        final List<SqlParameter> paramList = new ArrayList<>();
         paramList.add(new SqlParameter("in_id", Types.BIGINT));
         paramList.add(new SqlOutParameter("out_id", Types.BIGINT));
         paramList.add(new SqlOutParameter("out_first_name", Types.VARCHAR));
@@ -76,8 +108,8 @@ public class UserRepository {
         paramList.add(new SqlOutParameter("out_role", Types.VARCHAR));
         paramList.add(new SqlOutParameter("out_status", Types.VARCHAR));
 
-        Map<String, Object> resultMap = this.jdbc.call(con -> {
-            CallableStatement callableStatement = con.prepareCall("{call GetUserId(?,?,?,?,?,?,?,?,?,?,?,?,?)}");
+        final Map<String, Object> resultMap = jdbc.call(con -> {
+            final CallableStatement callableStatement = con.prepareCall("{call GetUserId(?,?,?,?,?,?,?,?,?,?,?,?,?)}");
             callableStatement.setLong(1, id);
             callableStatement.registerOutParameter(2, Types.BIGINT);
             callableStatement.registerOutParameter(3, Types.VARCHAR);
@@ -94,19 +126,14 @@ public class UserRepository {
             return callableStatement;
         }, paramList);
 
-        FullUserProfile user = new FullUserProfile();
+        final FullUserProfile user = new FullUserProfile();
         user.setId(id);
         user.setFirstName((String) resultMap.get("out_first_name"));
         user.setLastName((String) resultMap.get("out_last_name"));
         user.setVacationCount(((Double) resultMap.get("out_no_vacations")).floatValue());
-        user.setSickdayCount((Integer) resultMap.get("out_no_sick_days"));
-        user.setTakenSickdayCount((Integer) resultMap.get("out_taken_sick_days"));
-
-        final Timestamp alertTimestamp = (Timestamp) resultMap.get(("out_alert"));
-        if (alertTimestamp != null) {
-            user.setNotification(alertTimestamp.toLocalDateTime());
-        }
-
+        user.setSickDayCount((Integer) resultMap.get("out_no_sick_days"));
+        user.setTakenSickDayCount((Integer) resultMap.get("out_taken_sick_days"));
+        user.setNotification(((Timestamp) resultMap.get("out_alert")).toLocalDateTime());
         user.setEmail((String) resultMap.get(("out_email")));
         user.setPhoto((String) resultMap.get("out_photo"));
         user.setRole(UserRole.getUserRole((String) resultMap.get("out_role")));
@@ -115,8 +142,16 @@ public class UserRepository {
 
     }
 
-    public FullUserProfile getFullUser(String token) {
-        List<SqlParameter> paramList = new ArrayList<>();
+    public UserRole getUserRole(final long id) {
+        return this.jdbc.queryForObject("SELECT user_role FROM end_user WHERE id = ?", new Object[]{id}, (ResultSet rs, int rowNum) -> UserRole.getUserRole(rs.getString("status")));
+    }
+
+    public Status getUserStatus(final long id) {
+        return this.jdbc.queryForObject("SELECT status FROM end_user WHERE id = ?", new Object[]{id}, (ResultSet rs, int rowNum) -> Status.getStatus(rs.getString("status")));
+    }
+
+    public FullUserProfile getFullUser(final String token) {
+        final List<SqlParameter> paramList = new ArrayList<>();
         paramList.add(new SqlParameter(Types.LONGNVARCHAR));
         paramList.add(new SqlOutParameter("out_id", Types.BIGINT));
         paramList.add(new SqlOutParameter("out_first_name", Types.VARCHAR));
@@ -131,8 +166,8 @@ public class UserRepository {
         paramList.add(new SqlOutParameter("out_role", Types.VARCHAR));
         paramList.add(new SqlOutParameter("out_status", Types.VARCHAR));
 
-        Map<String, Object> resultMap = this.jdbc.call(con -> {
-            CallableStatement callableStatement = con.prepareCall("{call GetUserToken(?,?,?,?,?,?,?,?,?,?,?,?,?)}");
+        final Map<String, Object> resultMap = jdbc.call(con -> {
+            final CallableStatement callableStatement = con.prepareCall("{call GetUserToken(?,?,?,?,?,?,?,?,?,?,?,?,?)}");
             callableStatement.setString(1, token);
             callableStatement.registerOutParameter(2, Types.BIGINT);
             callableStatement.registerOutParameter(3, Types.VARCHAR);
@@ -149,19 +184,14 @@ public class UserRepository {
             return callableStatement;
         }, paramList);
 
-        FullUserProfile user = new FullUserProfile();
+        final FullUserProfile user = new FullUserProfile();
         user.setId((Long) resultMap.get("out_id"));
         user.setFirstName((String) resultMap.get("out_first_name"));
         user.setLastName((String) resultMap.get("out_last_name"));
         user.setVacationCount(((Double) resultMap.get("out_no_vacations")).floatValue());
-        user.setSickdayCount((Integer) resultMap.get("out_no_sick_days"));
-        user.setTakenSickdayCount((Integer) resultMap.get("out_taken_sick_days"));
-
-        final Timestamp alertTimestamp = (Timestamp) resultMap.get(("out_alert"));
-        if (alertTimestamp != null) {
-            user.setNotification(alertTimestamp.toLocalDateTime());
-        }
-
+        user.setSickDayCount((Integer) resultMap.get("out_no_sick_days"));
+        user.setTakenSickDayCount((Integer) resultMap.get("out_taken_sick_days"));
+        user.setNotification(((Timestamp) resultMap.get("out_alert")).toLocalDateTime());
         user.setEmail((String) resultMap.get(("out_email")));
         user.setPhoto((String) resultMap.get("out_photo"));
         user.setRole(UserRole.getUserRole((String) resultMap.get("out_role")));
@@ -169,37 +199,45 @@ public class UserRepository {
         return user;
     }
 
-    public UserSettings getUserSettings(long id) {
-        return jdbc.queryForObject("SELECT no_vacations, no_sick_days, user_role FROM end_user WHERE = id=?",
+    public UserSettings getUserSettings(final long id) {
+        return this.jdbc.queryForObject("SELECT no_vacations, no_sick_days, user_role FROM end_user WHERE id=?",
                 new Object[]{id}, (ResultSet rs, int rowNum) -> {
-                    UserSettings settings = new UserSettings();
+                    final UserSettings settings = new UserSettings();
                     settings.setId(id);
-                    settings.setSickdayCount(rs.getInt("no_sick_day"));
+                    settings.setSickDayCount(rs.getInt("no_sick_day"));
                     settings.setVacationCount(rs.getFloat("no_vacations"));
                     settings.setRole(UserRole.getUserRole(rs.getString("user_role")));
                     return settings;
                 });
     }
 
-    public void updateNotification(UserSettings settings) {
-        jdbc.update("UPDATE end_user SET alert = ? WHERE id = ?", settings.getNotification(), settings.getId());
+    public void decreaseVacationCount(final long id, final float value) {
+        this.jdbc.update("UPDATE end_user SET no_vacations = no_vacations - ? WHERE id = ?", value, id);
+    }
+
+    public void increaseTakenSickdays(final long id) {
+        this.jdbc.update("UPDATE end_user SET taken_sick_days = taken_sick_days + 1 WHERE id = ?", id);
+    }
+
+    public void updateNotification(final UserSettings settings) {
+        this.jdbc.update("UPDATE end_user SET alert = ? WHERE id = ?", settings.getNotification(), settings.getId());
     }
 
-    public void updateUserSettings(UserSettings settings) {
-        jdbc.update("UPDATE end_user SET no_vacations=?, no_sick_days=?, user_role=? WHERE id = ?",
-                settings.getVacationCount(), settings.getSickdayCount(), settings.getRole().name(), settings.getId());
+    public void updateUserSettings(final UserSettings settings) {
+        this.jdbc.update("UPDATE end_user SET no_vacations=?, no_sick_days=?, user_role=? WHERE id = ?",
+                settings.getVacationCount(), settings.getSickDayCount(), settings.getRole().name(), settings.getId());
     }
 
     public DefaultSettings getLastDefaultSettings() {
-        return jdbc.queryForObject("SELECT * FROM default_settings ORDER BY id DESC LIMIT 1", (ResultSet rs, int rowNum) -> {
-            DefaultSettings settings = new DefaultSettings();
-            settings.setSickdayCount(rs.getInt("no_sick_days"));
+        return this.jdbc.queryForObject("SELECT * FROM default_settings ORDER BY id DESC LIMIT 1", (ResultSet rs, int rowNum) -> {
+            final DefaultSettings settings = new DefaultSettings();
+            settings.setSickDayCount(rs.getInt("no_sick_days"));
             settings.setNotification(rs.getTimestamp("alert").toLocalDateTime());
             return settings;
         });
     }
 
-    public void insertSettings(DefaultSettings settings) {
-        jdbc.update("INSERT INTO default_settings (no_sick_days, alert) VALUES (?, ?)", settings.getSickdayCount(), settings.getNotification());
+    public void insertSettings(final DefaultSettings settings) {
+        this.jdbc.update("INSERT INTO default_settings (no_sick_days, alert) VALUES (?, ?)", settings.getSickDayCount(), settings.getNotification());
     }
 }
diff --git a/server/src/main/java/cz/zcu/yamanager/repository/VacationRepository.java b/server/src/main/java/cz/zcu/yamanager/repository/VacationRepository.java
index 56d2661..6990698 100644
--- a/server/src/main/java/cz/zcu/yamanager/repository/VacationRepository.java
+++ b/server/src/main/java/cz/zcu/yamanager/repository/VacationRepository.java
@@ -142,7 +142,7 @@ public class VacationRepository {
 
     public void insertVacationDay(final Long userId, final VacationDay day) {
         this.jdbc.update("INSERT INTO vacation_day (vacation_date, time_from, time_to, status, vacation_type, user_id) VALUES (?,?,?,?,?,?)",
-                day.getDate(), day.getFrom(), day.getTo(), "pending", day.getType().name(), userId);
+                day.getDate(), day.getFrom(), day.getTo(), day.getStatus().name(), day.getType().name(), userId);
     }
 
     public void updateVacationDay(final VacationDay item) {
diff --git a/server/src/main/java/cz/zcu/yamanager/ws/rest/ApiController.java b/server/src/main/java/cz/zcu/yamanager/ws/rest/ApiController.java
index aade45a..738f421 100644
--- a/server/src/main/java/cz/zcu/yamanager/ws/rest/ApiController.java
+++ b/server/src/main/java/cz/zcu/yamanager/ws/rest/ApiController.java
@@ -121,7 +121,6 @@ public class ApiController {
             @RequestParam(value = "lang", required = false) String lang,
             @RequestParam(value = "status", required = false) String status)
     {
-        System.out.println("/users");
         return handle(getLanguage(lang), () ->
                 manager.getUsers(getStatus(status))
         );
@@ -132,8 +131,6 @@ public class ApiController {
             @RequestParam(value = "lang", required = false) String lang,
             @RequestParam(value = "status", required = false) String status)
     {
-        System.out.println("/users/requests/vacation");
-        System.out.println("Status" + status);
         return handle(getLanguage(lang), () ->
                 manager.getVacationRequests(getStatus(status))
         );
@@ -144,7 +141,6 @@ public class ApiController {
             @RequestParam(value = "lang", required = false) String lang,
             @RequestParam(value = "status", required = false) String status)
     {
-        System.out.println("/users/requests/authorization");
         return handle(getLanguage(lang), () ->
                 manager.getAuthorizationRequests(getStatus(status))
          );
@@ -155,7 +151,6 @@ public class ApiController {
             @PathVariable("id") String id,
             @RequestParam(value = "lang", required = false) String lang)
     {
-        System.out.println("/user/{id}/profile");
         return handle(getLanguage(lang), () ->
                 manager.getUserProfile(getUserId(id))
         );
@@ -169,7 +164,6 @@ public class ApiController {
             @RequestParam(value = "to", required = false) String to,
             @RequestParam(value = "status", required = false) String status)
     {
-        System.out.println("user/id/calendar");
         return handle(getLanguage(lang), () -> {
             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
             LocalDate fromDate = LocalDate.parse(from, formatter);
@@ -182,7 +176,6 @@ public class ApiController {
     public ResponseEntity settings(
             @RequestParam(value = "lang", required = false) String lang)
     {
-        System.out.println("/settings");
         return handle(getLanguage(lang), () ->
                 manager.getDefaultSettings()
         );
@@ -195,7 +188,6 @@ public class ApiController {
             @RequestParam(value = "lang", required = false) String lang,
             @RequestBody DefaultSettings settings)
     {
-        System.out.println("POST /settings");
         return handle(getLanguage(lang), () ->
                 manager.createSettings(settings)
         );
@@ -206,7 +198,6 @@ public class ApiController {
             @RequestParam(value = "lang", required = false) String lang,
             @RequestBody VacationDay vacationDay)
     {
-        System.out.println("/user/calendar/create");
         return handle(getLanguage(lang), () ->
                 manager.createVacation(getUserId("me"), vacationDay)
         );
@@ -220,8 +211,6 @@ public class ApiController {
             @RequestParam(value = "lang", required = false) String lang,
             @RequestBody UserSettings settings)
     {
-        System.out.println("/user/settings");
-        System.out.println(settings.getNotification());
         return handle(getLanguage(lang), () ->
                 manager.changeSettings(getUserId(settings.getId()), settings)
         );
@@ -232,7 +221,6 @@ public class ApiController {
             @RequestParam(value = "lang", required = false) String lang,
             @RequestBody VacationDay vacationDay)
     {
-        System.out.println("/user/calendar/edit");
         return handle(getLanguage(lang), () ->
                 manager.changeVacation(getUserId("me"), vacationDay)
         );
@@ -244,7 +232,6 @@ public class ApiController {
             @RequestParam(value = "type", required = true) String type,
             @RequestBody BasicRequest request)
     {
-        System.out.println("/user/requests");
         return handle(getLanguage(lang), () ->
                 manager.changeRequest(getType(type), request)
         );
@@ -257,7 +244,6 @@ public class ApiController {
             @PathVariable("id") String id,
             @RequestParam(value = "lang", required = false) String lang)
     {
-        System.out.println("/calendar/{id}/delete");
         return handle(getLanguage(lang), () ->
             manager.deleteVacation(getUserId("me"), StringUtils.isNumeric(id) ? Long.parseLong(id) : -1)
         );
diff --git a/server/src/main/resources/Message_cs.properties b/server/src/main/resources/Message_cs.properties
index e79ad53..62ee4ee 100644
--- a/server/src/main/resources/Message_cs.properties
+++ b/server/src/main/resources/Message_cs.properties
@@ -1,2 +1,7 @@
 hello=Ahoj sv\u011Bte
-rest.exception.generic=N\u011Bco se stalo :(
\ No newline at end of file
+rest.exception.generic=N\u011Bco se stalo :(
+sick.day.count.error = Po\u010Det sick days nesm\u00ED b\u00FDt z\u00E1porn\u00FD!
+vacation.count.error = Po\u010Det p\u0159es\u010Das\u016F nesm\u00ED b\u00FDt z\u00E1porn\u00FD!
+name.length.error = D\u00E9lka jm\u00E9na nesm\u00ED p\u0159ekro\u010Dit 45 znak\u016F!
+email.length.error = D\u00E9lka emailu nesm\u00ED p\u0159ekro\u010Dit 100 znak\u016F!
+time.order.error = Dovolen\u00E1 nesm\u00ED za\u010D\u00EDnat pozd\u011Bji nebo ve stejn\u00FD \u010Das jako kon\u010D\u00ED!
\ No newline at end of file
diff --git a/server/src/main/resources/Message_en.properties b/server/src/main/resources/Message_en.properties
index a8434c6..ac85c5a 100644
--- a/server/src/main/resources/Message_en.properties
+++ b/server/src/main/resources/Message_en.properties
@@ -1,2 +1,7 @@
 hello=Hello world
-rest.exception.generic=Something happened :(
\ No newline at end of file
+rest.exception.generic=Something happened :(
+sick.day.count.error = The number of sick days must not be negative!
+vacation.count.error = The number of hours of an overtime must not be negative!
+name.length.error = The length of a name must not exceed 45!
+email.length.error = The length of an email address must not exceed 100!
+time.order.error = The overtime must not start after or at the same time it ends!
diff --git a/server/src/test/java/cz/zcu/yamanager/domain/DefaultSettingsTest.java b/server/src/test/java/cz/zcu/yamanager/domain/DefaultSettingsTest.java
new file mode 100644
index 0000000..d854516
--- /dev/null
+++ b/server/src/test/java/cz/zcu/yamanager/domain/DefaultSettingsTest.java
@@ -0,0 +1,72 @@
+package cz.zcu.yamanager.domain;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.time.LocalDateTime;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+/**
+ * This class tests methods of the {@code DefaultSettings} class.
+ * @see DefaultSettings
+ */
+class DefaultSettingsTest {
+
+    /**
+     * The empty instance of the {@code DefaultSettings}.
+     */
+    private DefaultSettings defaultSettings;
+
+    /**
+     * Prepares the instance of the {@code DefaultSettings}.
+     */
+    @BeforeEach
+    void setUp() {
+        this.defaultSettings = new DefaultSettings();
+    }
+
+    /**
+     * Tests the method {@code setSickDayCount} with common values where no problem should occur.
+     */
+    @Test
+    void testSetSickDaysCount() {
+        this.defaultSettings.setSickDayCount(10);
+        assertEquals(10, this.defaultSettings.getSickDayCount());
+    }
+
+    /**
+     * Tests the method {@code setSickDayCount} with zero which is a threshold value.
+     */
+    @Test
+    void testSetSickDaysCountZero() {
+        this.defaultSettings.setSickDayCount(0);
+        assertEquals(0, this.defaultSettings.getSickDayCount());
+    }
+
+    /**
+     * Tests the method {@code setSickDayCount} with negative one which is a threshold value.
+     */
+    @Test
+    void testSetSickDaysCountNegativeOne() {
+        assertThrows(IllegalArgumentException.class, () -> this.defaultSettings.setSickDayCount(-1));
+    }
+
+    /**
+     * Tests the method {@code setSickDayCount} with negative value.
+     */
+    @Test
+    void testSetSickDaysCountNegative() {
+        assertThrows(IllegalArgumentException.class, () -> this.defaultSettings.setSickDayCount(-10));
+    }
+
+    /**
+     * Tests the method {@code toString}.
+     */
+    @Test
+    void testToString() {
+        DefaultSettings defaultSettings = new DefaultSettings(5, 1, LocalDateTime.of(2008,10,30,20,0));
+        assertEquals("DefaultSettings{id=5, sickDaysCount=1, notification=2008-10-30T20:00}", defaultSettings.toString());
+    }
+}
diff --git a/server/src/test/java/cz/zcu/yamanager/domain/UserTest.java b/server/src/test/java/cz/zcu/yamanager/domain/UserTest.java
new file mode 100644
index 0000000..94fff9c
--- /dev/null
+++ b/server/src/test/java/cz/zcu/yamanager/domain/UserTest.java
@@ -0,0 +1,268 @@
+package cz.zcu.yamanager.domain;
+
+import cz.zcu.yamanager.dto.Status;
+import cz.zcu.yamanager.dto.UserRole;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.time.LocalDateTime;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+/**
+ * This class tests methods of the {@code User} class.
+ * @see User
+ */
+class UserTest {
+
+    /**
+     * The empty instance of the {@code User}.
+     */
+    private User user;
+
+    /**
+     * Prepares the instance of the {@code User}.
+     */
+    @BeforeEach
+    void setUp() {
+        this.user = new User();
+    }
+
+    /**
+     * Tests the method {@code setFirstName} with common values where no problem should occur.
+     */
+    @Test
+    void testSetFirstName() {
+        this.user.setFirstName("aaaaaa");
+        assertEquals("aaaaaa", this.user.getFirstName());
+    }
+
+    /**
+     * Tests the method {@code setFirstName} with the maximal length of a name.
+     */
+    @Test
+    void testSetFirstNameMax() {
+        this.user.setFirstName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+        assertEquals("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", this.user.getFirstName());
+    }
+
+    /**
+     * Tests the method {@code setFirstName} with name that exceeds maximal length which should throw an exception.
+     */
+    @Test
+    void testSetFirstNameException() {
+        assertThrows(IllegalArgumentException.class, () -> this.user.setFirstName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"));
+    }
+
+    /**
+     * Tests the method {@code setLastName} with common values where no problem should occur.
+     */
+    @Test
+    void testSetLastName() {
+        this.user.setLastName("aaaaaa");
+        assertEquals("aaaaaa", this.user.getLastName());
+    }
+
+    /**
+     * Tests the method {@code setLastName} with the maximal length of a name.
+     */
+    @Test
+    void testSetLastNameMax() {
+        this.user.setLastName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+        assertEquals("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", this.user.getLastName());
+    }
+
+    /**
+     * Tests the method {@code setLastName} with name that exceeds maximal length which should throw an exception.
+     */
+    @Test
+    void testSetLastNameException() {
+        assertThrows(IllegalArgumentException.class, () -> this.user.setLastName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"));
+    }
+
+    /**
+     * Tests the method {@code setVacationCount} with common values where no problem should occur.
+     */
+    @Test
+    void testSetVacationCount() {
+        this.user.setVacationCount(10);
+        assertEquals(10, this.user.getVacationCount());
+    }
+
+    /**
+     * Tests the method {@code setVacationCount} with zero which is a threshold value.
+     */
+    @Test
+    void testSetVacationCountZero() {
+        this.user.setVacationCount(0);
+        assertEquals(0, this.user.getVacationCount());
+    }
+
+    /**
+     * Tests the method {@code setVacationCount} with negative one which is a threshold value.
+     */
+    @Test
+    void testSetVacationCountNegativeOne() {
+        assertThrows(IllegalArgumentException.class, () -> this.user.setVacationCount(-1));
+    }
+
+    /**
+     * Tests the method {@code setVacationCount} with negative value.
+     */
+    @Test
+    void testSetVacationCountNegative() {
+        assertThrows(IllegalArgumentException.class, () -> this.user.setVacationCount(-10));
+    }
+
+    /**
+     * Tests the method {@code decreaseVacationCount} with common values where no problem should occur.
+     */
+    @Test
+    void testDecreaseVacationCount() {
+        this.user.setVacationCount(10);
+        this.user.decreaseVacationCount(4);
+        assertEquals(6, this.user.getVacationCount());
+    }
+
+    /**
+     * Tests the method {@code decreaseVacationCount} with result equals to zero.
+     */
+    @Test
+    void testDecreaseVacationCountZeroResult() {
+        this.user.setVacationCount(10);
+        this.user.decreaseVacationCount(10);
+        assertEquals(0, this.user.getVacationCount());
+    }
+
+    /**
+     * Tests the method {@code decreaseVacationCount} with result equals to -1.
+     */
+    @Test
+    void testDecreaseVacationCountNegativeOneResult() {
+        this.user.setVacationCount(10);
+        assertThrows(IllegalArgumentException.class, () -> this.user.decreaseVacationCount(11));
+    }
+
+    /**
+     * Tests the method {@code decreaseVacationCount} with result equals to negative number.
+     */
+    @Test
+    void testDecreaseVacationCountNegativeResult() {
+        this.user.setVacationCount(10);
+        assertThrows(IllegalArgumentException.class, () -> this.user.decreaseVacationCount(50));
+    }
+
+    /**
+     * Tests the method {@code decreaseVacationCount} with negative input.
+     */
+    @Test
+    void testDecreaseVacationCountNegativeInput() {
+        this.user.setVacationCount(10);
+        this.user.decreaseVacationCount(-10);
+        assertEquals(20, this.user.getVacationCount());
+    }
+
+    /**
+     * Tests the method {@code setTotalSickDayCount} with common values where no problem should occur.
+     */
+    @Test
+    void testSetTotalSickDayCount() {
+        this.user.setTotalSickDayCount(10);
+        assertEquals(10, this.user.getTotalSickDayCount());
+    }
+
+    /**
+     * Tests the method {@code setTotalSickDayCount} with zero which is a threshold value.
+     */
+    @Test
+    void testSetTotalSickDayCountZero() {
+        this.user.setTotalSickDayCount(0);
+        assertEquals(0, this.user.getTotalSickDayCount());
+    }
+
+    /**
+     * Tests the method {@code setTotalSickDayCount} with negative one which is a threshold value.
+     */
+    @Test
+    void testSetTotalSickDayCountNegativeOne() {
+        assertThrows(IllegalArgumentException.class, () -> this.user.setTotalSickDayCount(-1));
+    }
+
+    /**
+     * Tests the method {@code setTotalSickDayCount} with negative value.
+     */
+    @Test
+    void testSetTotalSickDayCountNegative() {
+        assertThrows(IllegalArgumentException.class, () -> this.user.setTotalSickDayCount(-10));
+    }
+
+    /**
+     * Tests the method {@code setTakenSickDayCount} with common values where no problem should occur.
+     */
+    @Test
+    void testSetTakenSickDayCount() {
+        this.user.setTakenSickDayCount(10);
+        assertEquals(10, this.user.getTakenSickDayCount());
+    }
+
+    /**
+     * Tests the method {@code setTakenSickDayCount} with zero which is a threshold value.
+     */
+    @Test
+    void testSetTakenSickDayCountZero() {
+        this.user.setTakenSickDayCount(0);
+        assertEquals(0, this.user.getTakenSickDayCount());
+    }
+
+    /**
+     * Tests the method {@code setTakenSickDayCount} with negative one which is a threshold value.
+     */
+    @Test
+    void testSetTakenSickDayCountNegativeOne() {
+        assertThrows(IllegalArgumentException.class, () -> this.user.setTakenSickDayCount(-1));
+    }
+
+    /**
+     * Tests the method {@code setTakenSickDayCount} with negative value.
+     */
+    @Test
+    void testSetTakenSickDayCountNegative() {
+        assertThrows(IllegalArgumentException.class, () -> this.user.setTakenSickDayCount(-10));
+    }
+
+    /**
+     * Tests the method {@code setEmail} with common values where no problem should occur.
+     */
+    @Test
+    void testSetEmail() {
+        this.user.setEmail("aaaaaa");
+        assertEquals("aaaaaa", this.user.getEmail());
+    }
+
+    /**
+     * Tests the method {@code setEmail} with the maximal length of an email address.
+     */
+    @Test
+    void testSetEmailMax() {
+        this.user.setEmail("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+        assertEquals("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", this.user.getEmail());
+    }
+
+    /**
+     * Tests the method {@code setEmail} with email address that exceeds maximal length which should throw an exception.
+     */
+    @Test
+    void testSetEmailException() {
+        assertThrows(IllegalArgumentException.class, () -> this.user.setEmail("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"));
+    }
+
+    /**
+     * Tests the method {@code toString}.
+     */
+    @Test
+    void testToString() {
+        User user = new User(5, "Jan", "Novák", 0, 10, 5, LocalDateTime.of(2008,10,30,20,0), "tokenContent", "novak@email.com", "url", LocalDateTime.of(2010,6,31,12,5), UserRole.EMPLOYER, Status.ACCEPTED);
+        assertEquals("User{id=5, firstName=Jan, lastName=Novák, vacationsCount=0, totalSickDaysCount=10, takenSickDaysCount=5, notification=2008-10-30T20:00, token=tokenContent, email=novak@email.com, photo=url, creationDate=2010-6-31T12:05 , role=EMPLOYER, status=ACCEPTED}", user.toString());
+    }
+}
diff --git a/server/src/test/java/cz/zcu/yamanager/domain/VacationDayTest.java b/server/src/test/java/cz/zcu/yamanager/domain/VacationDayTest.java
new file mode 100644
index 0000000..2048903
--- /dev/null
+++ b/server/src/test/java/cz/zcu/yamanager/domain/VacationDayTest.java
@@ -0,0 +1,204 @@
+package cz.zcu.yamanager.domain;
+
+import cz.zcu.yamanager.dto.Status;
+import cz.zcu.yamanager.dto.VacationType;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * This class tests methods of the {@code VacationDay} class.
+ * @see VacationDay
+ */
+class VacationDayTest {
+    /**
+     * The empty instance of the {@code VacationDay}.
+     */
+    private VacationDay vacationDay;
+
+    /**
+     * Prepares the instance of the {@code VacationDay}.
+     */
+    @BeforeEach
+    void setUp() {
+        this.vacationDay = new VacationDay();
+    }
+
+    /**
+     * Tests the method {@code setTime} with common values where no problem should occur.
+     */
+    @Test
+    void testSetTime() {
+        LocalTime from = LocalTime.of(10,0);
+        LocalTime to = LocalTime.of(20,0);
+        this.vacationDay.setTime(from, to);
+        assertEquals(from, this.vacationDay.getFrom());
+        assertEquals(to, this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTime} with the same times.
+     */
+    @Test
+    void testSetTimeSame() {
+        LocalTime from = LocalTime.of(10,0);
+        LocalTime to = LocalTime.of(10,0);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(from, to));
+    }
+
+    /**
+     * Tests the method {@code setTime} with later start.
+     */
+    @Test
+    void testSetTimeLater() {
+        LocalTime from = LocalTime.of(20,0);
+        LocalTime to = LocalTime.of(10,0);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTime(from, to));
+    }
+
+    /**
+     * Tests the method {@code setTime} with a sick day.
+     */
+    @Test
+    void testSetTimeSickDay() {
+        this.vacationDay.setType(VacationType.SICKDAY);
+        LocalTime from = LocalTime.of(10,0);
+        LocalTime to = LocalTime.of(20,0);
+        this.vacationDay.setTime(from, to);
+        assertNull(this.vacationDay.getFrom());
+        assertNull(this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with common values where no problem should occur.
+     */
+    @Test
+    void testSetFrom() {
+        LocalTime to = LocalTime.of(20, 0);
+        this.vacationDay.setTo(to);
+        LocalTime from = LocalTime.of(10,0);
+        this.vacationDay.setFrom(from);
+        assertEquals(from, this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} when ending time is null.
+     */
+    @Test
+    void testSetFromNull() {
+        LocalTime from = LocalTime.of(10,0);
+        this.vacationDay.setFrom(from);
+        assertEquals(from, this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setFrom} with the same times.
+     */
+    @Test
+    void testSetFromSame() {
+        LocalTime to = LocalTime.of(10, 0);
+        this.vacationDay.setTo(to);
+        LocalTime from = LocalTime.of(10,0);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setFrom(from));
+    }
+
+    /**
+     * Tests the method {@code setFrom} with later start.
+     */
+    @Test
+    void testSetFromLater() {
+        LocalTime to = LocalTime.of(10, 0);
+        this.vacationDay.setTo(to);
+        LocalTime from = LocalTime.of(20,0);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setFrom(from));
+    }
+
+    /**
+     * Tests the method {@code setFrom} with a sick day.
+     */
+    @Test
+    void testSetFromSickDay() {
+        this.vacationDay.setType(VacationType.SICKDAY);
+        LocalTime from = LocalTime.of(10,0);
+        this.vacationDay.setFrom(from);
+        assertNull(this.vacationDay.getFrom());
+    }
+
+    /**
+     * Tests the method {@code setTo} with common values where no problem should occur.
+     */
+    @Test
+    void testSetTo() {
+        LocalTime from = LocalTime.of(10,0);
+        this.vacationDay.setFrom(from);
+        LocalTime to = LocalTime.of(20, 0);
+        this.vacationDay.setTo(to);
+        assertEquals(to, this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} when starting time is null.
+     */
+    @Test
+    void testSetToNull() {
+        LocalTime to = LocalTime.of(10,0);
+        this.vacationDay.setTo(to);
+        assertEquals(to, this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code setTo} with the same times.
+     */
+    @Test
+    void testSetToSame() {
+        LocalTime from = LocalTime.of(10,0);
+        this.vacationDay.setFrom(from);
+        LocalTime to = LocalTime.of(10, 0);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTo(to));
+    }
+
+    /**
+     * Tests the method {@code setTo} with earlier end.
+     */
+    @Test
+    void testSetToEarlier() {
+        LocalTime from = LocalTime.of(20,0);
+        this.vacationDay.setFrom(from);
+        LocalTime to = LocalTime.of(10, 0);
+        assertThrows(IllegalArgumentException.class, () -> this.vacationDay.setTo(to));
+    }
+
+    /**
+     * Tests the method {@code setTo} with a sick day.
+     */
+    @Test
+    void testSetToSickDay() {
+        this.vacationDay.setType(VacationType.SICKDAY);
+        LocalTime to = LocalTime.of(10,0);
+        this.vacationDay.setTo(to);
+        assertNull(this.vacationDay.getTo());
+    }
+
+    /**
+     * Tests the method {@code toString} for a vacation.
+     */
+    @Test
+    void testToStringVacation() {
+        VacationDay vacationDay = new VacationDay(5, LocalDate.of(2010,1,9), LocalTime.of(12,15), LocalTime.of(22,30), LocalDateTime.of(2008,10,30,20,0), Status.ACCEPTED);
+        assertEquals("User{id=5, date=2010-1-9, from=12:15, to=22:30, notification=2008-10-30T20:00, status=ACCEPTED, type=VACATION}", vacationDay.toString());
+    }
+
+    /**
+     * Tests the method {@code toString} for a sick day.
+     */
+    @Test
+    void testToStringSickDay() {
+        VacationDay vacationDay = new VacationDay(5, LocalDate.of(2010,1,9), LocalDateTime.of(2008,10,30,20,0), Status.ACCEPTED);
+        assertEquals("User{id=5, date=2010-1-9, from=null, to=null, notification=2008-10-30T20:00, status=ACCEPTED, type=SICKDAY}", vacationDay.toString());
+    }
+}
