package de.effigenix.domain.production;

import de.effigenix.shared.common.RepositoryError;
import de.effigenix.shared.common.Result;

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

public interface ProductionOrderRepository {

    Result<RepositoryError, Optional<ProductionOrder>> findById(ProductionOrderId id);

    Result<RepositoryError, List<ProductionOrder>> findAll();

    Result<RepositoryError, List<ProductionOrder>> findByDateRange(LocalDate from, LocalDate to);

    Result<RepositoryError, List<ProductionOrder>> findByStatus(ProductionOrderStatus status);

    Result<RepositoryError, List<ProductionOrder>> findByDateRangeAndStatus(LocalDate from, LocalDate to, ProductionOrderStatus status);

    Result<RepositoryError, Void> save(ProductionOrder productionOrder);
}
