import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.joda.time.DateTime;
public class Payment {
	protected static List<Payment> payments = new ArrayList<Payment>();
	protected Person customer;
	protected Room room;
	//private long checkInTime;
	protected DateTime checkInTime;
	protected DateTime checkOutTime;
	
	public Payment(Person customer, Room room) {
		this.customer = customer;
		this.room = room;
		payments.add(this);
	}


	public static List<Payment> getPayments()
	{
		return payments;
	}

	public Person getCustomer()
	{
		return customer;
	}
	
	public Room getRoom()
	{
		return room;
	}
	
	public String getCheckInTime()
	{
		return checkInTime.toString("HH:mm:ss") + " on " + checkInTime.toString("MMMM dd, yyyy");
	}

	public String getCheckOutTime()
	{
		return checkOutTime.toString("HH:mm:ss") + " on " + checkOutTime.toString("MMMM dd, yyyy");
	}

	public String getDuration() {
		return (checkOutTime.getMillis() - checkInTime.getMillis())/1000 + " seconds";
	}
}
