/**
 * ScheduleData.java
 * Created Jun 18, 2008
 * Copyright (c) TANDBERG Television 2007-2008
 */
package com.tandbergtv.watchpoint.pmm.web.title;

import java.util.Collection;

import com.tandbergtv.watchpoint.pmm.entities.ProgressItem;
import com.tandbergtv.watchpoint.pmm.entities.Schedule;
import com.tandbergtv.watchpoint.pmm.web.schedule.PartnerBean;
import com.tandbergtv.workflow.web.util.CommonUtils;

/**
 * Contains a schedule and all the progress items for a single title
 * 
 * @author Sahil Verma
 */
public class ScheduleData {
	
	Schedule schedule;

	PartnerBean partner;

	Collection<ProgressItem> progressItems;

	/**
	 * Creates a ScheduleData
	 * @param schedule
	 * @param partner
	 */
	public ScheduleData(Schedule schedule, PartnerBean partner) {
		this.schedule = schedule;
		this.partner = partner;
	}

	/**
	 * Creates a ScheduleData
	 * @param schedule
	 * @param partner
	 * @param progressItems
	 */
	public ScheduleData(Schedule schedule, PartnerBean partner, Collection<ProgressItem> progressItems) {
		this.schedule = schedule;
		this.partner = partner;
		this.progressItems = progressItems;
	}

	public String getName() {
		return this.partner.getName();
	}
	
	public Long getId() {
		return this.partner.getId();
	}

	public String getPitchDate() {
		return CommonUtils.formatDate(this.schedule.getDate());
	}

	public String getContextId() {
		return String.valueOf(this.partner.getId());
	}

	public String getScheduleId() {
		return this.schedule.getId().toString();
	}

	/**
	 * @return the progressItems
	 */
	public Collection<ProgressItem> getProgressItems() {
		return this.progressItems;
	}
}