/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gnd.persistence.remote.firestore.schema;

import androidx.annotation.Nullable;
import com.google.firebase.firestore.GeoPoint;
import com.google.firebase.firestore.IgnoreExtraProperties;

/** Feature entity stored in Firestore. */
@IgnoreExtraProperties
class FeatureDocument {
  @Nullable private String layerId;
  @Nullable private String customId;
  @Nullable private String caption;
  // TODO: Replace with consistent name throughout.
  @Nullable private GeoPoint location;
  @Nullable private AuditInfoNestedObject created;
  @Nullable private AuditInfoNestedObject lastModified;

  @SuppressWarnings("unused")
  public FeatureDocument() {}

  @SuppressWarnings("unused")
  FeatureDocument(
      @Nullable String layerId,
      @Nullable String customId,
      @Nullable String caption,
      @Nullable GeoPoint location,
      @Nullable AuditInfoNestedObject created,
      @Nullable AuditInfoNestedObject lastModified) {
    this.layerId = layerId;
    this.customId = customId;
    this.caption = caption;
    this.location = location;
    this.created = created;
    this.lastModified = lastModified;
  }

  @Nullable
  public String getLayerId() {
    return layerId;
  }

  @Nullable
  public String getCustomId() {
    return customId;
  }

  @Nullable
  public String getCaption() {
    return caption;
  }

  @Nullable
  public GeoPoint getLocation() {
    return location;
  }

  @Nullable
  public AuditInfoNestedObject getCreated() {
    return created;
  }

  @Nullable
  public AuditInfoNestedObject getLastModified() {
    return lastModified;
  }
}

@@ -1006,60 +1006,8 @@
 on;%0A
-  // TODO: Replace with consistent name throughout.%0A
   @N
@@ -1037,24 +1037,60 @@
 t location;%0A
+  @Nullable private String geoJson;%0A
   @Nullable 
@@ -1423,24 +1423,56 @@
 t location,%0A
+      @Nullable String geoJson,%0A
       @Nulla
@@ -1672,24 +1672,52 @@
 = location;%0A
+    this.geoJson = geoJson;%0A
     this.cre
@@ -2019,32 +2019,32 @@
 getLocation() %7B%0A
-
     return locat
@@ -2045,32 +2045,100 @@
  location;%0A  %7D%0A%0A
+  @Nullable%0A  public String getGeoJson() %7B%0A    return geoJson;%0A  %7D%0A%0A
   @Nullable%0A  pu

Add GeoJson attribute to FeatureDocument