import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

/**
 * Reportes sobre una lista de ventas. Escriban cada método con streams.
 * Esqueleto de P4.
 */
public class SalesReport {

    public SalesReport(List<Sale> sales) {
        // por hacer: guardar una copia
    }

    public int count() {
        throw new UnsupportedOperationException("por hacer");
    }

    /** La suma de totalCents() de las ventas. */
    public long totalCents() {
        throw new UnsupportedOperationException("por hacer");
    }

    /** Un reporte nuevo con las ventas de from a to, ambos incluidos. */
    public SalesReport between(LocalDate from, LocalDate to) {
        throw new UnsupportedOperationException("por hacer");
    }

    /** Total vendido por día, ordenado por fecha. */
    public Map<LocalDate, Long> totalByDay() {
        throw new UnsupportedOperationException("por hacer");
    }

    /** Total vendido por categoría, ordenado por categoría. */
    public Map<String, Long> totalByCategory() {
        throw new UnsupportedOperationException("por hacer");
    }

    /** Los n productos que más dinero dieron; si empatan, por código. */
    public List<ProductTotal> topProducts(int n) {
        throw new UnsupportedOperationException("por hacer");
    }

    /** Unidades (o gramos) vendidas de un producto; 0 si no se vendió. */
    public long quantitySold(String code) {
        throw new UnsupportedOperationException("por hacer");
    }

    /** La venta de mayor total; si empatan, la primera. Vacío si no hay ventas. */
    public Optional<Sale> largestSale() {
        throw new UnsupportedOperationException("por hacer");
    }

    /** Clientes con al menos minSales compras, ordenados, sin el anónimo. */
    public Set<String> frequentCustomers(int minSales) {
        throw new UnsupportedOperationException("por hacer");
    }
}
