syntax = "proto3";

package com.wix.ecommerce.commons.api;

import "com/wix/ecommerce/commons/api/addressComponents.proto";
import "wix/api/validations.proto";
import "wix/api/annotations.proto";
import "google/protobuf/wrappers.proto";

message Address {
    // Addressee name
    FullName full_name = 1;
    // Country code (2 letters)
    google.protobuf.StringValue country = 2 [(.wix.api.format) = COUNTRY];
    // State or district
    google.protobuf.StringValue subdivision = 3 [(.wix.api.maxLength) = 50];
    // City name
    google.protobuf.StringValue city = 4 [(.wix.api.maxLength) = 150];
    // ZIP/postal code
    google.protobuf.StringValue zip_code = 5 [(.wix.api.maxLength) = 200, (.wix.api.pii) = true];
    // Phone number
    google.protobuf.StringValue phone = 6 [(.wix.api.maxLength) = 200, (.wix.api.pii) = true];
    // Company name
    google.protobuf.StringValue company = 7 [(.wix.api.maxLength) = 500];
    // Email address
    google.protobuf.StringValue email = 8 [(.wix.api.maxLength) = 500, (.wix.api.pii) = true];
    // main address line
    oneof address_line1_options {
        // Address line 1 (free text)
        string address_line1 = 9 [(.wix.api.maxLength) = 1000, (.wix.api.pii) = true];
        // Address line 1 (street)
        Street street = 10;
    }
    // address line
    google.protobuf.StringValue address_line2 = 11 [(.wix.api.maxLength) = 250, (.wix.api.pii) = true];
    // Tax information (for Brazil only)
    VatId vat_id = 12;
}

