From 661cccc2da9a6c32b7b56c60313787282a9084ea Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Tue, 21 Oct 2025 15:34:24 +0200 Subject: Begin implementing --- .../Data/Gtfs/GtfsStopTime.cs | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStopTime.cs (limited to 'src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStopTime.cs') diff --git a/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStopTime.cs b/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStopTime.cs new file mode 100644 index 0000000..07b6732 --- /dev/null +++ b/src/Costasdev.Busurbano.ServiceViewer/Data/Gtfs/GtfsStopTime.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; + +namespace Costasdev.ServiceViewer.Data.Gtfs; + +[Table("stop_times")] +[PrimaryKey(nameof(TripId), nameof(StopSequence))] +public class GtfsStopTime +{ + [Column("trip_id")] + [ForeignKey("TripId")] + [MaxLength(32)] + public string TripId { get; set; } = null!; + + [ForeignKey(nameof(TripId))] public GtfsTrip GtfsTrip { get; set; } = null!; + + [Column("arrival_time")] public string ArrivalTime { get; set; } + public TimeOnly ArrivalTimeOnly => TimeOnly.Parse(ArrivalTime); + + [Column("departure_time")] public string DepartureTime { get; set; } + public TimeOnly DepartureTimeOnly => TimeOnly.Parse(DepartureTime); + + [Column("stop_id")] + [ForeignKey(nameof(GtfsStop))] + [MaxLength(32)] + public required string StopId { get; set; } + + [ForeignKey(nameof(StopId))] public GtfsStop GtfsStop { get; set; } = null!; + + [Column("stop_sequence")] public int StopSequence { get; set; } = 0; + + // [Column("pickup_type")] + // public int? PickupType { get; set; } + // + // [Column("drop_off_type")] + // public int? DropOffType { get; set; } + + [Column("shape_dist_traveled")] public double? ShapeDistTraveled { get; set; } = null!; +} -- cgit v1.3