/*
 * Copyright © 2018 Mercateo AG (http://www.mercateo.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.factcast.core.spec;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;
import lombok.NonNull;

/**
 * Defines a Specification of facts to match for a subscription.
 *
 * @author uwe.schaefer@mercateo.com
 */
@Data
public class FactSpec {

    @NonNull
    @JsonProperty
    final String ns;

    // type & aggId should probably be sets?
    @JsonProperty
    String type = null;

    @JsonProperty
    UUID aggId = null;

    @JsonProperty
    String jsFilterScript = null;

    @NonNull
    @JsonProperty
    final Map<String, String> meta = new HashMap<>();

    public FactSpec meta(@NonNull String k, @NonNull String v) {
        meta.put(k, v);
        return this;
    }

    public static FactSpec ns(String ns) {
        return new FactSpec(ns);
    }

    public FactSpec(@NonNull @JsonProperty("ns") String ns) {
        super();
        this.ns = ns;
    }
}

@@ -721,16 +721,78 @@
 .UUID;%0A%0A
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;%0A
 import c
@@ -1001,16 +1001,60 @@
 /%0A@Data%0A
+@JsonIgnoreProperties(ignoreUnknown = true)%0A
 public c

ignoreUnknown = true