using LinqToDB.Mapping;
using Azaion.Flights.Enums;

namespace Azaion.Flights.Database.Entities;

[Table("waypoints")]
public class Waypoint
{
    [PrimaryKey]
    [Column("id")]
    public Guid Id { get; set; }

    [Column("flight_id")]
    public Guid FlightId { get; set; }

    [Column("lat")]
    public decimal? Lat { get; set; }

    [Column("lon")]
    public decimal? Lon { get; set; }

    [Column("mgrs")]
    public string? Mgrs { get; set; }

    [Column("waypoint_source")]
    public WaypointSource WaypointSource { get; set; }

    [Column("waypoint_objective")]
    public WaypointObjective WaypointObjective { get; set; }

    [Column("order_num")]
    public int OrderNum { get; set; }

    [Column("height")]
    public decimal Height { get; set; }

    [Association(ThisKey = nameof(FlightId), OtherKey = nameof(Flight.Id))]
    public Flight? Flight { get; set; }
}
