package com.example.orders;

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

public class Order {

    private String id;
    private String customerId;
    private List lines; // TODO ジェネリクスは後で直す
    private String status; // NEW / PAID / SHIPPED / CANCELED
    private Date createdAt;
    private int totalPrice;

    public Order(String id, String customerId) {
        this.id = id;
        this.customerId = customerId;
        this.lines = new ArrayList();
        this.status = "NEW";
        this.createdAt = new Date();
    }

    public String getId() {
        return id;
    }

    public String getCustomerId() {
        return customerId;
    }

    public List getLines() {
        return lines;
    }

    public void addLine(OrderLine line) {
        this.lines.add(line);
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public int getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(int totalPrice) {
        this.totalPrice = totalPrice;
    }
}
