name.proto

syntax = "proto3";

package pub.odf.identity.v1;


/**
 * Common name prefixes.
 * @see https://en.wikipedia.org/wiki/English_honorifics
 */
enum NamePrefix {
  NAME_PREFIX_UNSPECIFIED = 0;

  // The most common prefixes
  NAME_PREFIX_MR = 1;
  NAME_PREFIX_MRS = 2;
  NAME_PREFIX_MASTER = 3;
  NAME_PREFIX_MISS = 4;
  NAME_PREFIX_MS = 5;
  NAME_PREFIX_MX = 6;

  // More formal
  NAME_PREFIX_SIR = 10;
  NAME_PREFIX_SIRE = 11;
  NAME_PREFIX_MISTRESS = 12;
  NAME_PREFIX_MADAM = 13;
  NAME_PREFIX_DAME = 14;
  NAME_PREFIX_LORD = 15;
  NAME_PREFIX_LADY = 16;
  NAME_PREFIX_ESQ = 17;

  // Profession related
  NAME_PREFIX_DR = 20;
  NAME_PREFIX_EXCELLENCE = 21;
  NAME_PREFIX_HONORABLE = 22;
  NAME_PREFIX_CHANCELLOR = 23;
  NAME_PREFIX_VICE_CHANCELLOR = 24;
  NAME_PREFIX_PRINCIPAL = 25;
  NAME_PREFIX_PRESIDENT = 26;
  NAME_PREFIX_WARDEN = 27;
  NAME_PREFIX_DEAN = 28;
  NAME_PREFIX_REGENT = 29;
  NAME_PREFIX_RECTOR = 30;
  NAME_PREFIX_PROVOST = 31;
  NAME_PREFIX_DIRECTOR = 32;
  NAME_PREFIX_CEO = 33;
}


message Name {
  // Basic components
  string first = 1;
  string middle = 2;
  string last = 3;

  // Mr, Mrs, Sir, etc
  // Other is reserved for unforseen common prefixes
  NamePrefix prefix = 4;
  string prefix_other = 5;

  // Md, Esq, III, etc
  string suffix = 6;

  // Informal nickname
  string nickname = 7;

  // [optional] How it should be displayed
  // Otherwise it can be computed from the components
string display = 8;
}