package org.jboss.da.communication.pnc.model;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;

@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class BuildConfigurationBPMCreate {

    @Getter
    @Setter
    @NonNull
    private String name;

    @Getter
    @Setter
    private String description;

    @Getter
    @Setter
    private String buildScript;

    @Getter
    private String scmRepoURL;

    @Getter
    private String scmRevision;

    @Getter
    private String scmExternalRepoURL;

    @Getter
    private String scmExternalRevision;

    @Getter
    @Setter
    private Integer projectId;

    @Getter
    @Setter
    private Integer buildEnvironmentId;

    @Getter
    @Setter
    private List<Integer> dependencyIds;

    @Getter
    @Setter
    private Integer productVersionId;

    public void setEnvironmentId(int id) {
        this.buildEnvironmentId = id;
    }

    public void setSCMLocation(String repoURL, String revision) {
        if (repoURL == null) {
            repoURL = "";
        }
        if (repoURL.contains("code-stage.eng.nay.redhat.com")
                || repoURL.contains("pnc-gerrit.pnc.dev.eng.bos.redhat.com")) {
            this.scmRepoURL = repoURL;
            this.scmRevision = revision;
        } else {
            this.scmExternalRepoURL = repoURL;
            this.scmExternalRevision = revision;
        }
    }

}

@@ -57,19 +57,95 @@
 va.util.
-Lis
+ArrayList;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Se
 t;%0A%0Aimpo
@@ -948,18 +948,136 @@
 dencyIds
-;%0A
+ = new ArrayList%3C%3E();%0A%0A    @Getter%0A    @Setter%0A    private Set%3CInteger%3E buildConfigurationSetIds = new HashSet%3C%3E();%0A    
 %0A    @Ge

Fix for changed API