def is_reset_password_valid(cls,email, old_password):
        # """
        # It checks whether the credentials are valid and exist
        # :param email: user email
        # :param old_password: user entered
        # :raise: Incorrect password exception
        # :return: employee's data
        # """
        employee_data = Database.find_one(employeeConstants.COLLECTION, {'email':email})
        print(employee_data['password'])
        if not Utils.check_hashed_password(old_password, employee_data['password']):
            raise EmployeeError.IncorrectPasswordError("Password does not match")

        return cls(**employee_data)
    def is_reset_password_valid(cls, email, old_password):
        # """
        # It checks whether the credentials are valid and exist
        # :param email: user email
        # :param old_password: user entered
        # :raise: Incorrect password exception
        # :return: admins's data
        # """
        admin_data = Database.find_one(adminConstant.COLLECTION, {'email': email})
        #print(manager_data['password'])
        if not Utils.check_hashed_password(old_password, admin_data['password']):
            raise adminErrors.IncorrectPasswordError("Password does not match")

        return cls(**admin_data)
    def is_login_valid(email, password):
        # """
        # checks if the entered credentials exist in database
        # :param email: user entered
        # :param password: user entered
        # :raises: Employee not exist, incorrect password exception
        # :return: True
        # """
        employee_data = Database.find_one(employeeConstants.COLLECTION, {'email': email})

        if employee_data is None:
            raise EmployeeError.EmployeeNotExistError("You are not registered yet!")
        if not Utils.check_hashed_password(password, employee_data['password']):
            raise EmployeeError.IncorrectPasswordError("You entered wrong password!")
        return True
    def is_login_valid(email, password):
        # """
        # Checks if the entered credentials exist in database
        # :param email: user entered
        # :param password: user entered
        # :raises: Admin not exist, incorrect password exception
        # :return: True
        # """
        admin_data = Database.find_one(adminConstant.COLLECTION, {"email":email})

        if admin_data is None:
            raise adminErrors.AdminNotExistsError("You are not registered")
        if not Utils.check_hashed_password(password, admin_data['password']):
            raise adminErrors.IncorrectPasswordError("Your password is wrong")

        return True