// Path: services-core/src/main/java/io/plumery/core/ActionHandler.java
// public interface ActionHandler<T extends Action>  {
//     public void handle(T action);
// }
// 
// Path: services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/denormalizer/Constant.java
// public class Constant {
//     public static final String INVENTORY_ITEMS_MAP = "inventoryItems";
// }
// 
// Path: services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/denormalizer/hazelcast/HazelcastManaged.java
// public class HazelcastManaged implements Managed {
//     private static HazelcastInstance hazelcastInstance;
// 
//     public static HazelcastInstance getInstance() {
//         if (hazelcastInstance == null) {
//             Config config = new XmlConfigBuilder().build();
//             config.setInstanceName(Thread.currentThread().getName());
// 
//             hazelcastInstance = Hazelcast.getOrCreateHazelcastInstance(config);
//         }
// 
//         return hazelcastInstance;
//     }
// 
//     @Override
//     public void start() throws Exception {
//     }
// 
//     @Override
//     public void stop() throws Exception {
//         Hazelcast.shutdownAll();
//     }
// }
// 
// Path: services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/core/EventEnvelope.java
// public class EventEnvelope {
//     public final String eventType;
//     public final Map eventData;
//     public final LocalDateTime timestamp;
// 
//     @JsonIgnore
//     public Optional<String> eventId;
// 
//     @JsonCreator
//     public EventEnvelope(
//             @JsonProperty("eventType") String eventType,
//             @JsonProperty("eventData") Map eventData,
//             @JsonProperty("timestamp") LocalDateTime timestamp) {
//         this.eventType = eventType;
//         this.eventData = eventData;
//         this.timestamp = timestamp;
//     }
// }
// 
// Path: services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/core/InventoryItemListItem.java
// @ApiModel
// public class InventoryItemListItem implements Serializable {
//     @ApiModelProperty("The id of the inventory item")
//     public String id;
//     @ApiModelProperty("The name of the inventory item")
//     public String name;
//     @ApiModelProperty("The current version of the inventory item")
//     public int version;
// }


import com.fasterxml.jackson.databind.ObjectMapper;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;
import io.plumery.core.ActionHandler;
import io.plumery.inventoryitem.api.denormalizer.Constant;
import io.plumery.inventoryitem.api.denormalizer.hazelcast.HazelcastManaged;
import io.plumery.inventoryitem.api.core.EventEnvelope;
import io.plumery.inventoryitem.api.core.InventoryItemListItem;
import io.plumery.inventoryitem.core.events.InventoryItemCreated;
import org.apache.kafka.streams.processor.AbstractProcessor;
package io.plumery.inventoryitem.api.denormalizer.handler;


public class InventoryItemCreatedHandler extends AbstractProcessor<String, EventEnvelope>
        implements ActionHandler<InventoryItemCreated> {
    private final ObjectMapper mapper;
    private final HazelcastInstance hazelcastInstance;

    public InventoryItemCreatedHandler() {
        this.mapper = new ObjectMapper();
        this.hazelcastInstance = HazelcastManaged.getInstance();
    }

// Path: services-core/src/main/java/io/plumery/core/ActionHandler.java
// public interface ActionHandler<T extends Action>  {
//     public void handle(T action);
// }
// 
// Path: services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/denormalizer/Constant.java
// public class Constant {
//     public static final String INVENTORY_ITEMS_MAP = "inventoryItems";
// }
// 
// Path: services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/denormalizer/hazelcast/HazelcastManaged.java
// public class HazelcastManaged implements Managed {
//     private static HazelcastInstance hazelcastInstance;
// 
//     public static HazelcastInstance getInstance() {
//         if (hazelcastInstance == null) {
//             Config config = new XmlConfigBuilder().build();
//             config.setInstanceName(Thread.currentThread().getName());
// 
//             hazelcastInstance = Hazelcast.getOrCreateHazelcastInstance(config);
//         }
// 
//         return hazelcastInstance;
//     }
// 
//     @Override
//     public void start() throws Exception {
//     }
// 
//     @Override
//     public void stop() throws Exception {
//         Hazelcast.shutdownAll();
//     }
// }
// 
// Path: services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/core/EventEnvelope.java
// public class EventEnvelope {
//     public final String eventType;
//     public final Map eventData;
//     public final LocalDateTime timestamp;
// 
//     @JsonIgnore
//     public Optional<String> eventId;
// 
//     @JsonCreator
//     public EventEnvelope(
//             @JsonProperty("eventType") String eventType,
//             @JsonProperty("eventData") Map eventData,
//             @JsonProperty("timestamp") LocalDateTime timestamp) {
//         this.eventType = eventType;
//         this.eventData = eventData;
//         this.timestamp = timestamp;
//     }
// }
// 
// Path: services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/core/InventoryItemListItem.java
// @ApiModel
// public class InventoryItemListItem implements Serializable {
//     @ApiModelProperty("The id of the inventory item")
//     public String id;
//     @ApiModelProperty("The name of the inventory item")
//     public String name;
//     @ApiModelProperty("The current version of the inventory item")
//     public int version;
// }


// Path: services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/denormalizer/handler/InventoryItemCreatedHandler.java
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;
import io.plumery.core.ActionHandler;
import io.plumery.inventoryitem.api.denormalizer.Constant;
import io.plumery.inventoryitem.api.denormalizer.hazelcast.HazelcastManaged;
import io.plumery.inventoryitem.api.core.EventEnvelope;
import io.plumery.inventoryitem.api.core.InventoryItemListItem;
import io.plumery.inventoryitem.core.events.InventoryItemCreated;
import org.apache.kafka.streams.processor.AbstractProcessor;

package io.plumery.inventoryitem.api.denormalizer.handler;


public class InventoryItemCreatedHandler extends AbstractProcessor<String, EventEnvelope>
        implements ActionHandler<InventoryItemCreated> {
    private final ObjectMapper mapper;
    private final HazelcastInstance hazelcastInstance;

    public InventoryItemCreatedHandler() {
        this.mapper = new ObjectMapper();
        this.hazelcastInstance = HazelcastManaged.getInstance();
    }

    @Override