Index: src/main/java/com/example/service/AuthService.java
===================================================================
--- src/main/java/com/example/service/AuthService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/AuthService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,27 @@
+package com.example.service;
+
+import com.example.model.Catering;
+import com.example.model.User;
+
+public interface AuthService{
+    User login(String username, String password);
+
+    void registerUser(String name, String username, String number, String password,
+                      String rpassword,  String role);
+
+    void registerBand(String name, String username, String number, String password,
+                      String rpassword, String role, Integer price);
+
+    void registerCatering(String name, String username, String number, String password,
+                          String rpassword,  String role, Integer price, String address);
+
+    void registerClient(String name, String username, String number, String password,
+                        String rpassword,  String role);
+
+    void registerPhotographer(String name, String username, String number, String password,
+                              String rpassword, String role, Integer price, String portfolio);
+
+    void registerWaiter (String name, String username, String number, String password,
+                         String rpassword, String role, Integer free_day,
+                         Integer experience, Catering catering);
+}
Index: src/main/java/com/example/service/BandService.java
===================================================================
--- src/main/java/com/example/service/BandService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/BandService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,11 @@
+package com.example.service;
+
+import com.example.model.Band;
+
+import java.util.List;
+
+public interface BandService {
+
+    List<Band> findAll();
+    Band findByName(String name);
+}
Index: src/main/java/com/example/service/CateringService.java
===================================================================
--- src/main/java/com/example/service/CateringService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/CateringService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,10 @@
+package com.example.service;
+
+import com.example.model.Catering;
+
+import java.util.List;
+
+public interface CateringService {
+    List<Catering> findAll();
+    Catering findByName(String name);
+}
Index: src/main/java/com/example/service/EventService.java
===================================================================
--- src/main/java/com/example/service/EventService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/EventService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,23 @@
+package com.example.service;
+
+import com.example.model.Enumerations.Status;
+import com.example.model.Event;
+
+import java.util.List;
+import java.util.Optional;
+
+public interface EventService {
+
+    Event findById(Integer id);
+
+    List<Event> findByClient(Integer client_id);
+
+    Optional<Event> updateStatus(Integer event_id, Status status);
+
+    List<Event> findAll();
+
+    void update(Event event);
+
+
+
+}
Index: src/main/java/com/example/service/LocationService.java
===================================================================
--- src/main/java/com/example/service/LocationService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/LocationService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,10 @@
+package com.example.service;
+
+import com.example.model.Location;
+
+import java.util.List;
+
+public interface LocationService {
+    List<Location> findAll();
+    Location findByAddress(String address);
+}
Index: src/main/java/com/example/service/PhotographerService.java
===================================================================
--- src/main/java/com/example/service/PhotographerService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/PhotographerService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,10 @@
+package com.example.service;
+
+import com.example.model.Photographer;
+
+import java.util.List;
+
+public interface PhotographerService {
+    List<Photographer> findAll();
+    Photographer findByName(String name);
+}
Index: src/main/java/com/example/service/UserService.java
===================================================================
--- src/main/java/com/example/service/UserService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/UserService.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,13 @@
+package com.example.service;
+
+import com.example.model.User;
+
+import java.util.List;
+import java.util.Optional;
+
+public interface UserService {
+
+    List<User> findAllUsers();
+    Optional<User> findByUsername(String username);
+    User findById(Integer id);
+}
Index: src/main/java/com/example/service/impl/AuthServiceImpl.java
===================================================================
--- src/main/java/com/example/service/impl/AuthServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/impl/AuthServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,112 @@
+package com.example.service.impl;
+
+import com.example.exceptions.InvalidUserCredentialsException;
+import com.example.exceptions.InvalidUsernameOrPasswordException;
+import com.example.exceptions.PasswordsDoNotMatchException;
+import com.example.exceptions.UsernameAlreadyExistsException;
+import com.example.model.*;
+import com.example.model.Enumerations.Role;
+import com.example.repository.UserRepository;
+import com.example.service.AuthService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AuthServiceImpl implements AuthService {
+    private final UserRepository userRepository;
+
+    public AuthServiceImpl(UserRepository userRepository) {
+        this.userRepository = userRepository;
+    }
+
+    @Override
+    public User login(String username, String password) {
+        return userRepository.findByUsernameAndPassword(username,
+                password).orElseThrow(InvalidUserCredentialsException::new);
+    }
+
+    @Override
+    public void registerUser(String name, String username, String number, String password,
+                             String rpassword, String role) {
+        if (username == null || username.isEmpty() || password == null || password.isEmpty())
+            throw new InvalidUsernameOrPasswordException();
+        if (!password.equals(rpassword))
+            throw new PasswordsDoNotMatchException();
+        if (this.userRepository.findByUsername(username).isPresent())
+            throw new UsernameAlreadyExistsException(username);
+        userRepository.save(new User(name, username, number, password, Role.ROLE_USER));
+    }
+
+    @Override
+    public void registerBand(String name, String username, String number, String password,
+                             String rpassword, String role, Integer price) {
+        if (username == null || username.isEmpty() || password == null || password.isEmpty())
+            throw new InvalidUsernameOrPasswordException();
+        if (!password.equals(rpassword))
+            throw new PasswordsDoNotMatchException();
+        if (this.userRepository.findByUsername(username).isPresent())
+            throw new UsernameAlreadyExistsException(username);
+        userRepository.save(new Band(name, username, number, password, price, Role.ROLE_BAND));
+    }
+
+    @Override
+    public void registerCatering(String name, String username, String number, String password,
+                                 String rpassword, String role,
+                                 Integer price, String address) {
+        if (username == null || username.isEmpty() || password == null || password.isEmpty())
+            throw new InvalidUsernameOrPasswordException();
+        if (!password.equals(rpassword))
+            throw new PasswordsDoNotMatchException();
+        if (this.userRepository.findByUsername(username).isPresent())
+            throw new UsernameAlreadyExistsException(username);
+        userRepository.save(new Catering(name, username, number, password, price, address, Role.ROLE_CATERING));
+    }
+
+    @Override
+    public void registerClient(String name, String username, String number, String password,
+                               String rpassword, String role) {
+        if (username == null || username.isEmpty() || password == null || password.isEmpty())
+            throw new InvalidUsernameOrPasswordException();
+        if (!password.equals(rpassword))
+            throw new PasswordsDoNotMatchException();
+        if (this.userRepository.findByUsername(username).isPresent())
+            throw new UsernameAlreadyExistsException(username);
+        userRepository.save(new Client(name, username, number, password, Role.ROLE_CLIENT));
+    }
+
+    @Override
+    public void registerPhotographer(String name, String username, String number, String password,
+                                     String rpassword, String role, Integer price, String portfolio) {
+        if (username == null || username.isEmpty() || password == null || password.isEmpty())
+            throw new InvalidUsernameOrPasswordException();
+        if (!password.equals(rpassword))
+            throw new PasswordsDoNotMatchException();
+        if (this.userRepository.findByUsername(username).isPresent())
+            throw new UsernameAlreadyExistsException(username);
+        userRepository.save(new Photographer(name, username, number, password, price, portfolio, Role.ROLE_PHOTOGRAPHER));
+    }
+
+    @Override
+    public void registerWaiter(String name, String username, String number, String password,
+                               String rpassword, String role, Integer free_day,
+                               Integer experience, Catering catering) {
+        if (username == null || username.isEmpty() || password == null || password.isEmpty())
+            throw new InvalidUsernameOrPasswordException();
+        if (!password.equals(rpassword))
+            throw new PasswordsDoNotMatchException();
+        if (this.userRepository.findByUsername(username).isPresent())
+            throw new UsernameAlreadyExistsException(username);
+        userRepository.save(new Waiter(name, username, number, password, free_day, experience, catering, Role.ROLE_WAITER));
+    }
+
+//    @Override
+//    public void register(String name, String username, String number, String password,
+//                      String rpassword, Role role) {
+//        if (username==null || username.isEmpty()  || password==null || password.isEmpty())
+//            throw new InvalidUsernameOrPasswordException();
+//        if (!password.equals(rpassword))
+//            throw new PasswordsDoNotMatchException();
+//        if(this.userRepository.findByUsername(username).isPresent())
+//            throw new UsernameAlreadyExistsException(username);
+//        userRepository.save(new User(name, username, number, password));
+//    }
+}
Index: src/main/java/com/example/service/impl/BandServiceImpl.java
===================================================================
--- src/main/java/com/example/service/impl/BandServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/impl/BandServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,31 @@
+package com.example.service.impl;
+
+import com.example.exceptions.NoSuchUsernameException;
+import com.example.model.Band;
+import com.example.repository.BandRepository;
+import com.example.service.BandService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class BandServiceImpl implements BandService{
+
+    private final BandRepository bandRepository;
+
+    public BandServiceImpl(BandRepository bandRepository) {
+        this.bandRepository = bandRepository;
+    }
+
+    @Override
+    public List<Band> findAll() {
+        return this.bandRepository.findAll();
+    }
+
+    @Override
+    public Band findByName(String name) {
+        return this.bandRepository.findAllByName(name).stream().findFirst()
+                .orElseThrow(NoSuchUsernameException::new);
+    }
+}
+
Index: src/main/java/com/example/service/impl/CateringServiceImpl.java
===================================================================
--- src/main/java/com/example/service/impl/CateringServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/impl/CateringServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,30 @@
+package com.example.service.impl;
+
+import com.example.exceptions.NoSuchUsernameException;
+import com.example.model.Catering;
+import com.example.repository.CateringRepository;
+import com.example.service.CateringService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CateringServiceImpl implements CateringService {
+
+    private final CateringRepository cateringRepository;
+
+    public CateringServiceImpl(CateringRepository cateringRepository) {
+        this.cateringRepository = cateringRepository;
+    }
+
+    @Override
+    public List<Catering> findAll() {
+        return this.cateringRepository.findAll();
+    }
+
+    @Override
+    public Catering findByName(String name) {
+        return this.cateringRepository.findAllByName(name).stream().findFirst()
+                .orElseThrow(NoSuchUsernameException::new);
+    }
+}
Index: src/main/java/com/example/service/impl/EventServiceImpl.java
===================================================================
--- src/main/java/com/example/service/impl/EventServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/impl/EventServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,61 @@
+package com.example.service.impl;
+
+import com.example.exceptions.InvalidArgumentsException;
+import com.example.model.Client;
+import com.example.model.Enumerations.Status;
+import com.example.model.Event;
+import com.example.repository.ClientRepository;
+import com.example.repository.EventRepository;
+import com.example.repository.LocationRepository;
+import com.example.repository.UserRepository;
+import com.example.service.EventService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+
+@Service
+public class EventServiceImpl implements EventService {
+    private final EventRepository eventRepository;
+    private final ClientRepository clientRepository;
+    private final LocationRepository locationRepository;
+    private final UserRepository userRepository;
+
+    public EventServiceImpl(EventRepository eventRepository, ClientRepository clientRepository, LocationRepository locationRepository, UserRepository userRepository) {
+        this.eventRepository = eventRepository;
+        this.clientRepository = clientRepository;
+        this.locationRepository = locationRepository;
+        this.userRepository = userRepository;
+    }
+
+    @Override
+    public List<Event> findAll() {
+        return this.eventRepository.findAll();
+    }
+
+    @Override
+    public void update(Event e) {
+        eventRepository.save(e);
+    }
+
+    @Override
+    public Event findById(Integer id) {
+        return eventRepository.findById(id).get();
+    }
+
+    @Override
+    public List<Event> findByClient(Integer client_id) {
+        Optional<Client> client = clientRepository.findById(client_id);
+//        User user = userRepository.findById(user_id).get();
+//        return eventRepository.findByUser(user);
+        return eventRepository.findByClient(client);
+    }
+
+    @Override
+    public Optional<Event> updateStatus(Integer event_id, Status status) {
+        Event event = eventRepository.findById(event_id).orElseThrow(InvalidArgumentsException::new);
+        event.setStatus(status);
+        return Optional.of(eventRepository.save(event));
+    }
+
+}
Index: src/main/java/com/example/service/impl/LocationServiceImpl.java
===================================================================
--- src/main/java/com/example/service/impl/LocationServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/impl/LocationServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,30 @@
+package com.example.service.impl;
+
+import com.example.model.Location;
+import com.example.repository.LocationRepository;
+import com.example.service.LocationService;
+import org.springframework.stereotype.Service;
+import com.example.exceptions.NoSuchAddressException;
+
+import java.util.List;
+
+@Service
+public class LocationServiceImpl implements LocationService {
+
+    private final LocationRepository locationRepository;
+
+    public LocationServiceImpl(LocationRepository locationRepository) {
+        this.locationRepository = locationRepository;
+    }
+
+    @Override
+    public List<Location> findAll() {
+        return this.locationRepository.findAll();
+    }
+
+    @Override
+    public Location findByAddress(String address) {
+        return locationRepository.findAllByAddress(address).stream().findFirst()
+                .orElseThrow(() -> new NoSuchAddressException(address));
+    }
+}
Index: src/main/java/com/example/service/impl/PhotographerServiceImpl.java
===================================================================
--- src/main/java/com/example/service/impl/PhotographerServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/impl/PhotographerServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,30 @@
+package com.example.service.impl;
+
+import com.example.exceptions.NoSuchUsernameException;
+import com.example.model.Photographer;
+import com.example.repository.PhotographerRepository;
+import com.example.service.PhotographerService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PhotographerServiceImpl implements PhotographerService {
+
+    private final PhotographerRepository photographerRepository;
+
+    public PhotographerServiceImpl(PhotographerRepository photographerRepository) {
+        this.photographerRepository = photographerRepository;
+    }
+
+    @Override
+    public List<Photographer> findAll() {
+        return this.photographerRepository.findAll();
+    }
+
+    @Override
+    public Photographer findByName(String name) {
+        return this.photographerRepository.findAllByName(name).stream().findFirst()
+                .orElseThrow(NoSuchUsernameException::new);
+    }
+}
Index: src/main/java/com/example/service/impl/UserServiceImpl.java
===================================================================
--- src/main/java/com/example/service/impl/UserServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
+++ src/main/java/com/example/service/impl/UserServiceImpl.java	(revision a51a591b1eec04fb1d9d9128cf341696beef9312)
@@ -0,0 +1,37 @@
+package com.example.service.impl;
+
+import com.example.exceptions.NoSuchIDException;
+import com.example.model.User;
+import com.example.repository.UserRepository;
+import com.example.service.UserService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+
+@Service
+public class UserServiceImpl implements UserService {
+
+    private final UserRepository userRepository;
+
+    public UserServiceImpl(UserRepository userRepository) {
+        this.userRepository = userRepository;
+    }
+
+    @Override
+    public List<User> findAllUsers() {
+        return userRepository.findAll();
+    }
+
+    @Override
+    public Optional<User> findByUsername(String username) {
+
+        return userRepository.findByUsername(username);
+    }
+
+    @Override
+    public User findById(Integer id) {
+        return userRepository.findById(id).stream().findFirst()
+                .orElseThrow(() -> new NoSuchIDException(id));
+    }
+}
