using System.ComponentModel.DataAnnotations; namespace gehGassi.Domain.Common { /// /// Repräsentiert eine Adresse /// public class Address { /// /// Optionale Adresszeile 1 /// [MaxLength(100)] public string AddressLine1 { get; set; } /// /// Optionale Adresszeile 2 /// [MaxLength(100)] public string AddressLine2 { get; set; } /// /// Optional: Stadt / Ort /// [MaxLength(100)] public string City { get; set; } /// /// Optinale PLZ /// [MaxLength(20)] public string Zip { get; set; } /// /// Bundesland / Staat /// [MaxLength(100)] public string State { get; set; } /// /// ISO2 Ländercode /// [Required] [MaxLength(2)] public string CountryCode { get; set; } public Address Clone() { var address = new Address() { AddressLine1 = AddressLine1, AddressLine2 = AddressLine2, City = City, Zip = Zip, State = State, CountryCode = CountryCode }; return address; } /// /// Gibt zurück ob die Adresse alle notwendigen Informationen für den PaymentProvider beinhaltet /// /// true wenn verwendbar, false sonst public bool ValidForPaymentProvider() { if (!string.IsNullOrWhiteSpace(AddressLine1) && !string.IsNullOrWhiteSpace(City) && !string.IsNullOrWhiteSpace(Zip) && !string.IsNullOrWhiteSpace(State) && !string.IsNullOrWhiteSpace(CountryCode)) { return true; } return false; } } }