package jp.sourceforge.glad.example.domain.sale.entity;

import jp.sourceforge.glad.example.domain.common.value.Money;
import jp.sourceforge.glad.example.domain.product.entity.ProductSpecification;

public class SalesLineItem {

	private Long id;

	private long version;

	private Sale sale;

	private ProductSpecification productSpecification;

	private Integer quantity;

	ProductSpecification getProductSpecification() {
		return productSpecification;
	}

	Integer getQuantity() {
		return quantity;
	}

	public Money getSubtotal() {
		return getProductSpecification().getPrice().multiply(getQuantity());
	}

}
