package oasis.model.applications.v2;

import java.util.ArrayList;
import java.util.List;

import oasis.model.annotations.Id;

public abstract class CatalogEntry extends CommonProperties {
  @Id private String id;
  private PaymentOption payment_option;
  private List<TargetAudience> target_audience;
  private List<String> category_ids;
  private boolean visible;

  protected CatalogEntry() {
    target_audience = new ArrayList<>();
    category_ids = new ArrayList<>();
  }

  /**
   * Copy constructor.
   * <p>
   * Does not copy {@link #id} field.
   */
  protected CatalogEntry(CatalogEntry other) {
    super(other);
    payment_option = other.getPayment_option();
    target_audience = new ArrayList<>(other.getTarget_audience());
    category_ids = new ArrayList<>(other.getCategory_ids());
    visible = other.isVisible();
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public abstract EntryType getType();

  public PaymentOption getPayment_option() {
    return payment_option;
  }

  public void setPayment_option(PaymentOption payment_option) {
    this.payment_option = payment_option;
  }

  public List<TargetAudience> getTarget_audience() {
    return target_audience;
  }

  public void setTarget_audience(List<TargetAudience> target_audience) {
    this.target_audience = target_audience;
  }

  public List<String> getCategory_ids() {
    return category_ids;
  }

  public void setCategory_ids(List<String> category_ids) {
    this.category_ids = category_ids;
  }

  public boolean isVisible() {
    return visible;
  }

  public void setVisible(boolean visible) {
    this.visible = visible;
  }

  public static enum EntryType {
    APPLICATION, SERVICE
  }

  public static enum TargetAudience {
    CITIZENS, PUBLIC_BODIES, COMPANIES
  }

  public static enum PaymentOption {
    FREE, PAID
  }
}

@@ -117,16 +117,59 @@
 ions.Id;
+%0Aimport oasis.model.i18n.LocalizableString;
 %0A%0Apublic
@@ -400,16 +400,93 @@
 visible;
+%0A  private LocalizableString tos_uri;%0A  private LocalizableString policy_uri;
 %0A%0A  prot
@@ -583,24 +583,105 @@
 ayList%3C%3E();%0A
+    tos_uri = new LocalizableString();%0A    policy_uri = new LocalizableString();%0A
   %7D%0A%0A  /**%0A 
@@ -1025,24 +1025,144 @@
 sVisible();%0A
+    tos_uri = new LocalizableString(other.getTos_uri());%0A    policy_uri = new LocalizableString(other.getPolicy_uri());%0A
   %7D%0A%0A  publi
@@ -1962,24 +1962,24 @@
  visible) %7B%0A
-
     this.vis
@@ -1991,32 +1991,358 @@
 = visible;%0A  %7D%0A%0A
+  public LocalizableString getTos_uri() %7B%0A    return tos_uri;%0A  %7D%0A%0A  public void setTos_uri(LocalizableString tos_uri) %7B%0A    this.tos_uri = tos_uri;%0A  %7D%0A%0A  public LocalizableString getPolicy_uri() %7B%0A    return policy_uri;%0A  %7D%0A%0A  public void setPolicy_uri(LocalizableString policy_uri) %7B%0A    this.policy_uri = policy_uri;%0A  %7D%0A%0A
   public static 

Add tos_uri and policy_uri to catalog entries