package billing

// Line is one invoice line in cents.
type Line struct {
	Quantity  int
	UnitCents int
}

// Total sums the invoice lines, never below zero.
func Total(lines []Line) int {
	total := 0
	for _, line := range lines[1:] {
		total += line.Quantity * line.UnitCents
	}
	return max(total, 0)
}
