commit 4bcef7059edb257d27397121c014e526354ff38e
Author: Hung Hoang <hoanghun5@gmail.com>
Date:   Sat May 25 20:42:19 2019 +0200

    Re#7493 Finished services except xlsx service

diff --git a/webapp/src/app/employees/employees-list.component.ts b/webapp/src/app/employees/employees-list.component.ts
index 8c6b2fc..b984b8f 100644
--- a/webapp/src/app/employees/employees-list.component.ts
+++ b/webapp/src/app/employees/employees-list.component.ts
@@ -66,6 +66,10 @@ export class EmployeesListComponent implements OnInit {
     }
   }
 
+
+  /**
+   * Map from UserBasicInformation model to inner class model User
+   */
   private mapUsers(): void {
     let user: User;
     this._users = [];
@@ -80,6 +84,11 @@ export class EmployeesListComponent implements OnInit {
     }
   }
 
+  /**
+   * Creates array of days with information about the user's
+   * vacation and sick days in range 7 days before and 7 days after
+   * @param user one user row with
+   */
   private mapDays(user: UserBasicInformation): DayInfo[] {
     const dayInfo: DayInfo[] = [];
 
@@ -87,11 +96,9 @@ export class EmployeesListComponent implements OnInit {
       const day: DayInfo = new DayInfo();
       day.type = VacationType.NONE;
 
-      for (const vacationDay of user.calendar) {
-        const vacationDate: Date = new Date(vacationDay.date);
-
-        if (vacationDate.getDate() === date.getDate()) {
-          day.type = vacationDay.type;
+      for (const calendarDay of user.calendar) {
+        if (new Date(calendarDay.date).getDate() === date.getDate()) {
+          day.type = calendarDay.type;
         }
       }
 
@@ -105,21 +112,24 @@ export class EmployeesListComponent implements OnInit {
   ngOnInit() {
     this.usersService.getAuthorizedUsers()
       .subscribe((data: UserBasicInformation[]) => {
-        for (const entry of data) {
-          this._employeesBasicInformation.push(entry);
-        }
+        this._employeesBasicInformation = data;
         this.mapUsers();
-        console.log(this._users);
       });
 
+    // const calendar: PostCalendar = { date: '1999/10/10', from: '15:00', to: '17:00', type: VacationType.VACATION };
+    // this.userService.postCalendar(calendar)
+    //   .subscribe((data: any) => console.log(data));
 
-    let authorization: AuthorizationRequest[];
-    this.usersService.getAuthorizationRequests()
-      .subscribe((data: AuthorizationRequest[]) => {
-        authorization = { ...data};
+    // const settings: PostUserSettings = {
+    //   id: 1,
+    //   role: UserType.EMPLOYEE,
+    //   sickdayCount: 1,
+    //   vacationCount: 1,
+    // };
+    //
+    // this.userService.putUserSettings(settings)
+    //   .subscribe((data: any) => console.log(data));
 
-        console.log(authorization);
-      });
   }
 
 }
diff --git a/webapp/src/app/models/calendar.model.ts b/webapp/src/app/models/calendar.model.ts
index 2d714c7..7886df1 100644
--- a/webapp/src/app/models/calendar.model.ts
+++ b/webapp/src/app/models/calendar.model.ts
@@ -2,9 +2,25 @@ import {Time} from '@angular/common';
 import {RequestStatus, VacationType} from '../enums/common.enum';
 
 export interface Calendar {
-  date: Date;
+  id: number;
+  date: string;
   from: Time;
   to: Time;
   type: VacationType;
   status: RequestStatus;
 }
+
+
+export interface PostCalendar {
+  date: string;
+  from: string;
+  to: string;
+  type: VacationType;
+}
+
+export interface CalendarEdit {
+  id: number;
+  date: string;
+  from: string;
+  to: string;
+}
diff --git a/webapp/src/app/models/post-requests.model.ts b/webapp/src/app/models/post-requests.model.ts
index 12da3c3..60301c9 100644
--- a/webapp/src/app/models/post-requests.model.ts
+++ b/webapp/src/app/models/post-requests.model.ts
@@ -1,18 +1,6 @@
 import {RequestStatus, TimeUnit, UserType} from '../enums/common.enum';
 
-export interface PostRequest {
+export interface UserRequest {
   id: number;
   status: RequestStatus;
 }
-
-export interface PostSettings {
-  role: UserType;
-  vacation: {
-    value: number;
-    unit: TimeUnit;
-  };
-  sickday: {
-    value: number;
-    unit: TimeUnit;
-  };
-}
diff --git a/webapp/src/app/models/settings.model.ts b/webapp/src/app/models/settings.model.ts
index 5fdef1f..6c68a6b 100644
--- a/webapp/src/app/models/settings.model.ts
+++ b/webapp/src/app/models/settings.model.ts
@@ -1,7 +1,14 @@
+import {UserType} from '../enums/common.enum';
+
 export interface Settings {
-  sickDay: {
-    value: number;
-    unit: string;
-  };
-  notification: Date;
+  sickdayCount: number;
+  notification: string;
 }
+
+export interface PostUserSettings {
+  id: number;
+  vacationCount: number;
+  sickdayCount: number;
+  role: UserType;
+}
+
diff --git a/webapp/src/app/models/user-profile.model.ts b/webapp/src/app/models/user-profile.model.ts
index c73485d..0bd7b48 100644
--- a/webapp/src/app/models/user-profile.model.ts
+++ b/webapp/src/app/models/user-profile.model.ts
@@ -1,22 +1,14 @@
-import {TimeUnit} from '../enums/common.enum';
+import {RequestStatus, UserType} from '../enums/common.enum';
 
 export interface UserProfile {
   id: number;
-  name: {
-    first: string;
-    last: string;
-  };
+  firstName: string;
+  lastName: string;
   photo: string;
-  settings: {
-    notification: Date;
-  };
-  vacation: {
-    value: number;
-    unit: TimeUnit;
-  };
-  sickDay: {
-    value: number;
-    unit: TimeUnit;
-  };
+  vacationCount: number;
+  sickdayCount: number;
+  status: RequestStatus;
+  role: UserType;
+  notification: Date;
 }
 
diff --git a/webapp/src/app/services/basic.service.ts b/webapp/src/app/services/basic.service.ts
index fe1d41f..bcc1171 100644
--- a/webapp/src/app/services/basic.service.ts
+++ b/webapp/src/app/services/basic.service.ts
@@ -1,5 +1,5 @@
-import { Injectable } from '@angular/core';
-import {HttpClient, HttpErrorResponse, HttpHeaders} from '@angular/common/http';
+import {Injectable} from '@angular/core';
+import {HttpClient, HttpErrorResponse, HttpParams} from '@angular/common/http';
 import {throwError} from 'rxjs';
 import {environment} from '../../environments/environment';
 
@@ -9,6 +9,8 @@ import {environment} from '../../environments/environment';
 export class BasicService {
   protected baseUrl = environment.apiUrl;
 
+  constructor(protected http: HttpClient) { }
+
   protected handleError(error: HttpErrorResponse) {
     if (error.error instanceof ErrorEvent) {
       console.error('An error occurred:', error.error.message);
@@ -21,5 +23,16 @@ export class BasicService {
       'Something bad happened; please try again later.');
   }
 
-  constructor(protected http: HttpClient) { }
+  protected createParams(params: any) {
+    let httpParams = new HttpParams();
+    for (const key in params) {
+      if (params.hasOwnProperty(key)) {
+        if (params[key] != null) {
+          httpParams = httpParams.set(key, params[key]);
+        }
+      }
+    }
+
+    return httpParams;
+  }
 }
diff --git a/webapp/src/app/services/settings.service.spec.ts b/webapp/src/app/services/settings.service.spec.ts
new file mode 100644
index 0000000..97bb4ba
--- /dev/null
+++ b/webapp/src/app/services/settings.service.spec.ts
@@ -0,0 +1,85 @@
+import {TestBed} from '@angular/core/testing';
+
+import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
+import {environment} from '../../environments/environment';
+import {SettingsService} from './settings.service';
+import {Languages} from '../enums/common.enum';
+
+describe('SettingsService', () => {
+  let service: SettingsService;
+  let httpMock: HttpTestingController;
+  const baseUrl: string = environment.apiUrl;
+
+  beforeEach(() => {
+    TestBed.configureTestingModule({
+      imports: [HttpClientTestingModule],
+      providers: [SettingsService]
+    });
+
+    service = TestBed.get(SettingsService);
+    httpMock = TestBed.get(HttpTestingController);
+  });
+  afterEach(() => httpMock.verify());
+
+  it('getDefaultSettings', () => {
+    const dummyData = {
+      sickdayCount: 3,
+      notification: '2019/05/25 14:41:31'
+    };
+
+    service.getDefaultSettings().subscribe((data: any) => {
+      expect(data.sickdayCount).toBeDefined();
+      expect(data.sickdayCount).toBe(3);
+      expect(data.notification).toBeDefined();
+    });
+
+    const req = httpMock.expectOne(baseUrl + '/api/settings');
+    expect(req.request.method).toBe('GET');
+    req.flush(dummyData);
+  });
+
+  it('getDefaultSettingsWithLanguage', () => {
+    const dummyData = {
+      sickdayCount: 3,
+      notification: '2019/05/25 14:41:31'
+    };
+
+    service.getDefaultSettingsWithLanguage(Languages.ENGLISH).subscribe((data: any) => {
+      expect(data.sickdayCount).toBeDefined();
+      expect(data.sickdayCount).toBe(3);
+      expect(data.notification).toBeDefined();
+    });
+
+    const req = httpMock.expectOne(baseUrl + '/api/settings?lang=EN');
+    expect(req.request.method).toBe('GET');
+    req.flush(dummyData);
+  });
+
+
+  it('postDefaultSettings', () => {
+    const dummyAnswer = {
+      answer: 'ok',
+    };
+
+    service.postDefaultSettings({sickdayCount: 3, notification: '2019/04/25 18:23:36'})
+      .subscribe((data: any) => expect(data.answer).toBe('ok'));
+
+    const req = httpMock.expectOne(baseUrl + '/api/settings');
+    expect(req.request.method).toBe('POST');
+    req.flush(dummyAnswer);
+  });
+
+  it('postDefaultSettingsWithLanguage', () => {
+    const dummyAnswer = {
+      answer: 'ok',
+    };
+
+    service.postDefaultSettingsWithLanguage({sickdayCount: 3, notification: '2019/04/25 18:23:36'}, Languages.ENGLISH)
+      .subscribe((data: any) => expect(data.answer).toBe('ok'));
+
+    const req = httpMock.expectOne(baseUrl + '/api/settings?lang=EN');
+    expect(req.request.method).toBe('POST');
+    req.flush(dummyAnswer);
+  });
+
+});
diff --git a/webapp/src/app/services/settings.service.ts b/webapp/src/app/services/settings.service.ts
index 85a865e..0987c8b 100644
--- a/webapp/src/app/services/settings.service.ts
+++ b/webapp/src/app/services/settings.service.ts
@@ -1,39 +1,68 @@
 import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
+import {HttpClient, HttpParams} from '@angular/common/http';
 import { catchError } from 'rxjs/operators';
 
 import { BasicService } from './basic.service';
 import { Settings } from '../models/settings.model';
+import {Languages} from '../enums/common.enum';
 
 @Injectable({
   providedIn: 'root'
 })
 export class SettingsService extends BasicService {
-  defaultSettingsUrl = this.baseUrl + '/settings/default';
+  defaultSettingsUrl = this.baseUrl + '/api/settings';
 
+  constructor(protected http: HttpClient) {
+    super(http);
+  }
+
+  /**
+   * Returns default application settings
+   * with sickday count and notification
+   */
   getDefaultSettings() {
-    return this.http.get<Settings>(this.defaultSettingsUrl)
+    return this.makeGetSettingsApiCall(null);
+  }
+
+  /**
+   * Returns default application settings
+   * with sickday count and notification
+   * @param language filter by language
+   */
+  getDefaultSettingsWithLanguage(language: Languages) {
+    return this.makeGetSettingsApiCall(language);
+  }
+
+  /**
+   * Získání aktuálně použitého výchozího nastavení v aplikaci
+   * GET /setttings?[lang=<CZ,EN>]
+   * @param language filter with language
+   */
+  private makeGetSettingsApiCall(language: string) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+    const options = {params: httpParams};
+
+    return this.http.get<Settings>(this.defaultSettingsUrl, options)
       .pipe(
         catchError(err => this.handleError(err))
       );
   }
 
-  postDefaultSettingsWithResponse(settings: Settings) {
-    return this.postDefaultSettingsWithOptions(settings, {observe: 'response'});
+  postDefaultSettings(settings: Settings) {
+    return this.postDefaultSettingsWithOptions(settings, null);
   }
 
-  postDefaultSettings(settings: Settings) {
-    return this.postDefaultSettingsWithOptions(settings, {});
+  postDefaultSettingsWithLanguage(settings: Settings, language: Languages) {
+    return this.postDefaultSettingsWithOptions(settings, language);
   }
 
-  private postDefaultSettingsWithOptions(settings: Settings, options: any) {
+  private postDefaultSettingsWithOptions(settings: Settings, language: Languages) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+    const options = {params: httpParams};
+
     return this.http.post<Settings>(this.defaultSettingsUrl, settings, options)
       .pipe(
         catchError(err => this.handleError(err))
       );
   }
-
-  constructor(protected http: HttpClient) {
-    super(http);
-  }
 }
diff --git a/webapp/src/app/services/user.service.spec.ts b/webapp/src/app/services/user.service.spec.ts
new file mode 100644
index 0000000..a2de1cd
--- /dev/null
+++ b/webapp/src/app/services/user.service.spec.ts
@@ -0,0 +1,127 @@
+import {TestBed} from '@angular/core/testing';
+
+import {UserService} from './user.service';
+import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
+import {Languages, RequestStatus, UserType, VacationType} from '../enums/common.enum';
+import {environment} from '../../environments/environment';
+
+describe('UsersService', () => {
+  let service: UserService;
+  let httpMock: HttpTestingController;
+  const baseUrl: string = environment.apiUrl;
+
+  beforeEach(() => {
+    TestBed.configureTestingModule({
+      imports: [HttpClientTestingModule],
+      providers: [UserService]
+    });
+
+    service = TestBed.get(UserService);
+    httpMock = TestBed.get(HttpTestingController);
+  });
+  afterEach(() => httpMock.verify());
+
+  it('getLoggedUser', () => {
+    const dummyData = {
+      id: 1,
+      firstName: 'Tomas',
+      lastName: 'Novak',
+      photo: 'https://st2.depositphotos.com/9223672/12056/v/950/depositphotos_120568236-stock-illustration-male-face-avatar-logo-template.jpg',
+      vacationCount: 8.5,
+      sickdayCount: 3,
+      status: 'ACCEPTED',
+      role: 'EMPLOYER',
+      notification: '2000/12/01 09:00:00'
+    };
+
+
+    service.getLoggedUserProfile().subscribe((data: any) => {
+      expect(data.id).toBe(1);
+      expect(data.vacationCount).toBe(8.5);
+      expect(data.sickdayCount).toBe(3);
+      expect(data.status).toBe(RequestStatus.ACCEPTED);
+      expect(data.role).toBe(UserType.EMPLOYER);
+      expect(data.notification).toBeDefined();
+    });
+
+    const req = httpMock.expectOne(baseUrl + '/api/user/me/profile');
+    expect(req.request.method).toBe('GET');
+    req.flush(dummyData);
+  });
+
+  it('getLoggedUserWithLanguage', () => {
+    const dummyData = {
+      id: 1,
+      firstName: 'Tomas',
+      lastName: 'Novak',
+      photo: 'https://st2.depositphotos.com/9223672/12056/v/950/depositphotos_120568236-stock-illustration-male-face-avatar-logo-template.jpg',
+      vacationCount: 8.5,
+      sickdayCount: 3,
+      status: 'ACCEPTED',
+      role: 'EMPLOYER',
+      notification: '2000/12/01 09:00:00'
+    };
+
+
+    service.getLoggedUserProfileWithLanguage(Languages.ENGLISH).subscribe((data: any) => {
+      expect(data.id).toBe(1);
+      expect(data.vacationCount).toBe(8.5);
+      expect(data.sickdayCount).toBe(3);
+      expect(data.status).toBe(RequestStatus.ACCEPTED);
+      expect(data.role).toBe(UserType.EMPLOYER);
+      expect(data.notification).toBeDefined();
+    });
+
+    const req = httpMock.expectOne(baseUrl + '/api/user/me/profile?lang=EN');
+    expect(req.request.method).toBe('GET');
+    req.flush(dummyData);
+  });
+
+  it('getLoggedUserCalendar', () => {
+    const dummyData = [
+      {id: 1, date: '2000/10/10', from: '09:00', to: '13:00', type: 'VACATION'},
+      {id: 2, date: '2000/10/11', type: 'SICKDAY'},
+      {id: 3, date: '2000/10/12', from: '09:00', to: '13:00', type: 'VACATION'},
+      {id: 4, date: '2000/10/13', type: 'SICKDAY'},
+      {id: 5, date: '2000/10/14', from: '09:00', to: '13:00', type: 'VACATION'}
+    ];
+
+    service.getLoggedUserCalendar(new Date(1995, 10, 25))
+      .subscribe((data: any) => {
+        expect(data.length).toBe(5);
+        expect(data[1].type).toBe(VacationType.SICKDAY);
+        expect(data[2].type).toBe(VacationType.VACATION);
+        expect(data[2].from).toBeDefined();
+        expect(data[2].to).toBeDefined();
+      });
+
+    const req = httpMock.expectOne(baseUrl + '/api/user/me/calendar?from=1995/10/25');
+    expect(req.request.method).toBe('GET');
+    req.flush(dummyData);
+  });
+
+  it('getLoggedUserCalendarWithOptions', () => {
+    const dummyData = [
+      {id: 1, date: '2000/10/10', from: '09:00', to: '13:00', type: 'VACATION', status: 'ACCEPTED'},
+      {id: 2, date: '2000/10/11', type: 'SICKDAY', status: 'ACCEPTED'},
+      {id: 3, date: '2000/10/12', from: '09:00', to: '13:00', type: 'VACATION', status: 'ACCEPTED'},
+      {id: 4, date: '2000/10/13', type: 'SICKDAY', status: 'ACCEPTED'},
+      {id: 5, date: '2000/10/14', from: '09:00', to: '13:00', type: 'VACATION', status: 'ACCEPTED'}
+    ];
+
+    service.getLoggedUserCalendarWithOptions(new Date(1995, 10, 25), null, null, RequestStatus.ACCEPTED)
+      .subscribe((data: any) => {
+        expect(data.length).toBe(5);
+        expect(data[0].status).toBeDefined();
+        expect(data[0].status).toBe(RequestStatus.ACCEPTED);
+        expect(data[1].status).toBe(RequestStatus.ACCEPTED);
+        expect(data[2].status).toBe(RequestStatus.ACCEPTED);
+        expect(data[3].status).toBe(RequestStatus.ACCEPTED);
+        expect(data[4].status).toBe(RequestStatus.ACCEPTED);
+      });
+
+    const req = httpMock.expectOne(baseUrl + '/api/user/me/calendar?from=1995/10/25&status=ACCEPTED');
+    expect(req.request.method).toBe('GET');
+    req.flush(dummyData);
+  });
+});
diff --git a/webapp/src/app/services/user.service.ts b/webapp/src/app/services/user.service.ts
index 87cbb4f..2a137f1 100644
--- a/webapp/src/app/services/user.service.ts
+++ b/webapp/src/app/services/user.service.ts
@@ -1,94 +1,273 @@
-import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
+import {Injectable} from '@angular/core';
+import {HttpClient, HttpParams} from '@angular/common/http';
 
-import { UserProfile } from '../models/user-profile.model';
-import { Calendar } from '../models/calendar.model';
-import { BasicService } from './basic.service';
-import { catchError } from 'rxjs/operators';
-import {RequestTypes, TimeUnit} from '../enums/common.enum';
-import {PostRequest, PostSettings} from '../models/post-requests.model';
+import {UserProfile} from '../models/user-profile.model';
+import {Calendar, CalendarEdit, PostCalendar} from '../models/calendar.model';
+import {BasicService} from './basic.service';
+import {catchError} from 'rxjs/operators';
+import {Languages, RequestStatus} from '../enums/common.enum';
+import {UserRequest} from '../models/post-requests.model';
+import {PostUserSettings} from '../models/settings.model';
 
 @Injectable({
   providedIn: 'root'
 })
 export class UserService extends BasicService { // dost podobny k usersService, mozna zmenit v rest api
-  private _calendarUrl = this.baseUrl + '/user/calendar';
-  private _postRequestUrl = this.baseUrl + '/user/requests?type=';
-  private _userUrl = this.baseUrl + '/user/';
+  private _userUrl = this.baseUrl + '/api/user/';
 
-  getEmployeeProfile(id: number) { // najit jinej zpusob formatovani stringu, prasarna
-    return this.http.get<UserProfile>(this._userUrl + id + '/profile');
+  constructor(protected http: HttpClient) {
+    super(http);
   }
 
-  getMonthlyCalendar(value: number) {
-    return this.getCalendar(TimeUnit.MONTHLY, value);
+  /**
+   * Returns employee profile if the user making this call
+   * is logged as admin
+   * UserProfile.notification might be returned as string instead of date
+   * @param id employee id
+   */
+  getEmployeeProfile(id: number) {
+    return this.makeGetProfileApiCall(id.toString(), '');
   }
 
-  getWeeklyCalendar(value: number) {
-    return this.getCalendar(TimeUnit.WEEKLY, value);
+  /**
+   * Overloaded version of getEmployeeProfile to filter profiles
+   * by language
+   * UserProfile.notification might be returned as string instead of date
+   * @param id employee profile id
+   * @param language language to filtery by
+   */
+  getEmployeeProfileWithLanguage(id: number, language: Languages) {
+    return this.makeGetProfileApiCall(id.toString(), language);
   }
 
-  private getCalendar(viewType: string, value: number) {
-    return this.http.get<Calendar[]>(this._calendarUrl + '?viewType=' + viewType + '&value=' + value)
-      .pipe(
-        catchError(err => this.handleError(err))
-      );
+  /**
+   * Returns profile of currently logged user
+   * UserProfile.notification might be returned as string instead of date
+   */
+  getLoggedUserProfile() {
+    return this.makeGetProfileApiCall('me', null);
   }
 
-  postCalendar(calendar: Calendar[]) {
-    return this.postCalendarWithOptions(calendar, {});
+  /**
+   * Returns profile of currently logged user filtered by language
+   * UserProfile.notification might be returned as string instead of date
+   * @param language filter profile by language
+   */
+  getLoggedUserProfileWithLanguage(language: Languages) {
+    return this.makeGetProfileApiCall('me', language);
   }
 
-  postCalendarWithResponse(calendar: Calendar[]) {
-    return this.postCalendarWithOptions(calendar, {observe: 'response'});
+  /**
+   * Returns vacation and sick days from the given date
+   * for logged user
+   * @param from returns days from this date forward
+   */
+  getLoggedUserCalendar(from: Date) {
+    return this.makeGetCalendarApiCall('me', from, null, null, null);
   }
 
-  private postCalendarWithOptions(calendar: Calendar[], options: any) {
-    return this.http.post<Calendar[]>(this._calendarUrl, calendar, options)
-      .pipe(
-        catchError(err => this.handleError(err))
-      );
+  /**
+   * Returns vacation and sick days from the given date
+   * for logged user
+   * @param from returns days from this date forward
+   * @param to limit returned days, returns <from, to>
+   * @param language filter by language
+   * @param status filter by status
+   */
+  getLoggedUserCalendarWithOptions(from: Date, to: Date, language: Languages, status: RequestStatus) {
+    return this.makeGetCalendarApiCall('me', from, to, language, status);
+  }
+
+  /**
+   * Post user calendar using POST
+   * @param calendar to be posted
+   */
+  postCalendar(calendar: PostCalendar) {
+    return this.makePostCalendarApiCall(calendar, null);
+  }
+
+  /**
+   * Post user calendar using POST with specified language
+   * @param calendar to be posted
+   * @param language specified language
+   */
+  postCalendarWithLanguage(calendar: PostCalendar, language: Languages) {
+    return this.makePostCalendarApiCall(calendar, language);
   }
 
-  postVacationRequest(request: PostRequest) {
-    return this.postRequestWithTypeAndOptions(request, RequestTypes.VACATION, {});
+  /**
+   * Put user settings with given id for the user
+   * @param settings settings to be put
+   */
+  putUserSettings(settings: PostUserSettings) {
+    return this.makePutUserSettingsApiCall(settings, null);
   }
 
-  postVacationRequestWithResponse(request: PostRequest) {
-    return this.postRequestWithTypeAndOptions(request, RequestTypes.VACATION, {observe: 'response'});
+  /**
+   * Put user settings with given id for the user
+   * @param settings settings to be put
+   * @param language specified language
+   */
+  putUserSettingsWithLanguage(settings: PostUserSettings, language: Languages) {
+    return this.makePutUserSettingsApiCall(settings, language);
   }
 
-  postAuthorizationRequest(request: PostRequest) {
-    return this.postRequestWithTypeAndOptions(request, RequestTypes.AUTHORIZATION, {});
+  /**
+   * Accept or deny user request
+   * @param request request to accept or deny
+   */
+  putUserRequest(request: UserRequest) {
+    return this.makePutUserRequestApiCall(request, null);
+  }
+
+  /**
+   * Accept or deny user request
+   * @param request request to accept or deny
+   * @param language specify language
+   */
+  putUserRequestWithLanguage(request: UserRequest, language: Languages) {
+    return this.makePutUserRequestApiCall(request, language);
+  }
+
+  /**
+   * Edit calendar
+   * @param calendarEdit calendar day to be edited
+   * @param language specify language
+   */
+  putCalendarEdit(calendarEdit: CalendarEdit, language: Languages) {
+    return this.makePutCalendarEditApiCall(calendarEdit, null);
+  }
+
+  /**
+   * Delete calendar vacation day with given id
+   * @param id calendar day id to be deleted
+   * @param language specify language
+   */
+  deleteCalendar(id: number, language: Languages) {
+    return this.makeDeleteCalendarApiCall(id, language);
+  }
+
+  /**
+   * Získání profilu aktuálně přihlášeného uživatele nebo uživatele podle zadaného id.
+   * GET /user/<{id} || me>/profile?[lang=<CZ,EN>]
+   * @param id id of profile to get (number or 'me')
+   * @param language filter by language
+   */
+  private makeGetProfileApiCall(id: string, language: string) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+
+    const options = {params: httpParams};
+
+    return this.http.get<UserProfile>(this._userUrl + id + '/profile', options)
+      .pipe(
+        catchError(err => this.handleError(err))
+      );
   }
 
-  postAuthorizationRequestWithResponse(request: PostRequest) {
-    return this.postRequestWithTypeAndOptions(request, RequestTypes.AUTHORIZATION, {observe: 'response'});
+  /**
+   * Získání dovolené a sick days v zadaném období. Pokud není zadán parameter “to” vrátí všechny dovolené a sick days od “from”. Navíc umožňuje filtrovat pomocí statusu schválení.
+   * GET /user/<{id} || me>/calendar?[lang=<CZ,EN>]&from=yyyy/mm/dd, [to=yyyy/mm/dd], [status=<ACCEPTED, PENDING, REJECTED>]
+   * @param id id of calendar to get (number or 'me')
+   * @param from mandatory param
+   * @param to upper limit of days
+   * @param language filter by language
+   * @param status filter by status
+   */
+  private makeGetCalendarApiCall(id: string, from: Date, to: Date, language: Languages, status: RequestStatus) {
+    const fromString: string = from.getFullYear() + '/' + from.getMonth() + '/' + from.getDate();
+    let toString: string;
+    if (to != null) {
+      toString = to.getFullYear() + '/' + to.getMonth() + '/' + to.getDate();
+    }
+
+    const httpParams: HttpParams = this.createParams({lang: language, from: fromString, to: toString, status});
+    const options = {params: httpParams};
+
+    return this.http.get<Calendar[]>(this._userUrl + id + '/calendar', options)
+      .pipe(
+        catchError(err => this.handleError(err))
+      );
   }
 
-  private postRequestWithTypeAndOptions(request: PostRequest, type: string, options: any) {
-    return this.http.post<PostRequest>(this._postRequestUrl + type, request, options)
+  /**
+   * Povolení nebo zamítnutí žádosti nebo “smazání“ uživatele (změna statusu na REJECTED)
+   * PUT /user/requests?[lang=<CZ,EN>]&type=<VACATION, AUTHORIZATION>
+   * @param request request to accept or reject
+   * @param language specify language
+   */
+  private makePutUserRequestApiCall(request: UserRequest, language: Languages) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+    const options = {params: httpParams};
+
+    return this.http.put<UserRequest>(this._userUrl + 'request', request, options)
       .pipe(
         catchError(err => this.handleError(err))
       );
   }
 
-  postUserSettings(id: number, settings: PostSettings) {
-    return this.postUserSettingsWithOptions(id, settings, {});
+
+  /**
+   * Změna nastavení uživatele podle id
+   * PUT /user/settings?[lang=<CZ,EN>]
+   * @param settings setting to be set for given user
+   * @param language specified language
+   */
+  private makePutUserSettingsApiCall(settings: PostUserSettings, language: Languages) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+    const options = {params: httpParams};
+
+    return this.http.put<PostUserSettings>(this._userUrl + 'settings', settings, options)
+      .pipe(
+        catchError(err => this.handleError(err))
+      );
   }
 
-  postUserSettingsWithResponse(id: number, settings: PostSettings) {
-    return this.postUserSettingsWithOptions(id, settings, {observe: 'response'});
+  /**
+   * Vytvoření nové dovolené nebo sick day
+   * POST /user/calendar/create?[lang=<CZ,EN>]
+   * @param calendar calendar to be posted
+   * @param language specified language
+   */
+  private makePostCalendarApiCall(calendar: PostCalendar, language: Languages) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+    const options = {params: httpParams};
+
+    return this.http.post<PostCalendar>(this._userUrl + 'calendar/create', calendar, options)
+      .pipe(
+        catchError(err => this.handleError(err))
+      );
+
   }
 
-  private postUserSettingsWithOptions(id: number, settings: PostSettings, options: any) {
-    return this.http.post<PostSettings>(this._userUrl + id + '/settings', settings, options)
+  /**
+   * Smazání dovolené nebo sickday podle jejího id
+   * DELETE /calendar/delete?[lang=<CZ,EN>]
+   * @param id id of calendar to delete
+   * @param language specify language
+   */
+  private makeDeleteCalendarApiCall(id: number, language: Languages) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+    const options = {params: httpParams};
+
+    return this.http.delete(this._userUrl + 'calendar/delete/' + id, options)
       .pipe(
         catchError(err => this.handleError(err))
       );
   }
 
-  constructor(protected http: HttpClient) {
-    super(http);
+  /**
+   * Editace dovolené nebo sickday podle jejího id
+   * PUT /calendar/edit?[lang=<CZ,EN>]
+   * @param calendarEdit calendar to edit
+   * @param language specify language
+   */
+  private makePutCalendarEditApiCall(calendarEdit: CalendarEdit, language: Languages) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+    const options = {params: httpParams};
+
+    return this.http.put<CalendarEdit>(this._userUrl + 'calendar/edit', calendarEdit, options)
+      .pipe(
+        catchError(err => this.handleError(err))
+      );
   }
 }
diff --git a/webapp/src/app/services/users.service.spec.ts b/webapp/src/app/services/users.service.spec.ts
index 7529cc8..fa7ba97 100644
--- a/webapp/src/app/services/users.service.spec.ts
+++ b/webapp/src/app/services/users.service.spec.ts
@@ -2,7 +2,6 @@ import {TestBed} from '@angular/core/testing';
 
 import {UsersService} from './users.service';
 import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
-import {VacationRequest} from '../models/requests.model';
 import {RequestStatus, VacationType} from '../enums/common.enum';
 import {environment} from '../../environments/environment';
 
@@ -40,7 +39,7 @@ describe('UsersService', () => {
       expect(data[4].timestamp).toBeDefined();
     });
 
-    const req = httpMock.expectOne(baseUrl + '/api/users/requests/authorization?');
+    const req = httpMock.expectOne(baseUrl + '/api/users/requests/authorization');
     expect(req.request.method).toBe('GET');
     req.flush(dummyRequests);
   });
@@ -68,7 +67,7 @@ describe('UsersService', () => {
       expect(data[1].from).toBeDefined();
     });
 
-    const req = httpMock.expectOne(baseUrl + '/api/users/requests/vacation?');
+    const req = httpMock.expectOne(baseUrl + '/api/users/requests/vacation');
     expect(req.request.method).toBe('GET');
     req.flush(dummyRequests);
   });
@@ -209,7 +208,7 @@ describe('UsersService', () => {
       expect(data[0].calendar[1].id).toBe(2);
     });
 
-    const req = httpMock.expectOne(baseUrl + '/api/users?');
+    const req = httpMock.expectOne(baseUrl + '/api/users');
     expect(req.request.method).toBe('GET');
     req.flush(dummyRequests);
   });
diff --git a/webapp/src/app/services/users.service.ts b/webapp/src/app/services/users.service.ts
index fafea9e..5d960a9 100644
--- a/webapp/src/app/services/users.service.ts
+++ b/webapp/src/app/services/users.service.ts
@@ -1,5 +1,5 @@
 import {Injectable} from '@angular/core';
-import {HttpClient} from '@angular/common/http';
+import {HttpClient, HttpParams} from '@angular/common/http';
 import {BasicService} from './basic.service';
 import {catchError} from 'rxjs/operators';
 
@@ -12,17 +12,17 @@ import {Observable} from 'rxjs';
   providedIn: 'root'
 })
 export class UsersService extends BasicService {
-  private _usersUrl = this.baseUrl + '/api/users?';
-  private _statusPrefix = 'status=';
-  private _languagePrefix = 'language=';
-  private _vacationRequestsUrl = this.baseUrl + '/api/users/requests/vacation?';
-  private _authorizationRequestsUrl = this.baseUrl + '/api/users/requests/authorization?';
+  private _usersUrl = this.baseUrl + '/api/users';
+
+  constructor(protected http: HttpClient) {
+    super(http);
+  }
 
   /**
    * Returns all authorized users
    */
   getAuthorizedUsers() {
-    return this.makeUsersApiCall(ProfileStatus.AUTHORIZED, '');
+    return this.makeGetUsersApiCall(ProfileStatus.AUTHORIZED, null);
   }
 
   /**
@@ -31,14 +31,14 @@ export class UsersService extends BasicService {
    * @param language filter users based on language
    */
   getAuthorizedUsersWithLanguage(language: Languages) {
-    return this.makeUsersApiCall(ProfileStatus.AUTHORIZED, language);
+    return this.makeGetUsersApiCall(ProfileStatus.AUTHORIZED, language);
   }
 
   /**
    * Returns all pending users
    */
   getPendingUsers() {
-    return this.makeUsersApiCall(ProfileStatus.PENDING, '');
+    return this.makeGetUsersApiCall(ProfileStatus.PENDING, null);
   }
 
   /**
@@ -47,14 +47,14 @@ export class UsersService extends BasicService {
    * @param language filter users based on language
    */
   getPendingUsersWithLanguage(language: Languages) {
-    return this.makeUsersApiCall(ProfileStatus.PENDING, language);
+    return this.makeGetUsersApiCall(ProfileStatus.PENDING, language);
   }
 
   /**
    * Return all rejected users
    */
   getRejectedUsers() {
-    return this.makeUsersApiCall(ProfileStatus.REJECTED, '');
+    return this.makeGetUsersApiCall(ProfileStatus.REJECTED, null);
   }
 
   /**
@@ -63,7 +63,7 @@ export class UsersService extends BasicService {
    * @param language filter users based on language
    */
   getRejectedUsersWithLanguage(language: Languages) {
-    return this.makeUsersApiCall(ProfileStatus.REJECTED, language);
+    return this.makeGetUsersApiCall(ProfileStatus.REJECTED, language);
   }
 
  /**
@@ -71,14 +71,14 @@ export class UsersService extends BasicService {
   * regardless of language and status
   */
   getUsers() {
-    return this.makeUsersApiCall('', '');
+    return this.makeGetUsersApiCall(null, null);
   }
 
   /**
    * Returns all vacation requests
    */
   getVacationRequests() {
-    return this.makeVacationRequestsApiCall('');
+    return this.makeGetVacationRequestsApiCall(null);
   }
 
   /**
@@ -86,7 +86,7 @@ export class UsersService extends BasicService {
    * @param language filter by passed language
    */
   getVacationRequestsWithLanguage(language: Languages) {
-    return this.makeVacationRequestsApiCall(language);
+    return this.makeGetVacationRequestsApiCall(language);
   }
 
 
@@ -94,7 +94,7 @@ export class UsersService extends BasicService {
    * Returns all authorization requests
    */
   getAuthorizationRequests() {
-    return this.makeAuthorizationRequestsApiCall('');
+    return this.makeGetAuthorizationRequestsApiCall(null);
   }
 
 
@@ -103,51 +103,53 @@ export class UsersService extends BasicService {
    * @param language filter by passed language
    */
   getAuthorizationRequestsWithLanguage(language: Languages) {
-    return this.makeAuthorizationRequestsApiCall(language);
+    return this.makeGetAuthorizationRequestsApiCall(language);
   }
 
-  private makeAuthorizationRequestsApiCall(language: string) {
-    const apiUrl: string = this.createApiUrl(this._authorizationRequestsUrl, '', language);
+  /**
+   * Získání žádostí o autorizaci všech uživatelů s možností filtrace pomocí úrovně schválení.
+   * GET /users/requests/authorization?[lang=<CZ,EN>]&[status=<ACCEPTED, PENDING, REJECTED>
+   * @param language filter by language
+   */
+  private makeGetAuthorizationRequestsApiCall(language: string) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+    const options = {params: httpParams};
 
-    return this.http.get<AuthorizationRequest[]>(apiUrl)
+    return this.http.get<AuthorizationRequest[]>(this._usersUrl + '/requests/authorization', options)
       .pipe(
         catchError(err => this.handleError(err))
       );
   }
 
-  private makeVacationRequestsApiCall(language: string) {
-    const apiUrl: string = this.createApiUrl(this._vacationRequestsUrl, '', language);
+  /**
+   * Získání žádostí o dovolené a sick days všech uživatelů s možností filtrace pomocí úrovně schválení.
+   * GET /users/requests/vacation? [lang=<CZ,EN>]&[status=<ACCEPTED, PENDING, REJECTED>]
+   * @param language filter by language
+   */
+  private makeGetVacationRequestsApiCall(language: string) {
+    const httpParams: HttpParams = this.createParams({lang: language});
+    const options = {params: httpParams};
 
-    return this.http.get<VacationRequest[]>(apiUrl)
+    return this.http.get<VacationRequest[]>(this._usersUrl + '/requests/vacation', options)
       .pipe(
         catchError(err => this.handleError(err))
       );
   }
 
-  private makeUsersApiCall(status: string, language: string): Observable<UserBasicInformation[]> {
-    const apiUrl: string = this.createApiUrl(this._usersUrl, status, language);
+  /**
+   * Získání všech uživatelů s možností filtrace pomocí statusu
+   * GET /users?[lang=<CZ,EN>]&[status=<ACCEPTED, PENDING, REJECTED>]
+   * @param status filter by status
+   * @param language filter by language
+   */
+  private makeGetUsersApiCall(status: string, language: string): Observable<UserBasicInformation[]> {
+    const httpParams: HttpParams = this.createParams({lang: language, status});
+    const options = {params: httpParams};
 
-    return this.http.get<UserBasicInformation[]>(apiUrl)
+    return this.http.get<UserBasicInformation[]>(this._usersUrl, options)
       .pipe(
         catchError(err => this.handleError(err))
       );
   }
 
-  private createApiUrl(base: string, status: string, language: string): string {
-    let apiUrl = base;
-
-    if (status.length > 0) {
-      apiUrl += this._statusPrefix + status + '&';
-    }
-    if (language.length > 0) {
-      apiUrl += this._languagePrefix + language;
-    }
-
-    return apiUrl;
-  }
-
-  constructor(protected http: HttpClient) {
-    super(http);
-  }
-
 }
