// Path: warehouse-model/src/main/java/warehouse/locations/PreferredLocationPicker.java
// public interface PreferredLocationPicker {
//     Location suggestFor(String refNo);
// }
// 
// Path: warehouse-infrastructure/src/main/java/warehouse/products/ProductStockAgent.java
// @AllArgsConstructor
// public class ProductStockAgent {
// 
//     private final String refNo;
//     private final ProductStock object;
//     private final ProductStockEventSourcingRepository.ProductStockEventsHandler events;
//     private final AgentQueue queue;
// 
//     public String getRefNo() {
//         return refNo;
//     }
// 
//     public CompletionStage<List<Object>> registerNew(RegisterNew registerNew) {
//         return queue.command(() -> object.registerNew(registerNew))
//                 .thenApply(o -> events.getLast());
//     }
// 
//     public CompletionStage<List<Object>> pick(Pick pick) {
//         return queue.command(() -> object.pick(pick))
//                 .thenApply(o -> events.getLast());
//     }
// 
//     public CompletionStage<List<Object>> store(Store store) {
//         return queue.command(() -> object.store(store))
//                 .thenApply(o -> events.getLast());
//     }
// 
//     public CompletionStage<List<Object>> delivered(Delivered event) {
//         return queue.command(() -> object.delivered(event))
//                 .thenApply(o -> events.getLast());
//     }
// 
//     public CompletionStage<Location> getLocation(PaletteLabel paletteLabel) {
//         return queue.query(() -> object.getLocation(paletteLabel));
//     }
// 
//     public Location getLocationSync(PaletteLabel paletteLabel) {
//         return queue.querySync(() -> object.getLocation(paletteLabel));
//     }
// }


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import spark.Request;
import warehouse.locations.PreferredLocationPicker;
import warehouse.products.ProductStockAgent;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
package warehouse;



/**
 * Created by michal on 20.10.2017.
 */
public class OpsSupport {

    private static final Logger PRODUCT_STOCK = LoggerFactory.getLogger("warehouse.OpsSupport.PRODUCT_STOCK");
    private static final Logger FIFO_VIEW = LoggerFactory.getLogger("warehouse.OpsSupport.FIFO_VIEW");
    private static final Logger QUALITY_REPORT = LoggerFactory.getLogger("warehouse.OpsSupport.QUALITY_REPORT");
    private static final Logger MASTER_DATA = LoggerFactory.getLogger("warehouse.OpsSupport.MASTER_DATA");

// Path: warehouse-model/src/main/java/warehouse/locations/PreferredLocationPicker.java
// public interface PreferredLocationPicker {
//     Location suggestFor(String refNo);
// }
// 
// Path: warehouse-infrastructure/src/main/java/warehouse/products/ProductStockAgent.java
// @AllArgsConstructor
// public class ProductStockAgent {
// 
//     private final String refNo;
//     private final ProductStock object;
//     private final ProductStockEventSourcingRepository.ProductStockEventsHandler events;
//     private final AgentQueue queue;
// 
//     public String getRefNo() {
//         return refNo;
//     }
// 
//     public CompletionStage<List<Object>> registerNew(RegisterNew registerNew) {
//         return queue.command(() -> object.registerNew(registerNew))
//                 .thenApply(o -> events.getLast());
//     }
// 
//     public CompletionStage<List<Object>> pick(Pick pick) {
//         return queue.command(() -> object.pick(pick))
//                 .thenApply(o -> events.getLast());
//     }
// 
//     public CompletionStage<List<Object>> store(Store store) {
//         return queue.command(() -> object.store(store))
//                 .thenApply(o -> events.getLast());
//     }
// 
//     public CompletionStage<List<Object>> delivered(Delivered event) {
//         return queue.command(() -> object.delivered(event))
//                 .thenApply(o -> events.getLast());
//     }
// 
//     public CompletionStage<Location> getLocation(PaletteLabel paletteLabel) {
//         return queue.query(() -> object.getLocation(paletteLabel));
//     }
// 
//     public Location getLocationSync(PaletteLabel paletteLabel) {
//         return queue.querySync(() -> object.getLocation(paletteLabel));
//     }
// }


// Path: warehouse-infrastructure/src/main/java/warehouse/OpsSupport.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import spark.Request;
import warehouse.locations.PreferredLocationPicker;
import warehouse.products.ProductStockAgent;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;

package warehouse;



/**
 * Created by michal on 20.10.2017.
 */
public class OpsSupport {

    private static final Logger PRODUCT_STOCK = LoggerFactory.getLogger("warehouse.OpsSupport.PRODUCT_STOCK");
    private static final Logger FIFO_VIEW = LoggerFactory.getLogger("warehouse.OpsSupport.FIFO_VIEW");
    private static final Logger QUALITY_REPORT = LoggerFactory.getLogger("warehouse.OpsSupport.QUALITY_REPORT");
    private static final Logger MASTER_DATA = LoggerFactory.getLogger("warehouse.OpsSupport.MASTER_DATA");

    public void initialisingStockForNewProduct(String refNo, PreferredLocationPicker locationPicker) {