package com.infinite.focus.server.activity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.infinite.focus.server.auth.Instructor;
import com.infinite.focus.server.auth.Student;

@Entity
public class Activity {

	// PK
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private long activity_id;
	private long activity_type_id;
	@Transient
	private Long student_id;
	@Transient
	private Long instructor_id;
	private Date start_date_time;
	private Date end_date_time;
	
	private long entity_id;
	
	private long watch_duration;
	
	private String mood_update_before;
    private float level_of_focus_before;
    private String mood_update_after;
    private float level_of_focus_after;
    
	@Transient
	private String video_url;
	
	@OneToOne(targetEntity = Student.class, fetch = FetchType.LAZY)
    @JoinColumn(nullable = true, name = "student_id")
	@JsonIgnore
    private Student student;
	
	@OneToOne(targetEntity = Instructor.class, fetch = FetchType.LAZY)
    @JoinColumn(nullable = true, name = "instructor_id")
	@JsonIgnore
    private Instructor instructor;

	public Activity() {
		super();
	}

	public long getActivity_id() {
		return activity_id;
	}

	public void setActivity_id(long activity_id) {
		this.activity_id = activity_id;
	}

	public long getActivity_type_id() {
		return activity_type_id;
	}

	public void setActivity_type_id(long activity_type_id) {
		this.activity_type_id = activity_type_id;
	}

	public Long getStudent_id() {
		return student_id;
	}

	public void setStudent_id(Long student_id) {
		this.student_id = student_id;
	}

	public Date getStart_date_time() {
		return start_date_time;
	}

	public void setStart_date_time(Date start_date_time) {
		this.start_date_time = start_date_time;
	}

	public Date getEnd_date_time() {
		return end_date_time;
	}

	public void setEnd_date_time(Date end_date_time) {
		this.end_date_time = end_date_time;
	}

	public long getEntity_id() {
		return entity_id;
	}

	public void setEntity_id(long entity_id) {
		this.entity_id = entity_id;
	}
	
	public long getWatch_duration() {
		return watch_duration;
	}

	public void setWatch_duration(long watch_duration) {
		this.watch_duration = watch_duration;
	}

    public String getMood_update_before() {
        return mood_update_before;
    }

    public void setMood_update_before(String mood_update_before) {
        this.mood_update_before = mood_update_before;
    }

    public float getLevel_of_focus_before() {
        return level_of_focus_before;
    }

    public void setLevel_of_focus_before(float level_of_focus_before) {
        this.level_of_focus_before = level_of_focus_before;
    }

    public String getMood_update_after() {
        return mood_update_after;
    }

    public void setMood_update_after(String mood_update_after) {
        this.mood_update_after = mood_update_after;
    }

    public float getLevel_of_focus_after() {
        return level_of_focus_after;
    }

    public void setLevel_of_focus_after(float level_of_focus_after) {
        this.level_of_focus_after = level_of_focus_after;
    }
    
	public String getVideo_url() {
		return video_url;
	}

	public void setVideo_url(String video_url) {
		this.video_url = video_url;
	}

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	public Long getInstructor_id() {
		return instructor_id;
	}

	public void setInstructor_id(Long instructor_id) {
		this.instructor_id = instructor_id;
	}

	public Instructor getInstructor() {
		return instructor;
	}

	public void setInstructor(Instructor instructor) {
		this.instructor = instructor;
	}
}
