// Copyright 2019 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.sps.data;

/** A vendor. */
public final class Vendor {

  private final String id;
  private String firstName;
  private String lastName;
  private String email;
  private String phoneNumber;
  private Picture profilePic;
  private SaleCard businessInfo;

  public Vendor(String id, String firstName, String lastName, String email, String phoneNumber,
      Picture profilePic, SaleCard businessInfo) {
    this.id = id;
    this.firstName = firstName;
    this.lastName = lastName;
    this.email = email;
    this.phoneNumber = phoneNumber;
    this.profilePic = profilePic;
    this.businessInfo = businessInfo;
  }

  public String getId() {
    return id;
  }

  public String getFirstName() {
    return firstName;
  }

  public String getLastName() {
    return lastName;
  }

  public String getEmail() {
    return email;
  }

  public String getPhoneNumber() {
    return phoneNumber;
  }

  public Picture getProfilePic() {
    return profilePic;
  }

  public SaleCard getBusinessInfo() {
    return businessInfo;
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public void setPhoneNumber(String phoneNumber) {
    this.phoneNumber = phoneNumber;
  }

  public void setProfilePic(Picture profilePic) {
    this.profilePic = profilePic;
  }

  public void setBusinessInfo(SaleCard businessInfo) {
    this.businessInfo = businessInfo;
  }
}
@@ -612,16 +612,125 @@
 .data;%0A%0A
+import com.google.appengine.api.datastore.EmbeddedEntity;%0Aimport com.google.appengine.api.datastore.Emtity;%0A%0A
 /** A ve
@@ -1323,32 +1323,668 @@
 inessInfo;%0A  %7D%0A%0A
+  public Vendor(Entity entity) %7B%0A    this.id = entity.getKey().getName();%0A    this.firstName = entity.getProperty(%22firstName%22);%0A    this.lastName = entity.getProperty(%22lastName%22);%0A    this.email = entity.getProperty(%22email%22);%0A    this.phoneNumber = entity.getProperty(%22phoneNumber%22);%0A%0A    EmbeddedEntity embeddedPic = (EmbeddedEntity) entity.getProperty(%22profilePic%22);%0A    this.profilePic = (embeddedPic == null) : null ? new Picture(embeddedPic);%0A    EmbeddedEntity embeddedBusiness = (EmbeddedEntity) entity.getProperty(%22businessInfo%22);%0A    this.businessInfo = (embeddedBusiness == null) : null ? new SaleCard(embeddedBusiness);%0A  %7D%0A%0A
   public String 

Add Entity constructor to Vendor