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 project;

    @Getter
    @Setter
    private Integer environment;

    @Getter
    @Setter
    private List<Integer> dependencyIds;

    @Getter
    @Setter
    private Integer productVersionId;

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

    public void setProjectId(int id) {
        this.project = id;
    }

    public void setSCMLocation(String repoURL, String revision) {
        if (repoURL == null) {
            repoURL = "";
        }
        if (!repoURL.contains("code.engineering.redhat.com")
                && !repoURL.contains("git.app.eng.bos.redhat.com")) {
            this.scmExternalRepoURL = repoURL;
            this.scmExternalRevision = revision;
        } else {
            this.scmRepoURL = repoURL;
            this.scmRevision = revision;
        }
    }

}

@@ -739,16 +739,18 @@
  project
+Id
 ;%0A%0A    @
@@ -788,17 +788,22 @@
 Integer 
-e
+buildE
 nvironme
@@ -804,16 +804,18 @@
 ironment
+Id
 ;%0A%0A    @
@@ -998,92 +998,17 @@
 his.
-environment = id;%0A    %7D%0A%0A    public void setProjectId(int id) %7B%0A        this.
 project
+Id
  = i

fix wrong name of fields in BuildConfigurationBPMCreate