src/main/java/com/property/manager/data/service/AuthService.java
public ResponseEntity<?> register(ClientDTO clientDTO) {
        ClientEntity clientEntityWithSameUsername = clientRepository.findByUsernameAndRemovedIsFalse(clientDTO.getUsername());
        if (clientEntityWithSameUsername != null)
            return new ResponseEntity<>(messageSource.getMessage(client_username_exists, null, null), HttpStatus.BAD_REQUEST);

        ClientMapper clientMapper = new ClientMapper(new BCryptPasswordEncoder());
        ClientEntity clientEntity = clientMapper.toEntity(clientDTO);
        clientRepository.save(clientEntity);

        return new ResponseEntity<>(clientDTO, HttpStatus.OK);
    }
/**
     * Register in platform
     *
     * @param clientDTO - OK status code
     */
Register in platform
@param clientDTO - OK status code
Register in platform @param clientDTO - OK status code
public ResponseEntity<?> register(ClientDTO clientDTO) {
        ClientEntity clientEntityWithSameUsername = clientRepository.findByUsernameAndRemovedIsFalse(clientDTO.getUsername());
        if (clientEntityWithSameUsername != null)
            return new ResponseEntity<>(messageSource.getMessage(client_username_exists, null, null), HttpStatus.BAD_REQUEST);
        ClientMapper clientMapper = new ClientMapper(new BCryptPasswordEncoder());
        ClientEntity clientEntity = clientMapper.toEntity(clientDTO);
        clientRepository.save(clientEntity);
        return new ResponseEntity<>(clientDTO, HttpStatus.OK);
    }
public ResponseEntity < ? > register ( ClientDTO clientDTO ) { ClientEntity clientEntityWithSameUsername = clientRepository . findByUsernameAndRemovedIsFalse ( clientDTO . getUsername ( ) ) ; if ( clientEntityWithSameUsername != null ) return new ResponseEntity < > ( messageSource . getMessage ( client_username_exists , null , null ) , HttpStatus . BAD_REQUEST ) ; ClientMapper clientMapper = new ClientMapper ( new BCryptPasswordEncoder ( ) ) ; ClientEntity clientEntity = clientMapper . toEntity ( clientDTO ) ; clientRepository . save ( clientEntity ) ; return new ResponseEntity < > ( clientDTO , HttpStatus . OK ) ; }
Register in platform
 @param clientDTO - OK status code
Register in platform @param clientDTO - OK status code