// 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;
        events.emit(event);

        if (!validation.isValid()) {
            Locked lock = new Locked(registerNew.getPaletteLabel());
            events.emit(lock);
        }
    }

    public void pick(Pick pick) {
        assert refNo.equals(pick.getPaletteLabel().getRefNo());
        Location fromLocation = stock.get(pick.getPaletteLabel()).currentLocation;
        Picked event = new Picked(pick.getPaletteLabel(), pick.getUser(),
                fromLocation, Location.onTheMove(pick.getUser()));
        apply(event);
        events.emit(event);
    }

    public void store(Store store) {
        assert refNo.equals(store.getPaletteLabel().getRefNo());
        Stored event = new Stored(
                store.getPaletteLabel(),
                store.getLocation());
        apply(event);
        events.emit(event);
    }

    public void delivered(Delivered event) {
        stock.remove(event.getPaletteLabel());
    }

// 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;

        events.emit(event);

        if (!validation.isValid()) {
            Locked lock = new Locked(registerNew.getPaletteLabel());
            events.emit(lock);
        }
    }

    public void pick(Pick pick) {
        assert refNo.equals(pick.getPaletteLabel().getRefNo());
        Location fromLocation = stock.get(pick.getPaletteLabel()).currentLocation;
        Picked event = new Picked(pick.getPaletteLabel(), pick.getUser(),
                fromLocation, Location.onTheMove(pick.getUser()));
        apply(event);
        events.emit(event);
    }

    public void store(Store store) {
        assert refNo.equals(store.getPaletteLabel().getRefNo());
        Stored event = new Stored(
                store.getPaletteLabel(),
                store.getLocation());
        apply(event);
        events.emit(event);
    }

    public void delivered(Delivered event) {
        stock.remove(event.getPaletteLabel());
    }

    public void destroyed(Destroyed event) {