Index: src/main/java/edu/gjoko/schedlr/SchedlrApplication.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/SchedlrApplication.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/SchedlrApplication.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -3,8 +3,6 @@
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
 
 @SpringBootApplication
-@EnableJpaAuditing
 public class SchedlrApplication {
 
Index: src/main/java/edu/gjoko/schedlr/config/AppAuthenticationFailureHandler.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/AppAuthenticationFailureHandler.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,26 +1,0 @@
-package edu.gjoko.schedlr.config;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.security.authentication.InternalAuthenticationServiceException;
-import org.springframework.security.core.AuthenticationException;
-import org.springframework.security.web.authentication.AuthenticationFailureHandler;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-public class AppAuthenticationFailureHandler implements AuthenticationFailureHandler {
-
-    protected Log logger = LogFactory.getLog(this.getClass());
-    @Override
-    public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {
-      if (exception instanceof InternalAuthenticationServiceException) {
-          response.sendRedirect(request.getContextPath() + "/login?error=notApproved");
-      } else if (exception instanceof BadCredentialsException) {
-          response.sendRedirect(request.getContextPath() + "/login?error=badCredentials");
-      }
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/config/AppAuthenticationSuccessHandler.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/AppAuthenticationSuccessHandler.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
+++ src/main/java/edu/gjoko/schedlr/config/AppAuthenticationSuccessHandler.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -0,0 +1,67 @@
+package edu.gjoko.schedlr.config;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.web.DefaultRedirectStrategy;
+import org.springframework.security.web.RedirectStrategy;
+import org.springframework.security.web.WebAttributes;
+import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+public class AppAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
+
+    protected Log logger = LogFactory.getLog(this.getClass());
+    private final RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
+
+    @Override
+    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
+        handle(request, response, authentication);
+        clearAuthenticationAttributes(request);
+    }
+
+    protected void handle(HttpServletRequest request,
+                          HttpServletResponse response,
+                          Authentication authentication) throws IOException {
+        String targetUrl = determineTargetUrl(authentication);
+
+        if (response.isCommitted()) {
+            logger.debug("Response has already been committed. Unable to redirect to " +
+                    targetUrl);
+            return;
+        }
+        redirectStrategy.sendRedirect(request, response, targetUrl);
+    }
+
+    protected String determineTargetUrl(final Authentication authentication) {
+        Map<String, String> roleTargetUrlMap = new HashMap<>();
+        roleTargetUrlMap.put("DATE", "/date");
+        roleTargetUrlMap.put("GUESS_NUMBER", "/number");
+
+        final Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities();
+        for (final GrantedAuthority grantedAuthority : authorities) {
+            String authorityName = grantedAuthority.getAuthority();
+            if (roleTargetUrlMap.containsKey(authorityName)) {
+                return roleTargetUrlMap.get(authorityName);
+            }
+        }
+        throw new IllegalStateException();
+    }
+
+    protected void clearAuthenticationAttributes(HttpServletRequest request) {
+        HttpSession session = request.getSession(false);
+        if (session == null) {
+            return;
+        }
+        session.removeAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);
+    }
+}
Index: src/main/java/edu/gjoko/schedlr/config/AppConfig.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/AppConfig.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,27 +1,0 @@
-package edu.gjoko.schedlr.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.core.GrantedAuthorityDefaults;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.security.web.authentication.AuthenticationFailureHandler;
-import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
-
-@Configuration
-public class AppConfig {
-    @Bean
-    public BCryptPasswordEncoder bCryptPasswordEncoder() {
-        return new BCryptPasswordEncoder();
-    }
-
-
-    @Bean
-    public AuthenticationFailureHandler appAuthenticationFailureHandler() {
-        return new AppAuthenticationFailureHandler();
-    }
-
-    @Bean
-    GrantedAuthorityDefaults grantedAuthorityDefaults() {
-        return new GrantedAuthorityDefaults("");
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/config/AppFilter.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/AppFilter.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/config/AppFilter.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -1,16 +1,14 @@
 package edu.gjoko.schedlr.config;
 
-import edu.gjoko.schedlr.services.PostgresUserDetailsService;
-import lombok.RequiredArgsConstructor;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.context.SecurityContextImpl;
 import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.filter.GenericFilterBean;
 
-import javax.servlet.*;
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
@@ -19,63 +17,30 @@
 import java.util.Map;
 
-@RequiredArgsConstructor
 public class AppFilter extends GenericFilterBean {
-
-    private final PostgresUserDetailsService userDetailsService;
     @Override
     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
         HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
         HttpSession session = httpServletRequest.getSession(false);
-        HttpServletResponse response = (HttpServletResponse) servletResponse;
-
-        if(httpServletRequest.getRequestURI().endsWith(".js")
-                || httpServletRequest.getRequestURI().endsWith(".css")) {
-            filterChain.doFilter(servletRequest, servletResponse);
-            return;
-        }
-
-        if(httpServletRequest.getRequestURI().startsWith("/api")) {
-            session = ((HttpServletRequest) servletRequest).getSession(true);
-            SecurityContextImpl sci = (SecurityContextImpl) session.getAttribute("SPRING_SECURITY_CONTEXT");
-
-            if(sci != null && session.getAttribute("stakeholderId") == null) {
-                UserDetails userDetails = (UserDetails) sci.getAuthentication().getPrincipal();
-                Long stakeholderId = userDetailsService.loadStakeholderId(userDetails.getUsername());
-                session.setAttribute("stakeholderId", stakeholderId);
-            }
-            filterChain.doFilter(servletRequest, servletResponse);
-            return;
-        }
 
         if(session != null) {
+            Map<String, String> roleTargetUrlMap = new HashMap<>();
+            roleTargetUrlMap.put("DATE", "/date");
+            roleTargetUrlMap.put("GUESS_NUMBER", "/number");
             SecurityContextImpl sci = (SecurityContextImpl) session.getAttribute("SPRING_SECURITY_CONTEXT");
             if(sci != null) {
                 UserDetails userDetails = (UserDetails) sci.getAuthentication().getPrincipal();
-                Long stakeholderId = userDetailsService.loadStakeholderId(userDetails.getUsername());
-                session.setAttribute("stakeholderId", stakeholderId);
-
                 final Collection<? extends GrantedAuthority> authorities = userDetails.getAuthorities();
                 for (final GrantedAuthority grantedAuthority : authorities) {
                     String authorityName = grantedAuthority.getAuthority();
-                    String page = "";
-                    switch (authorityName) {
-                        case "ADMIN":
-                            page = "/admin";
-                            break;
-                        case "CUSTOMER":
-                            if ("/customer_admin".equals(httpServletRequest.getRequestURI())) {
-                                page = "/customer_admin";
-                            } else {
-                                page = "/homepage";
-                            }
-                            break;
-                        case "BUSINESS_OWNER":
-                            page = "/business_admin";
-                            break;
-                        default:
-                            break;
-                    }
-                    if(page != null && !page.trim().isEmpty() && !DispatcherType.ERROR.equals(servletRequest.getDispatcherType())) {
-                        servletRequest.getRequestDispatcher(page).forward(servletRequest, servletResponse);
+                    if("DATE".equalsIgnoreCase(authorityName)) {
+                        servletRequest.getRequestDispatcher("date").forward(servletRequest, servletResponse);
+                        return;
+                    } else if("GUESS_NUMBER".equalsIgnoreCase(authorityName)) {
+                        try {
+                            servletRequest.getRequestDispatcher("number").forward(servletRequest, servletResponse);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+
                         return;
                     }
Index: src/main/java/edu/gjoko/schedlr/config/AppSecurityConfig.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/AppSecurityConfig.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/config/AppSecurityConfig.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -1,81 +1,57 @@
 package edu.gjoko.schedlr.config;
 
-import edu.gjoko.schedlr.services.PostgresUserDetailsService;
-import lombok.AllArgsConstructor;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
 import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.config.core.GrantedAuthorityDefaults;
+import org.springframework.security.core.userdetails.User;
+import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.security.web.authentication.AuthenticationFailureHandler;
-import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
-import org.springframework.security.web.authentication.logout.HeaderWriterLogoutHandler;
-import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
+import org.springframework.security.provisioning.InMemoryUserDetailsManager;
+import org.springframework.security.provisioning.UserDetailsManager;
+import org.springframework.security.web.SecurityFilterChain;
 import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
-import org.springframework.security.web.header.writers.ClearSiteDataHeaderWriter;
-
-import static org.springframework.security.web.header.writers.ClearSiteDataHeaderWriter.Directive.*;
 
 @Configuration
-@EnableWebSecurity
-@AllArgsConstructor
-public class AppSecurityConfig extends WebSecurityConfigurerAdapter {
-
-    private static final ClearSiteDataHeaderWriter.Directive[] SOURCE =
-            {CACHE, COOKIES, STORAGE, EXECUTION_CONTEXTS};
-
-    private final PostgresUserDetailsService userDetailsService;
-
-    private final BCryptPasswordEncoder passwordEncoder;
-
-    private final AuthenticationFailureHandler authenticationFailureHandler;
+public class AppSecurityConfig {
 
     @Bean
-    public AuthenticationManager customAuthenticationManager() throws Exception {
-        return authenticationManager();
-    }
-
-    @Override
-    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
-        auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder);
-    }
-
-    @Override
-    protected void configure(HttpSecurity http) throws Exception {
-        http.csrf()
+    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
+        http
+                .csrf()
                 .disable()
+                .authorizeRequests(urlRegistry -> urlRegistry
+                        .antMatchers("/login*").permitAll()
+                        .antMatchers("/css/**").permitAll()
+                        .antMatchers("/anonymous*").permitAll()
+                        .anyRequest()
+                        .fullyAuthenticated()
+                )
                 .httpBasic()
                 .authenticationEntryPoint(new AppAuthenticationEntryPoint())
                 .and()
-                .addFilterAfter(new AppFilter(userDetailsService), BasicAuthenticationFilter.class)
+                .addFilterBefore(new AppFilter(), BasicAuthenticationFilter.class)
                 .formLogin()
                 .loginPage("/login")
                 .loginProcessingUrl("/login")
-                .failureHandler(authenticationFailureHandler)
-                .defaultSuccessUrl("/login")
-                .and()
-                .logout(logout -> logout
-                        .logoutUrl("/logout")
-                        .logoutSuccessUrl("/login")
-                        .addLogoutHandler(new SecurityContextLogoutHandler())
-                        .addLogoutHandler(new HeaderWriterLogoutHandler(new ClearSiteDataHeaderWriter(SOURCE))))
-                .authorizeRequests()
-                .antMatchers("/login").permitAll()
-                .antMatchers("/logout").permitAll()
-                .antMatchers("/register_customer").permitAll()
-                .antMatchers("/register_business").permitAll()
-                .antMatchers("/api/nomenclature/*").permitAll()
-                .antMatchers("/api/user/me").permitAll()
-                .antMatchers("/api/business").permitAll()
-                .antMatchers("/api/appointment").permitAll()
-                .antMatchers("/homepage").permitAll()
-                .antMatchers("/css/**").permitAll()
-                .antMatchers("/js/**").permitAll()
-                .antMatchers("/anonymous*").anonymous()
-                .anyRequest()
-                .fullyAuthenticated();
+                .successHandler(new AppAuthenticationSuccessHandler());
+
+        return http.build();
     }
+
+    @Bean
+    public UserDetailsManager userDetailsService() {
+        return null;
+    }
+
+    @Bean
+    public BCryptPasswordEncoder bCryptPasswordEncoder() {
+        return new BCryptPasswordEncoder();
+    }
+
+    @Bean
+    public GrantedAuthorityDefaults grantedAuthorityDefaults() {
+        return new GrantedAuthorityDefaults("");
+    }
+
 }
Index: src/main/java/edu/gjoko/schedlr/config/ExceptionHandlerAdvice.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/ExceptionHandlerAdvice.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,19 +1,0 @@
-package edu.gjoko.schedlr.config;
-
-import edu.gjoko.schedlr.exceptions.BlockingTimeException;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.ControllerAdvice;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.context.request.WebRequest;
-import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
-
-@ControllerAdvice
-public class ExceptionHandlerAdvice extends ResponseEntityExceptionHandler {
-
-    @ExceptionHandler(value = BlockingTimeException.class)
-    protected ResponseEntity<Object> handleConflict(RuntimeException ex, WebRequest request) {
-        return handleExceptionInternal(ex, ex.getMessage(), new HttpHeaders(), HttpStatus.CONFLICT, request);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/config/MvcConfig.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/config/MvcConfig.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/config/MvcConfig.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -11,10 +11,7 @@
     public void addViewControllers(ViewControllerRegistry registry) {
         registry.addViewController("/login").setViewName("login");
-        registry.addViewController("/register_customer").setViewName("register_customer");
-        registry.addViewController("/register_business").setViewName("register_business");
+        registry.addViewController("/register/user").setViewName("register_user");
+        registry.addViewController("/register/business").setViewName("register_business");
         registry.addViewController("/homepage").setViewName("homepage");
-        registry.addViewController("/admin").setViewName("admin");
-        registry.addViewController("/business_admin").setViewName("business_admin");
-        registry.addViewController("/customer_admin").setViewName("customer_admin");
     }
 }
Index: src/main/java/edu/gjoko/schedlr/controllers/AdministrationController.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/AdministrationController.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,30 +1,0 @@
-package edu.gjoko.schedlr.controllers;
-
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-
-import javax.servlet.http.HttpServletRequest;
-
-@Controller
-public class AdministrationController {
-
-    @GetMapping(path = "/admin")
-    public String getAdminPageTemplate(Model model) {
-        return "admin";
-    }
-
-    @GetMapping(path = "/business_admin")
-    public String getBusinessAdminPageTemplate(Model model) {
-        return "business_admin";
-    }
-
-    @GetMapping(path = "/customer_admin")
-    public String getCustomerAdminPageTemplate(Model model) {
-        return "customer_admin";
-    }
-
-
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/HomePageController.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/HomePageController.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,20 +1,0 @@
-package edu.gjoko.schedlr.controllers;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-
-@Controller
-public class HomePageController {
-
-    @GetMapping(path = "/homepage")
-    public String getHomePageTemplate(Model model) {
-        return "homepage";
-    }
-
-    @PostMapping(path = "/homepage")
-    public String postHomePageTemplate(Model model) {
-        return "homepage";
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/LoginController.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/LoginController.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,26 +1,0 @@
-package edu.gjoko.schedlr.controllers;
-
-import edu.gjoko.schedlr.entity.Stakeholder;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import java.security.Principal;
-
-@Controller
-public class LoginController {
-
-    @GetMapping(path = "/login")
-    public String getMapping(@RequestParam(value = "error", required = false) String error,
-                             @ModelAttribute Stakeholder customer, Model model) {
-        return "login";
-    }
-
-    @PostMapping(path = "/login")
-    public String loginCustomer(@ModelAttribute Stakeholder customer, Model model) {
-        return "redirect:login";
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/RegisterController.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/RegisterController.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,41 +1,0 @@
-package edu.gjoko.schedlr.controllers;
-
-import edu.gjoko.schedlr.entity.Stakeholder;
-import edu.gjoko.schedlr.services.StakeholderService;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.PostMapping;
-
-@Controller
-public class RegisterController {
-
-    private final StakeholderService stakeholderService;
-
-    public RegisterController(StakeholderService stakeholderService) {
-        this.stakeholderService = stakeholderService;
-    }
-
-    @GetMapping(path ="/register_customer")
-    public String getCustomerRegisterPage(Model model) {
-        model.addAttribute("stakeholder", new Stakeholder());
-        return "register_customer";
-    }
-
-    @PostMapping(path = "/register_customer")
-    public String registerCustomer(@ModelAttribute Stakeholder customer, Model model) {
-        stakeholderService.saveStakeholder(customer);
-        return "redirect:login";
-    }
-
-    @GetMapping(path = "/register_business")
-    public String getBusinessRegisterPage(Model model) {
-        return "register_business";
-    }
-
-    @PostMapping(value = "/register_business")
-    public String registerBusiness(Model model) {
-        return "redirect:login";
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/rest/AdminApi.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/rest/AdminApi.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,26 +1,0 @@
-package edu.gjoko.schedlr.controllers.rest;
-
-import edu.gjoko.schedlr.entity.Business;
-import edu.gjoko.schedlr.services.BusinessService;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.PatchMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-
-@RestController
-@RequestMapping("api/admin")
-@AllArgsConstructor
-public class AdminApi {
-
-    private final BusinessService businessService;
-
-    @PatchMapping
-    public void updateBusinessStatus(@RequestBody List<Business> businessList, HttpServletRequest request) {
-        Long customerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        businessService.updateBusinessStatuses(businessList);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/rest/AppointmentApi.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/rest/AppointmentApi.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,59 +1,0 @@
-package edu.gjoko.schedlr.controllers.rest;
-
-import edu.gjoko.schedlr.dto.AppointmentDto;
-import edu.gjoko.schedlr.dto.AppointmentInfoDto;
-import edu.gjoko.schedlr.entity.Appointment;
-import edu.gjoko.schedlr.entity.Stakeholder;
-import edu.gjoko.schedlr.mappers.AppointmentDtoMapper;
-import edu.gjoko.schedlr.services.AppointmentsService;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.*;
-
-import javax.security.sasl.AuthenticationException;
-import javax.servlet.http.HttpServletRequest;
-import java.time.LocalDateTime;
-import java.util.List;
-import java.util.stream.Collectors;
-
-@RestController
-@RequestMapping("api/appointment")
-@AllArgsConstructor
-public class AppointmentApi {
-
-    private final AppointmentsService appointmentsService;
-    private final AppointmentDtoMapper appointmentsMapper;
-
-    @PostMapping
-    public void getBusinessTypes(@RequestBody Appointment appointment, HttpServletRequest request) {
-        Long customerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        Stakeholder customer = new Stakeholder();
-        customer.setId(customerId);
-        appointment.setCustomer(customer);
-        appointmentsService.saveAppointment(appointment);
-    }
-
-    @GetMapping(path = "/business/{businessId}")
-    public List<AppointmentDto> getAppointmentsByBusiness(@PathVariable("businessId") Long businessId) {
-        return appointmentsService.getActiveAppointmentsByBusiness(businessId).stream()
-                .map(appointmentsMapper::appointmentToAppointmentDto)
-                .collect(Collectors.toList());
-    }
-
-    @GetMapping(path = "/future/me")
-    public List<AppointmentInfoDto> getFutureAppointmentsInfoList(HttpServletRequest request) {
-        Long businessOwnerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        return appointmentsService.getFutureAppointmentInfoList(businessOwnerId);
-    }
-
-    @GetMapping(path = "/past/me")
-    public List<AppointmentInfoDto> getPastAppointmentsInfoList(HttpServletRequest request) {
-        Long stakeholderId = (long) request.getSession(true).getAttribute("stakeholderId");
-        return appointmentsService.getPastAppointmentInfoList(stakeholderId);
-    }
-
-    @DeleteMapping("/{appointmentId}")
-    public void cancelAppointment(@PathVariable("appointmentId") Long appointmentId, HttpServletRequest request) throws AuthenticationException {
-        Long stakeholderId = (long) request.getSession(true).getAttribute("stakeholderId");
-        appointmentsService.deleteAppointment(appointmentId, stakeholderId);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/rest/BusinessApi.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/rest/BusinessApi.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,44 +1,0 @@
-package edu.gjoko.schedlr.controllers.rest;
-
-import edu.gjoko.schedlr.entity.Business;
-import edu.gjoko.schedlr.services.BusinessService;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-
-@RestController
-@RequestMapping("api/business")
-@AllArgsConstructor
-public class BusinessApi {
-
-    private final BusinessService businessService;
-
-    @PostMapping
-    public void saveBusiness(@RequestBody Business business) {
-        businessService.saveBusiness(business);
-    }
-
-    @GetMapping
-    public List<Business> findAll() {
-        return businessService.findAll();
-    }
-
-    @PatchMapping
-    public void updateBusinesses(@RequestBody List<Business> businessList, HttpServletRequest request) {
-        Long businessOwnerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        businessService.updateBusinesses(businessList, businessOwnerId);
-    }
-
-    @GetMapping(path = "/me")
-    public Business getPersonalInfo(HttpServletRequest request) {
-        Long businessOwnerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        return businessService.findByOwner(businessOwnerId);
-    }
-
-    @GetMapping(path = "/{businessTypeId}")
-    public List<Business> getBusinessesByBusinessType(@PathVariable("businessTypeId") Long id) {
-        return businessService.findByBusinessTypeAndActiveStatus(id);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/rest/CustomerApi.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/rest/CustomerApi.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,30 +1,0 @@
-package edu.gjoko.schedlr.controllers.rest;
-
-import edu.gjoko.schedlr.entity.Business;
-import edu.gjoko.schedlr.entity.Stakeholder;
-import edu.gjoko.schedlr.services.StakeholderService;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-
-@RestController
-@RequestMapping("api/customer")
-@AllArgsConstructor
-public class CustomerApi {
-
-    private final StakeholderService stakeholderService;
-
-    @GetMapping(path = "/me")
-    public Stakeholder getCustomerInfo(HttpServletRequest request) {
-        Long customerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        return stakeholderService.findById(customerId);
-    }
-
-    @PatchMapping
-    public void updateCustomer(@RequestBody Stakeholder stakeholder, HttpServletRequest request) {
-        Long customerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        stakeholderService.saveOrUpdateStakeholder(stakeholder, customerId);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/rest/NomenclatureApi.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/rest/NomenclatureApi.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,31 +1,0 @@
-package edu.gjoko.schedlr.controllers.rest;
-
-import edu.gjoko.schedlr.entity.BusinessType;
-import edu.gjoko.schedlr.entity.ServiceType;
-import edu.gjoko.schedlr.services.NomenclaturesService;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-
-@RestController
-@RequestMapping("api/nomenclature")
-@AllArgsConstructor
-public class NomenclatureApi {
-
-    private final NomenclaturesService nomenclaturesService;
-    @GetMapping( "/businessTypes")
-    public List<BusinessType> getBusinessTypes() {
-        return nomenclaturesService.getBusinessTypes();
-    }
-
-    @GetMapping( "/serviceTypes/me")
-    public List<ServiceType> getServiceTypesForBusinessType( HttpServletRequest request) {
-        Long ownerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        return nomenclaturesService.findAppropriateBusinessTypesForBusinessByOwnerId(ownerId);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/rest/ReviewApi.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/rest/ReviewApi.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,44 +1,0 @@
-package edu.gjoko.schedlr.controllers.rest;
-
-import edu.gjoko.schedlr.dto.ReviewDto;
-import edu.gjoko.schedlr.entity.Review;
-import edu.gjoko.schedlr.entity.Stakeholder;
-import edu.gjoko.schedlr.mappers.ReviewDtoMapper;
-import edu.gjoko.schedlr.services.ReviewService;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-
-@RestController
-@RequestMapping("api/review")
-@AllArgsConstructor
-public class ReviewApi {
-
-    private final ReviewService reviewService;
-    private final ReviewDtoMapper reviewDtoMapper;
-
-    @PostMapping
-    public void getBusinessTypes(@RequestBody Review review, HttpServletRequest request) {
-        Long customerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        Stakeholder customer = new Stakeholder();
-        customer.setId(customerId);
-        reviewService.save(review, customerId);
-    }
-
-    @GetMapping(path = "/me")
-    public List<ReviewDto> getReviews(HttpServletRequest request) {
-        Long customerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        return reviewService.getReviewsByCustomerId(customerId).stream()
-                .map(reviewDtoMapper::mapToReviewDto)
-                .toList();
-    }
-
-    @GetMapping(path = "/{serviceId}")
-    public List<ReviewDto> getReviewsForService(@PathVariable("serviceId") Long serviceId) {
-        return reviewService.getReviewsByServiceId(serviceId).stream()
-                .map(reviewDtoMapper::mapToReviewDto)
-                .toList();
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/rest/ServiceApi.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/rest/ServiceApi.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,47 +1,0 @@
-package edu.gjoko.schedlr.controllers.rest;
-
-import edu.gjoko.schedlr.dto.ServiceDto;
-import edu.gjoko.schedlr.entity.Service;
-import edu.gjoko.schedlr.mappers.ServiceDtoMapper;
-import edu.gjoko.schedlr.services.ServicesService;
-import lombok.AllArgsConstructor;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-import java.util.Objects;
-
-@RestController
-@RequestMapping("api/service")
-@AllArgsConstructor
-public class ServiceApi {
-
-
-    private ServicesService service;
-    private ServiceDtoMapper serviceDtoMapper;
-    @PostMapping(path="/delete")
-    public void saveBusiness(@RequestBody List<Service> serviceList) {
-        if(!CollectionUtils.isEmpty(serviceList)) {
-            List<Long> serviceIds = serviceList.stream()
-                    .map(Service::getId)
-                    .filter(Objects::nonNull)
-                    .toList();
-            service.deleteByIds(serviceIds);
-        }
-    }
-
-    @PatchMapping
-    public void updateServices (@RequestBody List<Service> serviceList, HttpServletRequest request) {
-        Long ownerId = (long) request.getSession(true).getAttribute("stakeholderId");
-        service.saveOrUpdateServices(serviceList, ownerId);
-    }
-
-    @GetMapping
-    public List<ServiceDto> searchServicesByKeyWord(@RequestParam(value = "searchKeyword", required = false) String searchKeyWord) {
-        return service.getServicesByKeyword(searchKeyWord)
-                .stream()
-                .map(serviceDtoMapper::serviceToServiceDto)
-                .toList();
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/controllers/rest/UserApi.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/controllers/rest/UserApi.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,19 +1,0 @@
-package edu.gjoko.schedlr.controllers.rest;
-
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletRequest;
-
-@RestController
-@RequestMapping("api/user")
-@AllArgsConstructor
-public class UserApi {
-
-    @GetMapping(path = "/me")
-    public boolean findAll(HttpServletRequest request) {
-        return request.getSession(true).getAttribute("stakeholderId") != null;
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/dto/AppointmentDto.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/dto/AppointmentDto.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,17 +1,0 @@
-package edu.gjoko.schedlr.dto;
-
-import lombok.*;
-
-import java.time.LocalDateTime;
-
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-@Builder
-public class AppointmentDto {
-
-    private String title;
-    private LocalDateTime startTime;
-    private LocalDateTime endTime;
-}
Index: src/main/java/edu/gjoko/schedlr/dto/AppointmentInfoDto.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/dto/AppointmentInfoDto.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,18 +1,0 @@
-package edu.gjoko.schedlr.dto;
-
-import lombok.*;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@Builder
-public class AppointmentInfoDto {
-
-    private Long appointmentId;
-    private String fullName;
-    private String email;
-    private String phoneNumber;
-    private String timePeriod;
-    private String serviceName;
-    private String status;
-}
Index: src/main/java/edu/gjoko/schedlr/dto/ReviewDto.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/dto/ReviewDto.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,20 +1,0 @@
-package edu.gjoko.schedlr.dto;
-
-import lombok.*;
-
-import java.time.LocalDateTime;
-
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-@Builder
-public class ReviewDto {
-
-    private String customerName;
-    private String businessName;
-    private String serviceName;
-    private Long rating;
-    private String comment;
-    private LocalDateTime created;
-}
Index: src/main/java/edu/gjoko/schedlr/dto/ServiceDto.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/dto/ServiceDto.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,23 +1,0 @@
-package edu.gjoko.schedlr.dto;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-public class ServiceDto {
-
-    private long id;
-    private String serviceName;
-    private String description;
-    private Float rating;
-    private int reviewsCount;
-    private long businessId;
-    private String businessName;
-    private int duration;
-    private int price;
-}
Index: src/main/java/edu/gjoko/schedlr/entity/Appointment.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/Appointment.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/entity/Appointment.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -1,8 +1,8 @@
 package edu.gjoko.schedlr.entity;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import lombok.*;
-import org.springframework.data.annotation.LastModifiedDate;
-import org.springframework.data.jpa.domain.support.AuditingEntityListener;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 
 import javax.persistence.*;
@@ -10,7 +10,7 @@
 
 @Entity
-@EntityListeners(AuditingEntityListener.class)
 @Table(name = "appointment")
-@Data
+@Getter
+@Setter
 @NoArgsConstructor
 @AllArgsConstructor
@@ -21,5 +21,5 @@
     private Long id;
 
-    @Column(name = "start_time")
+    @Column(name = "start_type")
     private LocalDateTime startTime;
 
@@ -27,29 +27,11 @@
     private LocalDateTime endTime;
 
-    @ManyToOne
-    @JoinColumn(name = "stakeholder_id")
-    @JsonBackReference(value = "customerAppointments")
-    private Stakeholder customer;
-
-    @ManyToOne
-    @JoinColumn(name = "service_id")
-    @JsonBackReference(value = "serviceAppointments")
-    private Service service;
-
-    @Column(name = "appointment_status", length = 32, columnDefinition = "varchar(32) default 'NEW'")
-    @Enumerated(EnumType.STRING)
-    private AppointmentStatus appointmentStatus = AppointmentStatus.NEW;
+    @Column(name = "price")
+    private Float price;
 
     @Column(name = "created")
-    @LastModifiedDate
     private LocalDateTime created;
 
     @Column(name = "modified")
-    @LastModifiedDate
     private LocalDateTime modified;
-
-    public String getTimePeriod() {
-        return startTime + " - " + endTime;
-    }
-
 }
Index: src/main/java/edu/gjoko/schedlr/entity/AppointmentStatus.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/AppointmentStatus.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,8 +1,0 @@
-package edu.gjoko.schedlr.entity;
-
-public enum AppointmentStatus {
-    NEW,
-    CANCELLED_BY_CUSTOMER,
-    CANCELLED_BY_BUSINESS_OWNER,
-    FINISHED_AND_REVIEWED_BY_USER;
-}
Index: src/main/java/edu/gjoko/schedlr/entity/Business.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/Business.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/entity/Business.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -1,21 +1,15 @@
 package edu.gjoko.schedlr.entity;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
-import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
-import org.springframework.data.annotation.CreatedDate;
-import org.springframework.data.annotation.LastModifiedDate;
-import org.springframework.data.jpa.domain.support.AuditingEntityListener;
 
 import javax.persistence.*;
+import java.sql.Timestamp;
 import java.time.LocalDateTime;
 import java.util.List;
 
 @Entity
-@EntityListeners(AuditingEntityListener.class)
 @Table(name = "business")
 @Getter
@@ -29,35 +23,28 @@
     private Long id;
 
-    @Column(name = "company_name")
-    private String companyName;
+    @Column(name = "name")
+    private String name;
 
-    @OneToOne
-    @JoinColumn(name = "business_type_id", referencedColumnName = "id")
-    @JsonProperty("businessType")
+    @Column(name = "business_type")
+    @Enumerated(EnumType.STRING)
     private BusinessType businessType;
 
-    @OneToOne(cascade = CascadeType.PERSIST)
-    @JoinColumn(name = "owner_id", referencedColumnName = "id", nullable = false)
-    @JsonProperty("owner")
+    @Column(name = "opening_time")
+    private LocalDateTime openingTime;
+
+    @Column(name = "closing_time")
+    private LocalDateTime closingTime;
+
+    @OneToOne(cascade = CascadeType.ALL)
+    @JoinColumn(name = "owner_id", referencedColumnName = "id")
     private Stakeholder owner;
 
-    @OneToMany(mappedBy = "business", cascade = CascadeType.PERSIST)
-    @JsonManagedReference(value = "services")
-    private List<Service> services;
-
-    @Column(name = "business_status")
-    @Enumerated(EnumType.STRING)
-    private BusinessStatus businessStatus;
-
     @Column(name = "created")
-    @CreatedDate
-    @JsonIgnore
     private LocalDateTime created;
 
     @Column(name = "modified")
-    @LastModifiedDate
-    @JsonIgnore
     private LocalDateTime modified;
 
-
+    @OneToMany(mappedBy = "business")
+    private List<Service> services;
 }
Index: src/main/java/edu/gjoko/schedlr/entity/BusinessStatus.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/BusinessStatus.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package edu.gjoko.schedlr.entity;
-
-public enum BusinessStatus {
-    NEW,
-    ACTIVE,
-    DEACTIVATED
-}
Index: src/main/java/edu/gjoko/schedlr/entity/BusinessType.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/BusinessType.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/entity/BusinessType.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -1,49 +1,10 @@
 package edu.gjoko.schedlr.entity;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import org.springframework.data.annotation.CreatedDate;
-import org.springframework.data.annotation.LastModifiedDate;
-import org.springframework.data.jpa.domain.support.AuditingEntityListener;
-
-import javax.persistence.*;
-import java.time.LocalDateTime;
-import java.util.List;
-
-@Entity
-@EntityListeners(AuditingEntityListener.class)
-@Table(name = "business_type")
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-public class BusinessType {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE)
-    @JsonProperty("value")
-    private Long id;
-
-    @Column(name = "name")
-    @JsonProperty("text")
-    private String name;
-
-    @OneToMany(mappedBy="businessType")
-    @JsonManagedReference
-    private List<ServiceType> serviceTypes;
-
-    @Column(name = "created")
-    @CreatedDate
-    @JsonIgnore
-    private LocalDateTime created;
-
-    @Column(name = "modified")
-    @LastModifiedDate
-    @JsonIgnore
-    private LocalDateTime modified;
+public enum BusinessType {
+    TAILOR,
+    NAIL_SALON,
+    MASSAGE_PARLOR,
+    MAKEUP_STUDIO,
+    HAIRDRESSER,
+    BARBER
 }
Index: src/main/java/edu/gjoko/schedlr/entity/Review.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/Review.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,46 +1,0 @@
-package edu.gjoko.schedlr.entity;
-
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import org.springframework.data.annotation.LastModifiedDate;
-import org.springframework.data.jpa.domain.support.AuditingEntityListener;
-
-import javax.persistence.*;
-import java.time.LocalDateTime;
-
-@Entity
-@EntityListeners(AuditingEntityListener.class)
-@Table(name = "review")
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-public class Review {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE)
-    private Long id;
-
-    @Column(name = "rating")
-    private Integer rating;
-
-    @Column(name = "comment")
-    private String comment;
-
-    @OneToOne
-    @JoinColumn(name = "appointment_id", referencedColumnName = "id")
-    @JsonProperty("appointment")
-    private Appointment appointment;
-
-    @Column(name = "created")
-    @LastModifiedDate
-    private LocalDateTime created;
-
-    @Column(name = "modified")
-    @LastModifiedDate
-    private LocalDateTime modified;
-}
Index: src/main/java/edu/gjoko/schedlr/entity/Service.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/Service.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/entity/Service.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -1,21 +1,12 @@
 package edu.gjoko.schedlr.entity;
 
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
-import org.springframework.data.annotation.CreatedDate;
-import org.springframework.data.annotation.LastModifiedDate;
-import org.springframework.data.jpa.domain.support.AuditingEntityListener;
 
 import javax.persistence.*;
-import java.time.LocalDateTime;
-import java.util.List;
 
 @Entity
-@EntityListeners(AuditingEntityListener.class)
 @Table(name = "service")
 @Getter
@@ -29,44 +20,15 @@
     private Long id;
 
+    @Column(name = "name")
+    private String name;
+
     @Column(name = "duration")
     private Integer duration;
 
     @Column(name = "price")
-    private Integer price;
-
-    @Column(name = "cumulated_rating")
-    private Float rating = 0.0f;
-
-    @Column(name = "reviews_count")
-    private Integer reviewsCount = 0;
-
-    @OneToOne(cascade = CascadeType.MERGE)
-    @JoinColumn(name = "service_type_id", referencedColumnName = "id")
-    private ServiceType serviceType;
+    private Float price;
 
     @ManyToOne
     @JoinColumn(name = "business_id")
-    @JsonBackReference(value = "services")
     private Business business;
-
-    @Column(name = "description")
-    private String description;
-
-    @OneToMany(mappedBy="service")
-    @JsonManagedReference(value = "serviceAppointments")
-    private List<Appointment> appointments;
-
-    @Column(name = "service_status")
-    @Enumerated(EnumType.STRING)
-    private ServiceStatus serviceStatus = ServiceStatus.ACTIVE;
-
-    @Column(name = "created")
-    @CreatedDate
-    @JsonIgnore
-    private LocalDateTime created;
-
-    @Column(name = "modified")
-    @LastModifiedDate
-    @JsonIgnore
-    private LocalDateTime modified;
 }
Index: src/main/java/edu/gjoko/schedlr/entity/ServiceStatus.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/ServiceStatus.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,8 +1,0 @@
-package edu.gjoko.schedlr.entity;
-
-public enum ServiceStatus {
-
-    ACTIVE,
-
-    INACTIVE
-}
Index: src/main/java/edu/gjoko/schedlr/entity/ServiceType.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/ServiceType.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,46 +1,0 @@
-package edu.gjoko.schedlr.entity;
-
-import com.fasterxml.jackson.annotation.JsonBackReference;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import org.springframework.data.annotation.CreatedDate;
-import org.springframework.data.annotation.LastModifiedDate;
-import org.springframework.data.jpa.domain.support.AuditingEntityListener;
-
-import javax.persistence.*;
-import java.time.LocalDateTime;
-
-@Entity
-@EntityListeners(AuditingEntityListener.class)
-@Table(name = "service_type")
-@Getter
-@Setter
-@NoArgsConstructor
-@AllArgsConstructor
-public class ServiceType {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE)
-    private Long id;
-
-    @Column(name = "name")
-    private String name;
-
-    @ManyToOne
-    @JoinColumn(name = "business_type_id")
-    @JsonBackReference
-    private BusinessType businessType;
-
-    @Column(name = "created")
-    @CreatedDate
-    @JsonIgnore
-    private LocalDateTime created;
-
-    @Column(name = "modified")
-    @LastModifiedDate
-    @JsonIgnore
-    private LocalDateTime modified;
-}
Index: src/main/java/edu/gjoko/schedlr/entity/Stakeholder.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/entity/Stakeholder.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/entity/Stakeholder.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -1,20 +1,13 @@
 package edu.gjoko.schedlr.entity;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonManagedReference;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
-import org.springframework.data.annotation.CreatedDate;
-import org.springframework.data.annotation.LastModifiedDate;
-import org.springframework.data.jpa.domain.support.AuditingEntityListener;
 
 import javax.persistence.*;
 import java.time.LocalDateTime;
-import java.util.List;
 
 @Entity
-@EntityListeners(AuditingEntityListener.class)
 @Table(name = "stakeholder")
 @Getter
@@ -41,7 +34,4 @@
     private String email;
 
-    @Column(name = "phone_number")
-    private String phoneNumber;
-
     @Column(name = "username")
     private String username;
@@ -50,20 +40,8 @@
     private String password;
 
-    @OneToMany(mappedBy = "customer")
-    @JsonManagedReference(value = "customerAppointments")
-    private List<Appointment> appointments;
-
     @Column(name = "created")
-    @CreatedDate
-    @JsonIgnore
     private LocalDateTime created;
 
     @Column(name = "modified")
-    @LastModifiedDate
-    @JsonIgnore
     private LocalDateTime modified;
-
-    public String getFullName() {
-        return firstName + " " + lastName;
-    }
 }
Index: src/main/java/edu/gjoko/schedlr/exceptions/BlockingTimeException.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/exceptions/BlockingTimeException.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,9 +1,0 @@
-package edu.gjoko.schedlr.exceptions;
-
-public class BlockingTimeException extends RuntimeException {
-
-    public static final String MESSAGE = "Error! The selected dates are overlapping with another appointment.";
-    public BlockingTimeException() {
-        super(MESSAGE);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/mappers/AppointmentDtoMapper.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/mappers/AppointmentDtoMapper.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,25 +1,0 @@
-package edu.gjoko.schedlr.mappers;
-
-import edu.gjoko.schedlr.dto.AppointmentDto;
-import edu.gjoko.schedlr.entity.Appointment;
-import org.modelmapper.Condition;
-import org.modelmapper.ModelMapper;
-import org.modelmapper.TypeMap;
-import org.modelmapper.config.Configuration;
-import org.springframework.stereotype.Service;
-
-@Service
-public class AppointmentDtoMapper extends ModelMapper {
-
-    public AppointmentDtoMapper() {
-        this.getConfiguration().setFieldMatchingEnabled(true).setFieldAccessLevel(Configuration.AccessLevel.PRIVATE);
-        TypeMap<Appointment, AppointmentDto> propertyMapper = this.createTypeMap(Appointment.class, AppointmentDto.class);
-        Condition<String, String> hasTitle = ctx -> ctx.getSource() != null;
-        propertyMapper.addMappings(
-                mapper -> mapper.when(hasTitle).map(appointment -> appointment.getService().getServiceType().getName(), AppointmentDto::setTitle)
-        );
-    }
-    public AppointmentDto appointmentToAppointmentDto(Appointment appointment) {
-        return this.map(appointment, AppointmentDto.class);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/mappers/AppointmentInfoDtoBusinessMapper.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/mappers/AppointmentInfoDtoBusinessMapper.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,32 +1,0 @@
-package edu.gjoko.schedlr.mappers;
-
-import edu.gjoko.schedlr.dto.AppointmentInfoDto;
-import edu.gjoko.schedlr.entity.Appointment;
-import org.modelmapper.ModelMapper;
-import org.modelmapper.TypeMap;
-import org.modelmapper.config.Configuration;
-import org.springframework.stereotype.Service;
-
-@Service
-public class AppointmentInfoDtoBusinessMapper extends ModelMapper {
-
-    public AppointmentInfoDtoBusinessMapper() {
-        this.getConfiguration().setFieldMatchingEnabled(true).setFieldAccessLevel(Configuration.AccessLevel.PRIVATE);
-        TypeMap<Appointment, AppointmentInfoDto> propertyMapper = this.createTypeMap(Appointment.class, AppointmentInfoDto.class);
-        propertyMapper.addMappings(
-                mapper -> {
-                    mapper.map(Appointment::getId, AppointmentInfoDto::setAppointmentId);
-                    mapper.map(appointment -> appointment.getCustomer().getFullName(), AppointmentInfoDto::setFullName);
-                    mapper.map(appointment -> appointment.getCustomer().getEmail(), AppointmentInfoDto::setEmail);
-                    mapper.map(appointment -> appointment.getCustomer().getPhoneNumber(),AppointmentInfoDto::setPhoneNumber);
-                    mapper.map(Appointment::getTimePeriod, AppointmentInfoDto::setTimePeriod);
-                    mapper.map(appointment -> appointment.getService().getServiceType().getName(), AppointmentInfoDto::setServiceName);
-                    mapper.map(Appointment::getAppointmentStatus, AppointmentInfoDto::setStatus);
-                }
-        );
-    }
-
-    public AppointmentInfoDto appointmentToAppointmentInfoDto(Appointment appointment) {
-        return this.map(appointment, AppointmentInfoDto.class);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/mappers/AppointmentInfoDtoCustomerMapper.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/mappers/AppointmentInfoDtoCustomerMapper.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,32 +1,0 @@
-package edu.gjoko.schedlr.mappers;
-
-import edu.gjoko.schedlr.dto.AppointmentInfoDto;
-import edu.gjoko.schedlr.entity.Appointment;
-import org.modelmapper.ModelMapper;
-import org.modelmapper.TypeMap;
-import org.modelmapper.config.Configuration;
-import org.springframework.stereotype.Service;
-
-@Service
-public class AppointmentInfoDtoCustomerMapper extends ModelMapper {
-
-    public AppointmentInfoDtoCustomerMapper() {
-        this.getConfiguration().setFieldMatchingEnabled(true).setFieldAccessLevel(Configuration.AccessLevel.PRIVATE);
-        TypeMap<Appointment, AppointmentInfoDto> propertyMapper = this.createTypeMap(Appointment.class, AppointmentInfoDto.class);
-        propertyMapper.addMappings(
-                mapper -> {
-                    mapper.map(Appointment::getId, AppointmentInfoDto::setAppointmentId);
-                    mapper.map(appointment -> appointment.getService().getBusiness().getOwner().getFullName(), AppointmentInfoDto::setFullName);
-                    mapper.map(appointment -> appointment.getCustomer().getEmail(), AppointmentInfoDto::setEmail);
-                    mapper.map(appointment -> appointment.getCustomer().getPhoneNumber(),AppointmentInfoDto::setPhoneNumber);
-                    mapper.map(Appointment::getTimePeriod, AppointmentInfoDto::setTimePeriod);
-                    mapper.map(appointment -> appointment.getService().getServiceType().getName(), AppointmentInfoDto::setServiceName);
-                    mapper.map(Appointment::getAppointmentStatus, AppointmentInfoDto::setStatus);
-                }
-        );
-    }
-
-    public AppointmentInfoDto appointmentToAppointmentInfoDto(Appointment appointment) {
-        return this.map(appointment, AppointmentInfoDto.class);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/mappers/ReviewDtoMapper.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/mappers/ReviewDtoMapper.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,32 +1,0 @@
-package edu.gjoko.schedlr.mappers;
-
-import edu.gjoko.schedlr.dto.AppointmentDto;
-import edu.gjoko.schedlr.dto.ReviewDto;
-import edu.gjoko.schedlr.entity.Appointment;
-import edu.gjoko.schedlr.entity.Review;
-import org.modelmapper.ModelMapper;
-import org.modelmapper.TypeMap;
-import org.modelmapper.config.Configuration;
-import org.springframework.stereotype.Service;
-
-@Service
-public class ReviewDtoMapper extends ModelMapper {
-
-    public ReviewDtoMapper() {
-        this.getConfiguration().setFieldMatchingEnabled(true).setFieldAccessLevel(Configuration.AccessLevel.PRIVATE);
-        TypeMap<Review, ReviewDto> propertyMapper = this.createTypeMap(Review.class, ReviewDto.class);
-        propertyMapper.addMappings(mapper -> {
-            mapper.map(review -> review.getAppointment().getService().getBusiness().getCompanyName(), ReviewDto::setBusinessName);
-            mapper.map(review -> review.getAppointment().getCustomer().getFullName(), ReviewDto::setCustomerName);
-            mapper.map(review -> review.getAppointment().getService().getServiceType().getName(), ReviewDto::setServiceName);
-            mapper.map(Review::getComment, ReviewDto::setComment);
-            mapper.map(Review::getRating, ReviewDto::setRating);
-            mapper.map(Review::getCreated, ReviewDto::setCreated);
-        }
-        );
-    }
-
-    public ReviewDto mapToReviewDto(Review review) {
-        return this.map(review, ReviewDto.class);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/mappers/ServiceDtoMapper.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/mappers/ServiceDtoMapper.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,33 +1,0 @@
-package edu.gjoko.schedlr.mappers;
-
-import edu.gjoko.schedlr.dto.AppointmentDto;
-import edu.gjoko.schedlr.dto.ServiceDto;
-import edu.gjoko.schedlr.entity.Appointment;
-import org.modelmapper.ModelMapper;
-import org.modelmapper.TypeMap;
-import org.modelmapper.config.Configuration;
-import org.springframework.stereotype.Service;
-
-import java.lang.reflect.Type;
-
-@Service
-public class ServiceDtoMapper extends ModelMapper {
-
-    public ServiceDtoMapper() {
-        this.getConfiguration().setFieldMatchingEnabled(true).setFieldAccessLevel(Configuration.AccessLevel.PRIVATE);
-        TypeMap<edu.gjoko.schedlr.entity.Service, ServiceDto> propertyMapper = this.createTypeMap(edu.gjoko.schedlr.entity.Service.class, ServiceDto.class);
-        propertyMapper.addMappings(
-                mapper -> mapper.map(service -> service.getBusiness().getCompanyName(), ServiceDto::setBusinessName)
-        );
-        propertyMapper.addMappings(
-                mapper -> mapper.map(service -> service.getServiceType().getName(), ServiceDto::setServiceName)
-        );
-        propertyMapper.addMappings(
-                mapper -> mapper.map(service -> service.getBusiness().getId(), ServiceDto::setBusinessId)
-        );
-    }
-
-    public ServiceDto serviceToServiceDto(edu.gjoko.schedlr.entity.Service service) {
-        return this.map(service, ServiceDto.class);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/repositories/AppointmentRepository.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/repositories/AppointmentRepository.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,54 +1,0 @@
-package edu.gjoko.schedlr.repositories;
-
-import edu.gjoko.schedlr.entity.Appointment;
-import edu.gjoko.schedlr.entity.Stakeholder;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.stereotype.Repository;
-
-import java.time.LocalDateTime;
-import java.util.List;
-import java.util.Optional;
-
-@Repository
-public interface AppointmentRepository extends JpaRepository<Appointment, Long> {
-
-    @Query(value = "select ap from Appointment as ap " +
-            "where ap.service.business.id = :businessId " +
-            "and ap.appointmentStatus = 'NEW'")
-    List<Appointment> getActiveAppointmentsByBusiness(Long businessId);
-
-    @Query( value = "select ap from Appointment as ap " +
-            "where ap.service.business.id = :businessId " +
-            "and (" +
-            "(ap.startTime between :startDate and :endDate) " +
-            "or (ap.endTime between :startDate and :endDate) " +
-            "or (:startDate = ap.startTime and ap.startTime = :endDate)" +
-            "or (:startDate > ap.startTime and ap.endTime > :endDate)" +
-            ")")
-    List<Appointment> findBlockingAppointments(Long businessId, LocalDateTime startDate, LocalDateTime endDate);
-
-    @Query(value = "select ap from Appointment  as ap " +
-            "where ap.service.business.owner.id = :businessOwnerId " +
-            "and ap.startTime > :now ")
-    List<Appointment> findFutureAppointmentsByBusinessOwnerId(Long businessOwnerId, LocalDateTime now);
-
-    @Query(value = "select ap from Appointment  as ap " +
-            "where ap.customer.id = :customerId " +
-            "and ap.startTime < :now")
-    List<Appointment> findPastAppointmentsByCustomerId(Long customerId, LocalDateTime now);
-
-    @Query(value = "select ap from Appointment  as ap " +
-            "where ap.service.business.owner.id = :businessOwnerId " +
-            "and ap.startTime < :now ")
-    List<Appointment> findPastAppointmentsByBusinessOwnerId(Long businessOwnerId, LocalDateTime now);
-
-    @Query(value = "select ap from Appointment  as ap " +
-            "where ap.customer.id = :customerId " +
-            "and ap.startTime > :now ")
-    List<Appointment> findFutureAppointmentsByCustomerId(Long customerId, LocalDateTime now);
-
-    Optional<Appointment> findAppointmentByIdAndCustomer_Id(Long id, Long customerId);
-
-    Optional<Appointment> findAppointmentByIdAndService_Business_Owner_Id(Long id, Long ownerId);
-}
Index: src/main/java/edu/gjoko/schedlr/repositories/BusinessRepository.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/repositories/BusinessRepository.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,20 +1,0 @@
-package edu.gjoko.schedlr.repositories;
-
-import edu.gjoko.schedlr.entity.Business;
-import edu.gjoko.schedlr.entity.BusinessStatus;
-import edu.gjoko.schedlr.entity.BusinessType;
-import edu.gjoko.schedlr.entity.Stakeholder;
-import org.hibernate.Session;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface BusinessRepository extends JpaRepository<Business, Long> {
-
-    Business findBusinessByOwner(Stakeholder owner);
-
-    Business findBusinessesByOwner_Id(Long ownerId);
-    List<Business> findBusinessesByBusinessStatusAndBusinessType_Id(BusinessStatus businessStatus, Long id);
-}
Index: src/main/java/edu/gjoko/schedlr/repositories/BusinessTypeRepository.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/repositories/BusinessTypeRepository.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,9 +1,0 @@
-package edu.gjoko.schedlr.repositories;
-
-import edu.gjoko.schedlr.entity.BusinessType;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface BusinessTypeRepository extends JpaRepository<BusinessType, Long> {
-}
Index: src/main/java/edu/gjoko/schedlr/repositories/ReviewRepository.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/repositories/ReviewRepository.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package edu.gjoko.schedlr.repositories;
-
-import edu.gjoko.schedlr.entity.Review;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface ReviewRepository extends JpaRepository<Review, Long> {
-
-
-    List<Review> findAllByAppointment_Customer_Id(Long customerId);
-
-    List<Review> findAllByAppointment_Service_Id(Long serviceId);
-}
Index: src/main/java/edu/gjoko/schedlr/repositories/ServiceRepository.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/repositories/ServiceRepository.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,19 +1,0 @@
-package edu.gjoko.schedlr.repositories;
-
-import edu.gjoko.schedlr.entity.Service;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Modifying;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface ServiceRepository extends JpaRepository<Service, Long> {
-
-    @Query(value = "select s from Service as s " +
-            " where (s.serviceType.name like CONCAT('%', :keyword, '%') " +
-            " or s.description like CONCAT('%', :keyword, '%'))" +
-            " and s.serviceStatus = 'ACTIVE'")
-    List<Service> getServicesByKeyword(String keyword);
-}
Index: src/main/java/edu/gjoko/schedlr/repositories/ServiceTypeRepository.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/repositories/ServiceTypeRepository.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,19 +1,0 @@
-package edu.gjoko.schedlr.repositories;
-
-import edu.gjoko.schedlr.entity.Service;
-import edu.gjoko.schedlr.entity.ServiceType;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface ServiceTypeRepository extends JpaRepository<ServiceType, Long> {
-
-    List<ServiceType> findAllByBusinessType_Id(Long businessTypeId);
-
-    @Query(value = "select b.businessType.serviceTypes from Business as b " +
-            " where b.owner.id = :ownerId")
-    List<ServiceType> findAppropriateBusinessTypesForBusinessByOwnerId(Long ownerId);
-}
Index: src/main/java/edu/gjoko/schedlr/services/AppointmentsService.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/services/AppointmentsService.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,109 +1,0 @@
-package edu.gjoko.schedlr.services;
-
-import edu.gjoko.schedlr.dto.AppointmentInfoDto;
-import edu.gjoko.schedlr.entity.*;
-import edu.gjoko.schedlr.exceptions.BlockingTimeException;
-import edu.gjoko.schedlr.mappers.AppointmentInfoDtoBusinessMapper;
-import edu.gjoko.schedlr.mappers.AppointmentInfoDtoCustomerMapper;
-import edu.gjoko.schedlr.repositories.AppointmentRepository;
-import edu.gjoko.schedlr.repositories.ServiceRepository;
-import edu.gjoko.schedlr.repositories.StakeholderRepository;
-import lombok.AllArgsConstructor;
-import org.springframework.stereotype.Service;
-
-import javax.persistence.EntityNotFoundException;
-import javax.security.sasl.AuthenticationException;
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-
-@Service
-@AllArgsConstructor
-public class AppointmentsService {
-
-    private final AppointmentRepository appointmentRepository;
-    private final StakeholderRepository stakeholderRepository;
-    private final ServiceRepository serviceRepository;
-    private final AppointmentInfoDtoBusinessMapper appointmentInfoDtoBusinessMapper;
-    private final AppointmentInfoDtoCustomerMapper appointmentInfoDtoCustomerMapper;
-
-
-    public void saveAppointment(Appointment appointment) {
-        var service = serviceRepository.findById(appointment.getService().getId()).get();
-
-        // remove 1 minute in order to prevent overlapping
-        appointment.setEndTime(appointment.getStartTime().plusMinutes(service.getDuration() - 1));
-        List<Appointment> blockingAppointments = appointmentRepository.
-                findBlockingAppointments(
-                        appointment.getService().getBusiness().getId(), appointment.getStartTime(), appointment.getEndTime());
-
-        // check to see if there are blocking exceptions
-        if (blockingAppointments != null && !blockingAppointments.isEmpty()) {
-            throw new BlockingTimeException();
-        }
-        appointmentRepository.save(appointment);
-    }
-
-    public List<AppointmentInfoDto> getFutureAppointmentInfoList(Long stakeholderId) {
-        StakeholderType type = stakeholderRepository.findById(stakeholderId).get().getStakeholderType();
-        List<AppointmentInfoDto> appointmentInfoDtoList = new ArrayList<>();
-
-        switch (type) {
-            case BUSINESS_OWNER -> appointmentInfoDtoList = appointmentRepository.findFutureAppointmentsByBusinessOwnerId(stakeholderId, LocalDateTime.now())
-                    .stream()
-                    .map(appointmentInfoDtoBusinessMapper::appointmentToAppointmentInfoDto)
-                    .toList();
-            case CUSTOMER -> appointmentInfoDtoList = appointmentRepository.findFutureAppointmentsByCustomerId(stakeholderId, LocalDateTime.now())
-                    .stream()
-                    .map(appointmentInfoDtoCustomerMapper::appointmentToAppointmentInfoDto)
-                    .toList();
-        }
-
-        return appointmentInfoDtoList;
-    }
-
-    public List<AppointmentInfoDto> getPastAppointmentInfoList(Long stakeholderId) {
-        StakeholderType type = stakeholderRepository.findById(stakeholderId).get().getStakeholderType();
-        List<Appointment> appointmentInfoDtoList = new ArrayList<>();
-
-        switch (type) {
-            case BUSINESS_OWNER -> appointmentInfoDtoList = appointmentRepository.findPastAppointmentsByBusinessOwnerId(stakeholderId, LocalDateTime.now());
-            case CUSTOMER -> appointmentInfoDtoList = appointmentRepository.findPastAppointmentsByCustomerId(stakeholderId, LocalDateTime.now());
-        }
-
-        return appointmentInfoDtoList
-                .stream()
-                .map(appointmentInfoDtoBusinessMapper::appointmentToAppointmentInfoDto)
-                .toList();
-
-    }
-
-    public List<Appointment> getActiveAppointmentsByBusiness(Long businessId) {
-        return appointmentRepository.getActiveAppointmentsByBusiness(businessId);
-    }
-
-    public void deleteAppointment(Long appointmentId, Long stakeholderId) throws AuthenticationException {
-        Optional<Stakeholder> stakeholderOptional = stakeholderRepository.findById(stakeholderId);
-        if (stakeholderOptional.isPresent()) {
-            Optional<Appointment> optional = appointmentRepository.findAppointmentByIdAndCustomer_Id(appointmentId, stakeholderId);
-            if (optional.isEmpty()) {
-                optional = appointmentRepository.findAppointmentByIdAndService_Business_Owner_Id(appointmentId, stakeholderId);
-                if (optional.isEmpty()) {
-                    throw new EntityNotFoundException("No appointment was found for the give stakeholder and appointment id.");
-                } else {
-                    softDeleteAppointment(optional.get(), AppointmentStatus.CANCELLED_BY_BUSINESS_OWNER);
-                }
-            } else {
-                softDeleteAppointment(optional.get(), AppointmentStatus.CANCELLED_BY_CUSTOMER);
-            }
-        } else {
-            throw new AuthenticationException();
-        }
-    }
-
-    public void softDeleteAppointment(Appointment appointment, AppointmentStatus appointmentStatus) {
-        appointment.setAppointmentStatus(appointmentStatus);
-        appointmentRepository.save(appointment);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/services/BusinessService.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/services/BusinessService.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,64 +1,0 @@
-package edu.gjoko.schedlr.services;
-
-import edu.gjoko.schedlr.entity.Business;
-import edu.gjoko.schedlr.entity.Stakeholder;
-import edu.gjoko.schedlr.entity.StakeholderType;
-import edu.gjoko.schedlr.repositories.BusinessRepository;
-import lombok.AllArgsConstructor;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-import static edu.gjoko.schedlr.entity.BusinessStatus.ACTIVE;
-import static edu.gjoko.schedlr.entity.BusinessStatus.NEW;
-
-@Service
-@AllArgsConstructor
-public class BusinessService {
-
-    private final BusinessRepository businessRepository;
-    private final ServicesService servicesService;
-    private final StakeholderService stakeholderService;
-    private BCryptPasswordEncoder bCryptPasswordEncoder;
-
-    public void saveBusiness(Business business) {
-        servicesService.saveNewServiceTypes(business);
-        business.getOwner().setStakeholderType(StakeholderType.BUSINESS_OWNER);
-        business.getOwner().setPassword(bCryptPasswordEncoder.encode(business.getOwner().getPassword()));
-        business.setBusinessStatus(NEW);
-        businessRepository.save(business);
-    }
-
-    public List<Business> findAll() {
-        return businessRepository.findAll();
-    }
-
-    public void updateBusinesses(List<Business> businessList, Long businessOwnerId) {
-        businessList
-                .stream()
-                .forEach(business -> {
-                    stakeholderService.saveOrUpdateStakeholder(business.getOwner(), businessOwnerId);
-                });
-    }
-
-    public void updateBusinessStatuses(List<Business> businessList) {
-        businessList
-                .stream()
-                .forEach(business -> {
-                    Business business1 = businessRepository.findById(business.getId()).get();
-                    business1.setBusinessStatus(business.getBusinessStatus());
-                    businessRepository.save(business1);
-                });
-    }
-
-    public Business findByOwner(Long ownerId) {
-        var owner = new Stakeholder();
-        owner.setId(ownerId);
-        return businessRepository.findBusinessByOwner(owner);
-    }
-
-    public List<Business> findByBusinessTypeAndActiveStatus(Long businessTypeId) {
-        return businessRepository.findBusinessesByBusinessStatusAndBusinessType_Id(ACTIVE, businessTypeId);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/services/NomenclaturesService.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/services/NomenclaturesService.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,27 +1,0 @@
-package edu.gjoko.schedlr.services;
-
-import edu.gjoko.schedlr.entity.BusinessType;
-import edu.gjoko.schedlr.entity.ServiceType;
-import edu.gjoko.schedlr.repositories.BusinessTypeRepository;
-import edu.gjoko.schedlr.repositories.ServiceTypeRepository;
-import lombok.AllArgsConstructor;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-@AllArgsConstructor
-public class NomenclaturesService {
-
-    private final BusinessTypeRepository businessTypeRepository;
-
-    private final ServiceTypeRepository serviceTypeRepository;
-
-    public List<BusinessType> getBusinessTypes () {
-        return businessTypeRepository.findAll();
-    }
-
-    public List<ServiceType> findAppropriateBusinessTypesForBusinessByOwnerId(Long ownerId) {
-        return serviceTypeRepository.findAppropriateBusinessTypesForBusinessByOwnerId(ownerId);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/services/PostgresUserDetailsService.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/services/PostgresUserDetailsService.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ src/main/java/edu/gjoko/schedlr/services/PostgresUserDetailsService.java	(revision cf9cdbf9e2bef95a0adc1db2bc845ef45bf080d8)
@@ -1,11 +1,6 @@
 package edu.gjoko.schedlr.services;
 
-import edu.gjoko.schedlr.entity.Business;
-import edu.gjoko.schedlr.entity.BusinessStatus;
 import edu.gjoko.schedlr.entity.Stakeholder;
-import edu.gjoko.schedlr.entity.StakeholderType;
-import edu.gjoko.schedlr.repositories.BusinessRepository;
 import edu.gjoko.schedlr.repositories.StakeholderRepository;
-import lombok.RequiredArgsConstructor;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.authority.SimpleGrantedAuthority;
@@ -20,31 +15,21 @@
 
 @Service
-@RequiredArgsConstructor
 public class PostgresUserDetailsService implements UserDetailsService {
 
     private final StakeholderRepository stakeholderRepository;
-    private final BusinessRepository businessRepository;
+
+    public PostgresUserDetailsService(StakeholderRepository stakeholderRepository) {
+        this.stakeholderRepository = stakeholderRepository;
+    }
 
     @Override
     public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
         Stakeholder user = stakeholderRepository.findStakeholderByUsername(username);
-        if (user == null) {
+        if(user == null) {
             throw new UsernameNotFoundException("Non existing user");
-        }
-
-        if (user.getStakeholderType() == StakeholderType.BUSINESS_OWNER) {
-            Business business = businessRepository.findBusinessByOwner(user);
-            if (business.getBusinessStatus() != BusinessStatus.ACTIVE) {
-                throw new SecurityException("User not approved by admin");
-            }
         }
         Set<GrantedAuthority> grantedAuthorities = new HashSet<>();
         grantedAuthorities.add(new SimpleGrantedAuthority(user.getStakeholderType().name()));
-
         return new User(user.getUsername(), user.getPassword(), grantedAuthorities);
     }
-
-    public Long loadStakeholderId(String username) {
-        return stakeholderRepository.findStakeholderByUsername(username).getId();
-    }
 }
Index: src/main/java/edu/gjoko/schedlr/services/ReviewService.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/services/ReviewService.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,57 +1,0 @@
-package edu.gjoko.schedlr.services;
-
-import edu.gjoko.schedlr.entity.Appointment;
-import edu.gjoko.schedlr.entity.AppointmentStatus;
-import edu.gjoko.schedlr.entity.Review;
-import edu.gjoko.schedlr.repositories.AppointmentRepository;
-import edu.gjoko.schedlr.repositories.ReviewRepository;
-import lombok.AllArgsConstructor;
-import org.springframework.stereotype.Service;
-
-import javax.persistence.EntityNotFoundException;
-import java.util.List;
-import java.util.Optional;
-
-@Service
-@AllArgsConstructor
-public class ReviewService {
-
-    private final ReviewRepository reviewRepository;
-    private final AppointmentRepository appointmentRepository;
-
-    public void save(Review review, Long customerId) {
-        Optional<Appointment> appointmentOptional = appointmentRepository.findById(review.getAppointment().getId());
-        if (appointmentOptional.isEmpty()) {
-            throw new EntityNotFoundException();
-        }
-        Appointment appointment = appointmentOptional.get();
-        if (appointment.getCustomer().getId().equals(customerId)) {
-            review.setAppointment(appointment);
-            markAppointmentAsReviewed(review.getAppointment());
-            calculateAndUpdateCumulatedRatingForService(appointment.getService(), review.getRating());
-            reviewRepository.save(review);
-        } else {
-            throw new EntityNotFoundException();
-        }
-    }
-
-    public List<Review> getReviewsByServiceId(Long businessId) {
-        return reviewRepository.findAllByAppointment_Service_Id(businessId);
-    }
-
-    public List<Review> getReviewsByCustomerId(Long customerId) {
-        return reviewRepository.findAllByAppointment_Customer_Id(customerId);
-    }
-
-    private void markAppointmentAsReviewed(Appointment appointment) {
-        appointment.setAppointmentStatus(AppointmentStatus.FINISHED_AND_REVIEWED_BY_USER);
-    }
-
-    private void calculateAndUpdateCumulatedRatingForService(edu.gjoko.schedlr.entity.Service service, int rating) {
-        int newReviewsCount = service.getReviewsCount() + 1;
-        float currentRating = service.getRating();
-        float newRating = (currentRating * service.getReviewsCount() + rating) / newReviewsCount;
-        service.setReviewsCount(newReviewsCount);
-        service.setRating(newRating);
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/services/ServicesService.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/services/ServicesService.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,76 +1,0 @@
-package edu.gjoko.schedlr.services;
-
-import edu.gjoko.schedlr.entity.Business;
-import edu.gjoko.schedlr.entity.ServiceStatus;
-import edu.gjoko.schedlr.entity.ServiceType;
-import edu.gjoko.schedlr.repositories.BusinessRepository;
-import edu.gjoko.schedlr.repositories.ServiceRepository;
-import edu.gjoko.schedlr.repositories.ServiceTypeRepository;
-import lombok.AllArgsConstructor;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import javax.transaction.Transactional;
-import java.util.List;
-import java.util.Optional;
-
-@Service
-@AllArgsConstructor
-public class ServicesService {
-
-    private final ServiceRepository serviceRepository;
-    private final ServiceTypeRepository serviceTypeRepository;
-    private final BusinessRepository businessRepository;
-
-    @Transactional
-    public void deleteByIds(List<Long> ids) {
-        ids.forEach(this::deactivateService);
-    }
-
-    public List<edu.gjoko.schedlr.entity.Service> getServicesByKeyword(String keyword) {
-        return serviceRepository.getServicesByKeyword(keyword);
-    }
-
-    public void saveOrUpdateServices(List<edu.gjoko.schedlr.entity.Service> serviceList, Long ownerId) {
-        if (!CollectionUtils.isEmpty(serviceList)) {
-            serviceList.forEach( service -> {
-                Optional<edu.gjoko.schedlr.entity.Service> foundOptional;
-                if (service.getId() != null && (foundOptional = serviceRepository.findById(service.getId())).isPresent()) {
-                    var found = foundOptional.get();
-                    found.setDuration(service.getDuration());
-                    found.setPrice(service.getPrice());
-                    found.setServiceStatus(ServiceStatus.ACTIVE);
-                    found.setDescription(service.getDescription());
-                    serviceRepository.save(found);
-                } else {
-                    var business = businessRepository.findBusinessesByOwner_Id(ownerId);
-                    service.getServiceType().setBusinessType(business.getBusinessType());
-                    service.setServiceStatus(ServiceStatus.ACTIVE);
-                    service.setBusiness(business);
-                    serviceTypeRepository.save(service.getServiceType());
-                    serviceRepository.save(service);
-                }
-            });
-        }
-    }
-
-    public void saveNewServiceTypes(Business business) {
-        business.getServices()
-                .forEach(service -> {
-                    if (service.getServiceType().getId() == null) {
-                        ServiceType serviceType = service.getServiceType();
-                        serviceType.setBusinessType(business.getBusinessType());
-                        service.setServiceType(serviceTypeRepository.save(serviceType));
-                    }
-                });
-    }
-
-    private void deactivateService(Long id) {
-        Optional<edu.gjoko.schedlr.entity.Service> serviceOptional;
-        if((serviceOptional = serviceRepository.findById(id)).isPresent()) {
-            var service = serviceOptional.get();
-            service.setServiceStatus(ServiceStatus.INACTIVE);
-            serviceRepository.save(service);
-        }
-    }
-}
Index: src/main/java/edu/gjoko/schedlr/services/StakeholderService.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/services/StakeholderService.java	(revision 943857ccadc5bd0933c2bd0b003629ae75c29b17)
+++ 	(revision )
@@ -1,36 +1,0 @@
-package edu.gjoko.schedlr.services;
-
-import edu.gjoko.schedlr.entity.Stakeholder;
-import edu.gjoko.schedlr.entity.StakeholderType;
-import edu.gjoko.schedlr.repositories.StakeholderRepository;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.stereotype.Service;
-
-@Service
-@RequiredArgsConstructor
-public class StakeholderService {
-
-    private final StakeholderRepository stakeholderRepository;
-    private final BCryptPasswordEncoder bCryptPasswordEncoder;
-
-    public void saveStakeholder(Stakeholder stakeholder) {
-        stakeholder.setPassword(bCryptPasswordEncoder.encode(stakeholder.getPassword()));
-        stakeholder.setStakeholderType(StakeholderType.CUSTOMER);
-        stakeholderRepository.save(stakeholder);
-    }
-
-    public Stakeholder findById(Long id) {
-        return stakeholderRepository.findById(id).get();
-    }
-
-    public void saveOrUpdateStakeholder(Stakeholder stakeholder, Long businessOwnerId) {
-        var found = stakeholderRepository.findById(businessOwnerId).get();
-        found.setFirstName(stakeholder.getFirstName());
-        found.setLastName(stakeholder.getLastName());
-        found.setPhoneNumber(stakeholder.getPhoneNumber());
-        found.setEmail(stakeholder.getEmail());
-        found.setUsername(stakeholder.getUsername());
-        stakeholderRepository.save(found);
-    }
-}
