Newer
Older
POS_for_GUI / src / resources / Customer.java
student on 5 Apr 2022 848 bytes [add]featured
package resources;
import java.util.*;

//-------------------------------------------------------------------------
// todo: add name field
public class Customer {
	private Points points;
	private Total total;
	private History history;
	private Payment payment;
	private String name; // added
	public Customer(String name) {
		points = new Points();
		total = new Total();
		history = new History(total);
		payment = new Payment(points,history);
		
		// added
		this.name = name;
	}
	public void purchase(int x) {
		this.payment.purchase(x);
	}
	public int getTotal() {
		return total.getValue();
	}
	public int getPayment() {
		return payment.getValue();
	}
	public List<Integer> getHistory() {
		return history.getValue();
	}
	public int getPoints() {
		return points.getValue();
	}
	
	// added
	public String getName() {
		return this.name;
	}
}