class AuthorisationStageCheckValidator {

    public ValidationResult validate(@NotNull UpdateAuthorisationRequest updateRequest, @NotNull ScaStatus scaStatus, @NotNull AuthorisationServiceType authType) {
        if (scaStatus == RECEIVED && updateRequest.getPsuData().isEmpty()) {
            return ValidationResult.invalid(resolveErrorType(authType), SERVICE_INVALID_400);
        }

        if (scaStatus == PSUIDENTIFIED && updateRequest.getPassword() == null) {
            return ValidationResult.invalid(resolveErrorType(authType), SERVICE_INVALID_400);
        }

        if (scaStatus == PSUAUTHENTICATED && updateRequest.getAuthenticationMethodId() == null) {
            return ValidationResult.invalid(resolveErrorType(authType), SERVICE_INVALID_400);
        }

        if (scaStatus == SCAMETHODSELECTED && updateRequest.getScaAuthenticationData() == null) {
            return ValidationResult.invalid(resolveErrorType(authType), SERVICE_INVALID_400);
        }

        return ValidationResult.valid();
    }

}