using Elwig.Helpers;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;

namespace Elwig.Models.Entities {
    [Table("member_billing_address"), PrimaryKey("MgNr")]
    public class BillingAddr : IAddress {
        [Column("mgnr")]
        public int MgNr { get; set; }

        [Column("name")]
        public string Name { get; set; }

        [Column("country")]
        public int CountryNum { get; set; }

        [Column("postal_dest")]
        public string PostalDestId { get; set; }

        [Column("address")]
        public string Address { get; set; }

        [ForeignKey("MgNr")]
        public virtual Member Member { get; private set; }

        [ForeignKey("CountryNum")]
        public virtual Country Country { get; private set; }

        [ForeignKey("CountryNum, PostalDestId")]
        public virtual PostalDest PostalDest { get; private set; }
    }
}