/// This file has messages for describing a customer.
syntax = "proto2";

import "github.com/envoyproxy/protoc-gen-validate/validate/validate.proto";

package com.example;

option ruby_package = "com.example.ruby";

// Use // or /** */ to document messages, fields and enums.

/**
 * Represents a mail address.
 */
message Address {
  required string address_line_1 = 1 [(validate.rules).string.min_len = 2]; /** First address line. */
  optional string address_line_2 = 2; /** Second address line. */
  optional string address_line_3 = 3; /** Second address line. */

  required string town    = 4; /// Address town.
  optional string county  = 5; /// Address county, if applicable.
  required string country = 6; /// Address country.
}

/**
 * Represents a customer.
 */
message Customer {
  required int32 id          = 1; /// Unique customer ID.
  required string first_name = 2; /// Customer first name.
  required string last_name  = 3; /// Customer last name.
  optional string details    = 4; /// Customer details.

  optional string email_address   = 5; /// Customer e-mail address.
  repeated string phone_number    = 6; /// Customer phone numbers, primary first.
  repeated Address mail_addresses = 7; /// Customer mail addresses, primary first.
}
