using System.ComponentModel.DataAnnotations;
using AyCode.Interfaces.Addresses;
using System.ComponentModel.DataAnnotations.Schema;

namespace AyCode.Entities.Addresses;

[Table("Address")]
public abstract class AcAddress : IAcAddress
{
    [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
    public Guid Id { get; set; }

    public bool IsValid { get; set; }
    public bool IsHelper { get; set; }

    public double? Latitude { get; set; }
    public double? Longitude { get; set; }

    public string? AddressText { get; set; }

    public DateTime Created { get; set; }
    public DateTime Modified { get; set; }

    protected AcAddress()
    { }

    protected AcAddress(Guid id)
    {
        Id = id;
    }

    protected AcAddress(Guid id, string? addressText) : this(id, null, null, addressText)
    { }

    protected AcAddress(Guid id, double? latitude, double? longitude, string? addressText) : this(id)
    {
        Latitude = latitude;
        Longitude = longitude;
        AddressText = addressText;
    }
}