syntax = "proto2";
package org.acme.deals;
import "kogito-index.proto";
import "kogito-types.proto";
option kogito_model = "Deals";
option kogito_id = "deals";

/* @Indexed */
message Address {
    option java_package = "org.acme.travels";
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string city = 1;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string country = 2;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string street = 3;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string zipCode = 4;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional kogito.Date testDateTime = 5;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional kogito.Instant testInstant = 6;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional kogito.Serializable testLocalDate = 7[(kogito_java_class) = "java.time.LocalDate"];
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional kogito.Serializable testLocalDateTime = 8[(kogito_java_class) = "java.time.LocalDateTime"];
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional kogito.Serializable testZonedDateTime = 9[(kogito_java_class) = "java.time.ZonedDateTime"];
}

/* @Indexed */
message Deals {
    option java_package = "org.acme.deals";
    /* @Field(index = Index.YES, store = Store.YES) @SortableField */
    optional string id = 1;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string name = 2;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string review = 3;
    optional Traveller traveller = 4;
    /* @Field(index = Index.NO, store = Store.YES) */
    optional org.kie.kogito.index.model.KogitoMetadata metadata = 5;
}

/* @Indexed */
message Traveller {
    option java_package = "org.acme.travels";
    optional Address address = 1;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string email = 2;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string firstName = 3;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string lastName = 4;
    /* @Field(index = Index.NO, store = Store.YES) @SortableField */
    optional string nationality = 5;
}