* Initial plan * Initial project setup - update to .NET 8.0 for compatibility Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> * Complete SBB transport integration implementation Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> * Revert to .NET 9 and separate transport info into ShiftTransport class Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> * Make safety buffer minutes configurable via appsettings Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> * Migrade pdf export service * Update gitignore * Implement new approach: real-time transport data per shift selection with ShiftWithTransport view model Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> * Refactor export methods to directly use ShiftWithTransport instead of converting to separate parameters Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> * Move ShiftWithTransport class to its own file Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> * Code cleanup * Fix transport timing logic to respect safety buffer and find best available connections Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> Co-authored-by: clayschaad <c.schaad@pog.ch> Co-authored-by: Claudio Schaad <clayschaad@users.noreply.github.com>
98 lines
No EOL
3.2 KiB
C#
98 lines
No EOL
3.2 KiB
C#
namespace ShiftScheduler.Shared.Models
|
|
{
|
|
public class ShiftTransport
|
|
{
|
|
public string ShiftName { get; set; } = string.Empty;
|
|
public TransportConnection? MorningTransport { get; set; }
|
|
public TransportConnection? AfternoonTransport { get; set; }
|
|
}
|
|
|
|
public class TransportConfiguration
|
|
{
|
|
public string StartStation { get; set; } = string.Empty;
|
|
public string EndStation { get; set; } = string.Empty;
|
|
public string ApiBaseUrl { get; set; } = string.Empty;
|
|
public int SafetyBufferMinutes { get; set; } = 30;
|
|
}
|
|
|
|
public class TransportConnection
|
|
{
|
|
public string DepartureTime { get; set; } = string.Empty;
|
|
public string ArrivalTime { get; set; } = string.Empty;
|
|
public string Duration { get; set; } = string.Empty;
|
|
public string Platform { get; set; } = string.Empty;
|
|
public List<TransportSection> Sections { get; set; } = new();
|
|
}
|
|
|
|
public class TransportSection
|
|
{
|
|
public TransportJourney? Journey { get; set; }
|
|
public TransportCheckpoint? Departure { get; set; }
|
|
public TransportCheckpoint? Arrival { get; set; }
|
|
}
|
|
|
|
public class TransportJourney
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Category { get; set; } = string.Empty;
|
|
public string Number { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class TransportCheckpoint
|
|
{
|
|
public TransportStation? Station { get; set; }
|
|
public string Departure { get; set; } = string.Empty;
|
|
public string Arrival { get; set; } = string.Empty;
|
|
public string Platform { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class TransportStation
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Id { get; set; } = string.Empty;
|
|
}
|
|
|
|
// API Response models for OpenData CH Transport
|
|
public class TransportApiResponse
|
|
{
|
|
public List<TransportApiConnection> Connections { get; set; } = new();
|
|
}
|
|
|
|
public class TransportApiConnection
|
|
{
|
|
public TransportApiCheckpoint? From { get; set; }
|
|
public TransportApiCheckpoint? To { get; set; }
|
|
public string Duration { get; set; } = string.Empty;
|
|
public List<TransportApiSection> Sections { get; set; } = new();
|
|
}
|
|
|
|
public class TransportApiCheckpoint
|
|
{
|
|
public TransportApiStation? Station { get; set; }
|
|
public string Departure { get; set; } = string.Empty;
|
|
public string Arrival { get; set; } = string.Empty;
|
|
public string Platform { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class TransportApiStation
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Id { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class TransportApiSection
|
|
{
|
|
public TransportApiJourney? Journey { get; set; }
|
|
public TransportApiCheckpoint? Departure { get; set; }
|
|
public TransportApiCheckpoint? Arrival { get; set; }
|
|
}
|
|
|
|
public class TransportApiJourney
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Category { get; set; } = string.Empty;
|
|
public string Number { get; set; } = string.Empty;
|
|
}
|
|
|
|
|
|
} |