Initial commit

Made-with: Cursor
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-03-25 05:21:08 +02:00
commit 0625cd4157
90 changed files with 3430 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
using LinqToDB.Mapping;
using Azaion.Flights.Enums;
namespace Azaion.Flights.Database.Entities;
[Table("aircrafts")]
public class Aircraft
{
[PrimaryKey]
[Column("id")]
public Guid Id { get; set; }
[Column("type")]
public AircraftType Type { get; set; }
[Column("model")]
public string Model { get; set; } = string.Empty;
[Column("name")]
public string Name { get; set; } = string.Empty;
[Column("fuel_type")]
public FuelType FuelType { get; set; }
[Column("battery_capacity")]
public decimal BatteryCapacity { get; set; }
[Column("engine_consumption")]
public decimal EngineConsumption { get; set; }
[Column("engine_consumption_idle")]
public decimal EngineConsumptionIdle { get; set; }
[Column("is_default")]
public bool IsDefault { get; set; }
}
+14
View File
@@ -0,0 +1,14 @@
using LinqToDB.Mapping;
namespace Azaion.Flights.Database.Entities;
[Table("annotations")]
public class Annotation
{
[PrimaryKey]
[Column("id")]
public string Id { get; set; } = string.Empty;
[Column("media_id")]
public string MediaId { get; set; } = string.Empty;
}
+14
View File
@@ -0,0 +1,14 @@
using LinqToDB.Mapping;
namespace Azaion.Flights.Database.Entities;
[Table("detection")]
public class Detection
{
[PrimaryKey]
[Column("id")]
public Guid Id { get; set; }
[Column("annotation_id")]
public string AnnotationId { get; set; } = string.Empty;
}
+27
View File
@@ -0,0 +1,27 @@
using LinqToDB.Mapping;
using Azaion.Flights.Enums;
namespace Azaion.Flights.Database.Entities;
[Table("flights")]
public class Flight
{
[PrimaryKey]
[Column("id")]
public Guid Id { get; set; }
[Column("created_date")]
public DateTime CreatedDate { get; set; }
[Column("name")]
public string Name { get; set; } = string.Empty;
[Column("aircraft_id")]
public Guid AircraftId { get; set; }
[Association(ThisKey = nameof(AircraftId), OtherKey = nameof(Aircraft.Id))]
public Aircraft? Aircraft { get; set; }
[Association(ThisKey = nameof(Id), OtherKey = nameof(Waypoint.FlightId))]
public List<Waypoint> Waypoints { get; set; } = [];
}
+26
View File
@@ -0,0 +1,26 @@
using LinqToDB.Mapping;
namespace Azaion.Flights.Database.Entities;
[Table("gps_corrections")]
public class GpsCorrection
{
[PrimaryKey]
[Column("id")]
public Guid Id { get; set; }
[Column("flight_id")]
public Guid FlightId { get; set; }
[Column("waypoint_id")]
public Guid WaypointId { get; set; }
[Column("original_gps")]
public string OriginalGps { get; set; } = string.Empty;
[Column("corrected_gps")]
public string CorrectedGps { get; set; } = string.Empty;
[Column("applied_at")]
public DateTime AppliedAt { get; set; }
}
+51
View File
@@ -0,0 +1,51 @@
using LinqToDB.Mapping;
using Azaion.Flights.Enums;
namespace Azaion.Flights.Database.Entities;
[Table("map_objects")]
public class MapObject
{
[PrimaryKey]
[Column("id")]
public Guid Id { get; set; }
[Column("flight_id")]
public Guid FlightId { get; set; }
[Column("h3_index")]
public string H3Index { get; set; } = string.Empty;
[Column("mgrs")]
public string Mgrs { get; set; } = string.Empty;
[Column("lat")]
public decimal? Lat { get; set; }
[Column("lon")]
public decimal? Lon { get; set; }
[Column("class_num")]
public int ClassNum { get; set; }
[Column("label")]
public string Label { get; set; } = string.Empty;
[Column("size_width_m")]
public decimal SizeWidthM { get; set; }
[Column("size_length_m")]
public decimal SizeLengthM { get; set; }
[Column("confidence")]
public decimal Confidence { get; set; }
[Column("object_status")]
public ObjectStatus ObjectStatus { get; set; }
[Column("first_seen_at")]
public DateTime FirstSeenAt { get; set; }
[Column("last_seen_at")]
public DateTime LastSeenAt { get; set; }
}
+14
View File
@@ -0,0 +1,14 @@
using LinqToDB.Mapping;
namespace Azaion.Flights.Database.Entities;
[Table("media")]
public class Media
{
[PrimaryKey]
[Column("id")]
public string Id { get; set; } = string.Empty;
[Column("waypoint_id")]
public Guid? WaypointId { get; set; }
}
+32
View File
@@ -0,0 +1,32 @@
using LinqToDB.Mapping;
namespace Azaion.Flights.Database.Entities;
[Table("orthophotos")]
public class Orthophoto
{
[PrimaryKey]
[Column("id")]
public string Id { get; set; } = string.Empty;
[Column("flight_id")]
public Guid FlightId { get; set; }
[Column("name")]
public string Name { get; set; } = string.Empty;
[Column("path")]
public string Path { get; set; } = string.Empty;
[Column("lat")]
public decimal? Lat { get; set; }
[Column("lon")]
public decimal? Lon { get; set; }
[Column("mgrs")]
public string? Mgrs { get; set; }
[Column("uploaded_at")]
public DateTime UploadedAt { get; set; }
}
+39
View File
@@ -0,0 +1,39 @@
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; }
}