using System.ComponentModel.DataAnnotations;

namespace ApiTerceiroSimulador.Models.OpenDelivery
{
    public class Address
    {
        /// <summary>
        /// Two-letter ISO 3166-1 alpha-2 country code.
        /// </summary>
        [Required, RegularExpression("^[A-Z]{2}$")]
        public required string Country { get; set; } // "BR",

        /// <summary>
        /// State or country subdivision. It is recommended (but not required) that you use the ISO 3166-2 representation.
        /// </summary>
        [Required]
        public required string State { get; set; } // "BR-SP",
        /// <summary>
        /// City name.
        /// </summary>
        [Required]
        public required string City { get; set; } // "São Paulo",

        /// <summary>
        /// Neighborhood or District.
        /// </summary>
        [Required]
        public required string District { get; set; } // "Moema",

        /// <summary>
        /// Street name.
        /// </summary>
        [Required]
        public required string Street { get; set; } // "Plaza Avenue",

        /// <summary>
        /// Street number.
        /// </summary>
        [Required]
        public required string Number { get; set; } // "100",

        /// <summary>
        /// Address complement.
        /// </summary>
        public string? Complement { get; set; } // "BL 02 AP 31",

        /// <summary>
        /// Address reference.
        /// </summary>
        public string? Reference { get; set; } // "Yellow House",

        /// <summary>
        /// Full Formated Address Text
        /// </summary>
        [Required]
        public required string FormattedAddress { get; set; } // "Plaza Avenue, 100, BL 02 AP 31, Moema - São Paulo, SP - Brazil",

        /// <summary>
        /// Postal Code
        /// </summary>
        [Required]
        public required string PostalCode { get; set; } // "20111-000",

        public required Coordinate Coordinates { get; set; }
    }
}
