aboutsummaryrefslogtreecommitdiff
path: root/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsTrip.cs
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-10-21 15:34:24 +0200
committerAriel Costas Guerrero <ariel@costas.dev>2025-12-12 10:24:53 +0100
commit661cccc2da9a6c32b7b56c60313787282a9084ea (patch)
tree8176720aa99b80281a8351ae74170238c50b59cc /src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsTrip.cs
parented023a4b5ee257c0c367357b6d83f9778e2cf536 (diff)
Begin implementing
Diffstat (limited to 'src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsTrip.cs')
-rw-r--r--src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsTrip.cs60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsTrip.cs b/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsTrip.cs
new file mode 100644
index 0000000..d68cbdd
--- /dev/null
+++ b/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsTrip.cs
@@ -0,0 +1,60 @@
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Costasdev.ServiceViewer.Data.Gtfs.Enums;
+
+namespace Costasdev.ServiceViewer.Data.Gtfs;
+
+[Table("trips")]
+public class GtfsTrip
+{
+ [Key]
+ [Column("trip_id")]
+ [MaxLength(32)]
+ public string TripId { get; set; } = null!;
+
+ [Column("route_id")]
+ [MaxLength(32)]
+ [ForeignKey(nameof(Route))]
+ public string RouteId { get; set; } = null!;
+
+ [ForeignKey(nameof(RouteId))]
+ public GtfsRoute Route { get; set; } = null!;
+
+ [Column("service_id")]
+ [MaxLength(32)]
+ public string ServiceId { get; set; } = null!;
+
+ [Column("trip_headsign")]
+ [MaxLength(255)]
+ public string? TripHeadsign { get; set; }
+
+ [Column("trip_short_name")]
+ [MaxLength(255)]
+ public string? TripShortName { get; set; }
+
+ [Column("direction_id")]
+ public DirectionId DirectionId { get; set; } = DirectionId.Outbound;
+
+ /// <summary>
+ /// Identifies the block to which the trip belongs. A block consists of a single trip or many
+ /// sequential trips made using the same vehicle, defined by shared service days and block_id.
+ /// A block_id may have trips with different service days, making distinct blocks.
+ /// </summary>
+ [Column("block_id")]
+ [MaxLength(32)]
+ public string? BlockId { get; set; }
+
+ /// <summary>
+ /// Identifies a geospatial shape describing the vehicle travel path for a trip.
+ /// </summary>
+ /// <remarks>To be implemented: will be stored as a GeoJSON file instead of database records.</remarks>
+ [Column("shape_id")]
+ [MaxLength(32)]
+ public string? ShapeId { get; set; }
+
+ [Column("trip_wheelchair_accessible")]
+ public TripWheelchairAccessible TripWheelchairAccessible { get; set; } = TripWheelchairAccessible.Empty;
+
+ [Column("trip_bikes_allowed")]
+ public TripBikesAllowed TripBikesAllowed { get; set; } = TripBikesAllowed.Empty;
+}