package com.royalrangers.service;

import com.royalrangers.bean.ResponseResult;
import com.royalrangers.enums.Messages;
import com.royalrangers.model.User;
import com.royalrangers.utils.ResponseBuilder;
import org.springframework.stereotype.Service;

@Service
public class LoginService {

    private Messages messages;

    public ResponseResult loginInformation(User user) {
        if (user.getConfirmed() == false) {
            return ResponseBuilder.fail(messages.NOT_CONFIRMED.getMessage());
        } else if (user.getConfirmed() == true && user.getApproved() == false) {
            return ResponseBuilder.fail(messages.NOT_APPROVED.getMessage());
        } else if (user.getEnabled() == false) {
            return ResponseBuilder.fail(messages.DENIED.getMessage());
        }
        return null;
    }
}

@@ -378,24 +378,25 @@
         if (
+!
 user.getConf
@@ -398,33 +398,24 @@
 tConfirmed()
- == false
 ) %7B%0A        
@@ -526,20 +526,13 @@
 ed()
- == true
  && 
+!
 user
@@ -541,33 +541,24 @@
 etApproved()
- == false
 ) %7B%0A        
@@ -637,32 +637,33 @@
      %7D else if (
+!
 user.getEnabled(
@@ -667,17 +667,8 @@
 ed()
- == false
 ) %7B%0A

update LoginService