// Path: warehouse-model/src/main/java/warehouse/PaletteLabel.java
// @Value
// public class PaletteLabel {
//     private final String id;
//     private final String refNo;
// 
//     @Override
//     public String toString() {
//         return id;
//     }
// }
// 
// Path: warehouse-model/src/main/java/warehouse/locations/Location.java
// @Value
// public class Location {
//     private final String location;
// 
//     public static Location production() {
//         return new Location("production");
//     }
// 
//     public static Location quarantine() {
//         return new Location("quarantine");
//     }
// 
//     public static Location onTheMove(String user) {
//         return new Location("picked by " + user);
//     }
// 
//     public static Location unknown() {
//         return new Location("<unknown>");
//     }
// }
// 
// Path: warehouse-model/src/main/java/warehouse/locations/PreferredLocationPicker.java
// public interface PreferredLocationPicker {
//     Location suggestFor(String refNo);
// }
// 
// Path: warehouse-model/src/main/java/warehouse/quality/Destroyed.java
// @Value
// public class Destroyed {
//     private final PaletteLabel paletteLabel;
// }
// 
// Path: warehouse-model/src/main/java/warehouse/quality/Locked.java
// @Value
// public class Locked {
//     private final PaletteLabel paletteLabel;
// }


import lombok.AllArgsConstructor;
import lombok.Data;
import warehouse.PaletteLabel;
import warehouse.locations.Location;
import warehouse.locations.PreferredLocationPicker;
import warehouse.quality.Destroyed;
import warehouse.quality.Locked;
import java.time.Clock;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
        stock.remove(event.getPaletteLabel());
    }

    public Location getLocation(PaletteLabel paletteLabel) {
        if (stock.containsKey(paletteLabel)) {
            return stock.get(paletteLabel).getCurrentLocation();
        } else {
            return Location.unknown();
        }
    }

    protected void apply(Registered event) {
        stock.put(event.getPaletteLabel(), new PaletteInformation(event));
    }

    protected void apply(Picked event) {
        stock.get(event.getPaletteLabel())
                .setCurrentLocation(event.getOnTheMoveLocation());
    }

    protected void apply(Stored event) {
        stock.get(event.getPaletteLabel())
                .setCurrentLocation(event.getLocation());
    }

    protected void apply(Locked event) {
    }

    @Data
    protected class PaletteInformation {
// Path: warehouse-model/src/main/java/warehouse/PaletteLabel.java
// @Value
// public class PaletteLabel {
//     private final String id;
//     private final String refNo;
// 
//     @Override
//     public String toString() {
//         return id;
//     }
// }
// 
// Path: warehouse-model/src/main/java/warehouse/locations/Location.java
// @Value
// public class Location {
//     private final String location;
// 
//     public static Location production() {
//         return new Location("production");
//     }
// 
//     public static Location quarantine() {
//         return new Location("quarantine");
//     }
// 
//     public static Location onTheMove(String user) {
//         return new Location("picked by " + user);
//     }
// 
//     public static Location unknown() {
//         return new Location("<unknown>");
//     }
// }
// 
// Path: warehouse-model/src/main/java/warehouse/locations/PreferredLocationPicker.java
// public interface PreferredLocationPicker {
//     Location suggestFor(String refNo);
// }
// 
// Path: warehouse-model/src/main/java/warehouse/quality/Destroyed.java
// @Value
// public class Destroyed {
//     private final PaletteLabel paletteLabel;
// }
// 
// Path: warehouse-model/src/main/java/warehouse/quality/Locked.java
// @Value
// public class Locked {
//     private final PaletteLabel paletteLabel;
// }


// Path: warehouse-model/src/main/java/warehouse/products/ProductStock.java
import lombok.AllArgsConstructor;
import lombok.Data;
import warehouse.PaletteLabel;
import warehouse.locations.Location;
import warehouse.locations.PreferredLocationPicker;
import warehouse.quality.Destroyed;
import warehouse.quality.Locked;
import java.time.Clock;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

        stock.remove(event.getPaletteLabel());
    }

    public Location getLocation(PaletteLabel paletteLabel) {
        if (stock.containsKey(paletteLabel)) {
            return stock.get(paletteLabel).getCurrentLocation();
        } else {
            return Location.unknown();
        }
    }

    protected void apply(Registered event) {
        stock.put(event.getPaletteLabel(), new PaletteInformation(event));
    }

    protected void apply(Picked event) {
        stock.get(event.getPaletteLabel())
                .setCurrentLocation(event.getOnTheMoveLocation());
    }

    protected void apply(Stored event) {
        stock.get(event.getPaletteLabel())
                .setCurrentLocation(event.getLocation());
    }

    protected void apply(Locked event) {
    }

    @Data
    protected class PaletteInformation {
        private final Registered init;