package org.infinispan.rest.search.entity;

/**
 * @Indexed
 */
message Address {

  /**
   * @Text(projectable = true)
   */
  required string street = 1;

  /**
   * @Basic(projectable = true)
   */
  required string postCode = 2;
}

/**
 * @Indexed
 */
message PhoneNumber {

  /**
   * @Basic(projectable = true)
   */
  required string number = 1;
}

/**
 * @Indexed
 */
message Person {

  /**
   * @Basic(projectable = true)
   */
  optional int32 id = 1;

  /**
   * @Basic(projectable = true, sortable = true)
   */
  required string name = 2;

  /**
   * @Basic(projectable = true)
   */
  required string surname = 3;

  enum Gender {
    MALE = 0;
    FEMALE = 1;
  }

  /**
   * @Basic(projectable = true)
   */
  optional Gender gender = 4;

  /**
   * @Embedded
   */
  optional Address address = 5;

  /**
   * @Embedded
   */
  repeated PhoneNumber phoneNumbers = 6;

  /**
   * @Basic(projectable = true)
   */
  optional uint32 age = 7;

  /**
  * @Basic(projectable = true)
  */
  optional string newField = 8;
}
