package com.example.habitrack;

import java.util.Calendar;

import io.searchbox.annotations.JestId;


/**
 * HabitEvent
 *
 * Version 1.0
 *
 * Created by sshussai on 10/21/17.
 *
 */



public class HabitEvent {
    /**
     * Version 1.0
     * This class is the template for a habit event entity.
     *
     */

    private final Integer habitEventID;         // ID for the event
    private final Integer habitTypeID;          // ID for the corresponding habit type
    private String title;                       // title of the habit event
    private String comment;                     // comment for the habit event
    private Calendar date;                      // date of the habit event
    @JestId
    private String id;


    public HabitEvent(Integer heID, Integer htID) {
        this.habitEventID = heID;
        this.habitTypeID = htID;
        this.date = Calendar.getInstance();
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Calendar getDate() {
        return date;
    }

    public void setDate(Calendar date) {
        this.date = date;
    }

    public Integer getHabitEventID() {
        return habitEventID;
    }

    public Integer getHabitTypeID() {
        return habitTypeID;
    }

    public Boolean searchInComment(String key){
        Boolean retVal = Boolean.FALSE;
        if(this.comment.contains(key)){
            retVal = Boolean.TRUE;
        }
        return retVal;
    }

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

@@ -25,16 +25,154 @@
 track;%0A%0A
+import android.graphics.Bitmap;%0Aimport android.graphics.BitmapFactory;%0Aimport android.util.Base64;%0A%0Aimport java.io.ByteArrayOutputStream;%0A
 import j
@@ -190,16 +190,16 @@
 lendar;%0A
-
 %0Aimport 
@@ -867,16 +867,49 @@
 ing id;%0A
+    private String encodedPhoto;%0A
 %0A%0A    pu
@@ -1630,32 +1630,207 @@
 tTypeID;%0A    %7D%0A%0A
+    public String getPhoto() %7B%0A        return this.encodedPhoto;%0A    %7D%0A%0A    public void setPhoto(String newEncodedPhoto) %7B%0A        this.encodedPhoto = newEncodedPhoto;%0A    %7D%0A%0A
     public Boole
@@ -2073,16 +2073,17 @@
 d = id;%0A
-
     %7D%0A
+%0A
 %7D%0A

add code in habitevent for keeping an encoded photo