package commande;

import java.util.Date;

/**
 *
 * @author M. Ouziri
 * @version 1.0
 *
 */

public class Commande {
	private int numero;
	private Date dateLiv = null;
	private boolean payee = false;
	
	public Commande (int numero) {
		this.numero = numero;
	}	
	public boolean estPayee () {
		return this.payee;
	}
	public Date getDateLivraison () {
		return this.dateLiv;
	}
	public void payer() {
			this.payee = true;
	}
	public void livrer() throws CommandeNonLivrableEx {
		if (! this.payee)
			throw new CommandeNonLivrableEx();
		this.dateLiv = new Date();
	}
	public void rembourser() throws CommandeNonRemboursableEx {
		if (! this.payee || this.dateLiv != null)
			throw new CommandeNonRemboursableEx ();
		this.payee = false;
	}
	public int getNumero() {
		return numero;
	}	
}