commit 64df3f496b45230e8730ffad626332adaf41543e
Author: D0miq <dpoch@email.com>
Date:   Sun May 5 20:37:19 2019 +0200

    Re #7390 Base domain classes

diff --git a/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java b/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java
new file mode 100644
index 0000000..88cd354
--- /dev/null
+++ b/server/src/main/java/cz/zcu/yamanager/domain/DefaultSettings.java
@@ -0,0 +1,114 @@
+package cz.zcu.yamanager.domain;
+
+import java.time.LocalDate;
+
+/**
+ * A domain class {@code DefaultSettings} represents a single record in the Default_settings table of a database.
+ * It contains default settings of the application.
+ */
+public class DefaultSettings {
+
+    /**
+     * ID of the default settings.
+     */
+    private final int id;
+
+    /**
+     * Default remaining vacation hours.
+     */
+    private int noVacations;
+
+    /**
+     * Default remaining sick days.
+     */
+    private int noSickDays;
+
+    /**
+     * Default date of an email warning about an incoming reset of the vacation hours and sick days.
+     */
+    private LocalDate alertDate;
+
+    /**
+     * 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.
+     */
+    public DefaultSettings(int id, int noVacations, int noSickDays, LocalDate alertDate) {
+        this.id = id;
+        this.noVacations = noVacations;
+        this.noSickDays = noSickDays;
+        this.alertDate = alertDate;
+    }
+
+    /**
+     * Gets an ID of the default settings.
+     * @return The ID of the default settings.
+     */
+    public int getId() {
+        return id;
+    }
+
+    /**
+     * Gets a default remaining vacation hours.
+     * @return The default remaining vacation hours.
+     */
+    public int getNoVacations() {
+        return noVacations;
+    }
+
+    /**
+     * Sets a new default remaining vacation hours.
+     * @param noVacations The new default remaining vacation hours.
+     */
+    public void setNoVacations(int noVacations) {
+        this.noVacations = noVacations;
+    }
+
+    /**
+     * Gets a default remaining sick days.
+     * @return The default remaining sick days.
+     */
+    public int getNoSickDays() {
+        return noSickDays;
+    }
+
+    /**
+     * Sets a new default remaining sick days.
+     * @param noSickDays The new default remaining sick days.
+     */
+    public void setNoSickDays(int noSickDays) {
+        this.noSickDays = noSickDays;
+    }
+
+    /**
+     * 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.
+     */
+    public LocalDate getAlertDate() {
+        return alertDate;
+    }
+
+    /**
+     * 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.
+     */
+    public void setAlertDate(LocalDate alertDate) {
+        this.alertDate = alertDate;
+    }
+
+    /**
+     * Gets a string representation of the class {@code DefaultSettings}.
+     * @return The string representation of the class.
+     */
+    @Override
+    public String toString() {
+        return "DefaultSettings{" +
+                "id=" + id +
+                ", noVacations=" + noVacations +
+                ", noSickDays=" + noSickDays +
+                ", alertDate=" + alertDate +
+                '}';
+    }
+}
diff --git a/server/src/main/java/cz/zcu/yamanager/domain/Right.java b/server/src/main/java/cz/zcu/yamanager/domain/Right.java
new file mode 100644
index 0000000..4d33ec0
--- /dev/null
+++ b/server/src/main/java/cz/zcu/yamanager/domain/Right.java
@@ -0,0 +1,89 @@
+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
new file mode 100644
index 0000000..004f6de
--- /dev/null
+++ b/server/src/main/java/cz/zcu/yamanager/domain/Role.java
@@ -0,0 +1,91 @@
+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
new file mode 100644
index 0000000..56b490f
--- /dev/null
+++ b/server/src/main/java/cz/zcu/yamanager/domain/SickDay.java
@@ -0,0 +1,90 @@
+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
new file mode 100644
index 0000000..af7fdd0
--- /dev/null
+++ b/server/src/main/java/cz/zcu/yamanager/domain/Status.java
@@ -0,0 +1,64 @@
+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/User.java b/server/src/main/java/cz/zcu/yamanager/domain/User.java
new file mode 100644
index 0000000..a59f18e
--- /dev/null
+++ b/server/src/main/java/cz/zcu/yamanager/domain/User.java
@@ -0,0 +1,284 @@
+package cz.zcu.yamanager.domain;
+
+import java.time.LocalDate;
+
+/**
+ * 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.
+ */
+public class User {
+
+    /**
+     * User's ID.
+     */
+    private final int id;
+
+    /**
+     * User's first name.
+     */
+    private String firstName;
+
+    /**
+     * User's last name.
+     */
+    private String lastName;
+
+    /**
+     * User's remaining vacation hours.
+     */
+    private int noVacations;
+
+    /**
+     * User's remaining sick days.
+     */
+    private int noSickDays;
+
+    /**
+     * Date of an email warning about an incoming reset of the vacation hours and sick days.
+     */
+    private LocalDate alertDate;
+
+    /**
+     * Token for the Google oAuth.
+     */
+    private String token;
+
+    /**
+     * User's email address.
+     */
+    private String email;
+
+    /**
+     * URL of a user's photo.
+     */
+    private String photo;
+
+    /**
+     * User's role.
+     */
+    private Role role;
+
+    /**
+     * User's approval 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) {
+        this.id = id;
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.noVacations = noVacations;
+        this.noSickDays = noSickDays;
+        this.alertDate = alertDate;
+        this.token = token;
+        this.email = email;
+        this.photo = photo;
+        this.role = role;
+        this.status = status;
+    }
+
+    /**
+     * Gets a user's ID.
+     * @return The user's ID.
+     */
+    public int getId() {
+        return id;
+    }
+
+    /**
+     * Gets a user's first name.
+     * @return The user's first name.
+     */
+    public String getFirstName() {
+        return firstName;
+    }
+
+    /**
+     * Sets a new first name.
+     * @param firstName The new first name.
+     */
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    /**
+     * Gets a user's last name.
+     * @return The user's last name.
+     */
+    public String getLastName() {
+        return lastName;
+    }
+
+    /**
+     * Sets a new last name.
+     * @param lastName The new last name.
+     */
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    /**
+     * Gets a user's remaining vacation hours.
+     * @return The user's remaining vacation hours.
+     */
+    public int getNoVacations() {
+        return noVacations;
+    }
+
+    /**
+     * 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.
+     */
+    public void setNoVacations(int noVacations) {
+        this.noVacations = noVacations < 0 ? 0 : noVacations;
+    }
+
+    /**
+     * Gets a user's remaining sick days.
+     * @return The user's remaining sick days.
+     */
+    public int getNoSickDays() {
+        return noSickDays;
+    }
+
+    /**
+     * 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.
+     */
+    public void setNoSickDays(int noSickDays) {
+        this.noSickDays = noSickDays < 0 ? 0 : noSickDays;
+    }
+
+    /**
+     * 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.
+     */
+    public LocalDate getAlertDate() {
+        return alertDate;
+    }
+
+    /**
+     * 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.
+     */
+    public void setAlertDate(LocalDate alertDate) {
+        this.alertDate = alertDate;
+    }
+
+    /**
+     * Gets a user's token for the Google oAuth.
+     * @return The user's token for the Google oAuth.
+     */
+    public String getToken() {
+        return token;
+    }
+
+    /**
+     * Sets a new token for the Google oAuth.
+     * @param token The new token for the Google oAuth.
+     */
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    /**
+     * Gets a user's email address.
+     * @return The user's email address.
+     */
+    public String getEmail() {
+        return email;
+    }
+
+    /**
+     * Sets a new email address.
+     * @param email The new email address.
+     */
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    /**
+     * Gets a URL of a user's photo.
+     * @return The URL of the user's photo.
+     */
+    public String getPhoto() {
+        return photo;
+    }
+
+    /**
+     * Sets a new URL of a user's photo.
+     * @param photo The new URL of a user's photo.
+     */
+    public void setPhoto(String photo) {
+        this.photo = photo;
+    }
+
+    /**
+     * Gets a user's role.
+     * @return The user's role.
+     */
+    public Role getRole() {
+        return role;
+    }
+
+    /**
+     * Sets a new role.
+     * @param role The new role.
+     */
+    public void setRole(Role role) {
+        this.role = role;
+    }
+
+    /**
+     * Gets a user's approval status.
+     * @return The user's approval status.
+     */
+    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 User}.
+     * @return The string representation of the class.
+     */
+    @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 +
+                '}';
+    }
+}
\ 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
new file mode 100644
index 0000000..0c9457e
--- /dev/null
+++ b/server/src/main/java/cz/zcu/yamanager/domain/VacationDay.java
@@ -0,0 +1,139 @@
+package cz.zcu.yamanager.domain;
+
+import java.time.LocalDate;
+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.
+ */
+public class VacationDay {
+
+    /**
+     * ID of the vacation day.
+     */
+    private final int id;
+
+    /**
+     * Date of the vacation day.
+     */
+    private LocalDate date;
+
+    /**
+     * Starting time of a vacation.
+     */
+    private LocalTime from;
+
+    /**
+     * Ending time of a vacation.
+     */
+    private LocalTime to;
+
+    /**
+     * Approval status of the vacation day.
+     */
+    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.
+     */
+    public VacationDay(int id, LocalDate date, LocalTime from, LocalTime to, Status status) {
+        this.id = id;
+        this.date = date;
+        this.from = from;
+        this.to = to;
+        this.status = status;
+    }
+
+    /**
+     * Gets an ID of the vacation day.
+     * @return The ID of the vacation day.
+     */
+    public int getId() {
+        return id;
+    }
+
+    /**
+     * Gets a date of the vacation day.
+     * @return The date of the vacation day.
+     */
+    public LocalDate getDate() {
+        return date;
+    }
+
+    /**
+     * Sets a new date.
+     * @param date The new date.
+     */
+    public void setDate(LocalDate date) {
+        this.date = date;
+    }
+
+    /**
+     * Gets a starting time of a vacation.
+     * @return The starting time of a vacation.
+     */
+    public LocalTime getFrom() {
+        return from;
+    }
+
+    /**
+     * Sets a new starting time.
+     * @param from The new starting time.
+     */
+    public void setFrom(LocalTime from) {
+        this.from = from;
+    }
+
+    /**
+     * Gets an ending time of a vacation.
+     * @return The ending time of a vacation.
+     */
+    public LocalTime getTo() {
+        return to;
+    }
+
+    /**
+     * Sets a new ending time.
+     * @param to The new ending time.
+     */
+    public void setTo(LocalTime to) {
+        this.to = to;
+    }
+
+    /**
+     * Gets an approval status of the vacation day.
+     * @return The approval status of the vacation 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 VacationDay}.
+     * @return The string representation of the class.
+     */
+    @Override
+    public String toString() {
+        return "VacationDay{" +
+                "id=" + id +
+                ", date=" + date +
+                ", from=" + from +
+                ", to=" + to +
+                ", status=" + status +
+                '}';
+    }
+}
