package uk.ac.ebi.spot.goci.service;

import uk.ac.ebi.spot.goci.model.Association;
import uk.ac.ebi.spot.goci.model.ValidationError;

import java.util.Collection;

/**
 * Created by emma on 01/04/2016.
 *
 * @author emma
 *         <p>
 *         Interface that defines method(s) to run error ckecking of an association and then return a collection of
 *         errors.
 */
public interface AssociationCheckingService {
    Collection<ValidationError> runChecks(Association association, ValidationChecksBuilder validationChecksBuilder);

    /**
     * Check if association is an OR or BETA type association
     *
     * @param association Association to check
     */
    default String determineIfAssociationIsOrType(Association association) {

        String effectType = "none";
        if (association.getBetaNum() != null) {
            effectType = "beta";
        }
        else {
            if (association.getOrPerCopyNum() != null) {
                effectType = "or";
            }
        }
        return effectType;
    }
}

@@ -810,12 +810,17 @@
 .get
-Beta
+OrPerCopy
 Num(
@@ -862,12 +862,10 @@
  = %22
-beta
+or
 %22;%0A 
@@ -915,33 +915,28 @@
 ociation.get
-OrPerCopy
+Beta
 Num() != nul
@@ -962,34 +962,36 @@
   effectType = %22
-or
+beta
 %22;%0A            %7D

Update determine association type method