How ossyd/inl-mningsuppgift-2---det-sakra-vader-apit works
FailSafe WeatherMonitor is a console application that imports weather measurements from a CSV file and Open-Meteo, stores them in SQL Server, and lets users inspect station measurements and temperature statistics. The main workflow runs through the console menu and views, into import or statistics services, then the repository and database. CSV validation and bad-data logging, API response mapping, and shared database-error handling are separate internal stages. The README describes the major capabilities; some service wiring and persistence details are supported by the source index rather than fully shown excerpts.
Main entry points: CSVService.cs CSV import · OpenMeteoService.cs Open-Meteo fetch · WeatherMonitorApp.cs Menu workflow · WeatherDataRepository.cs Weather repository
Components 24
Console application
- Application entry
WeatherApp.App/Program.cs - Menu workflow
WeatherApp.App/WeatherMonitorApp.cs - CSV import view
WeatherApp.App/Views/CsvView.cs - API import view
WeatherApp.App/Views/ApiView.cs - Statistics view
WeatherApp.App/Views/StatisticsView.cs - Console helpers
WeatherApp.App/Helpers/ConsoleHelper.cs
Weather services
- CSV import
WeatherApp.Services/CSV/CSVService.cs - CSV validation
WeatherApp.Services/CSV/WeatherCSVValidator.cs - Open-Meteo fetch
WeatherApp.Services/API/OpenMeteoService.cs - Statistics queries
WeatherApp.Services/Statistics/StatisticsService.cs - Bad-data logging
WeatherApp.Services/Logging/BadDataLogger.cs - Database error handling
WeatherApp.Services/Helpers/DatabaseCall.cs
Domain contracts
- Service interfaces
WeatherApp.Services/Interfaces - Weather measurements
WeatherApp.Domain/Entities/WeatherDataPoint.cs - Import summaries
WeatherApp.Domain/Models/ImportSummary.cs - Station statistics
WeatherApp.Domain/Models/StationStatistics.cs - Result and errors
WeatherApp.Domain/Results/Result.cs - Repository contract
WeatherApp.Domain/Interfaces/IWeatherDataRepository.cs
Persistence
- Weather repository
WeatherApp.Infrastructure/Repositories/WeatherDataRepository.cs - EF Core context
WeatherApp.Infrastructure/Data/WeatherDbContext.cs - SQL Server
Other components
- Console user
- Open-Meteo API
- CSV input file
WeatherApp.App/Data/weather_data.csv
Connections 26
- Console user → Application entry: runs
README.md - Application entry → Menu workflow: starts
WeatherApp.App/Program.cs - Menu workflow → CSV import view: routes to
WeatherApp.App/WeatherMonitorApp.cs - Menu workflow → API import view: routes to
WeatherApp.App/WeatherMonitorApp.cs - Menu workflow → Statistics view: routes to
WeatherApp.App/WeatherMonitorApp.cs - CSV import view → Service interfaces: calls import
WeatherApp.App/Views/CsvView.cs - API import view → Service interfaces: calls fetch
WeatherApp.App/Views/ApiView.cs - Statistics view → Service interfaces: requests statistics
WeatherApp.App/Views/StatisticsView.cs - CSV import → CSV input file: reads
WeatherApp.Services/CSV/CSVService.cs - CSV import → CSV validation: validates rows
WeatherApp.Services/CSV/CSVService.cs - CSV import → Bad-data logging: logs rejected data
WeatherApp.Services/CSV/CSVService.cs - CSV import → Repository contract: persists measurements
WeatherApp.Services/CSV/CSVService.cs - Open-Meteo fetch → Open-Meteo API: fetches data
WeatherApp.Services/API/OpenMeteoService.cs - Open-Meteo fetch → Repository contract: persists measurements
WeatherApp.Services/API/OpenMeteoService.cs - Open-Meteo fetch → Bad-data logging: logs fetch errors
WeatherApp.Services/API/OpenMeteoService.cs - Statistics queries → Repository contract: queries stations
WeatherApp.Services/Statistics/StatisticsService.cs - CSV import → Database error handling: wraps database call
WeatherApp.Services/CSV/CSVService.cs - Open-Meteo fetch → Database error handling: wraps database call
WeatherApp.Services/API/OpenMeteoService.cs - Statistics queries → Database error handling: wraps queries
WeatherApp.Services/Statistics/StatisticsService.cs - Weather repository → EF Core context: queries and saves
WeatherApp.Infrastructure/Repositories/WeatherDataRepository.cs - EF Core context → Weather measurements: maps entity
WeatherApp.Infrastructure/Data/WeatherDbContext.cs - Weather repository → SQL Server: reads and writes
README.md - CSV import → Import summaries: returns summary
WeatherApp.Services/CSV/CSVService.cs - Open-Meteo fetch → Import summaries: returns summary
WeatherApp.Services/API/OpenMeteoService.cs - Weather repository → Station statistics: returns aggregates
WeatherApp.Infrastructure/Repositories/WeatherDataRepository.cs - Statistics view → Console helpers: displays errors
WeatherApp.App/Views/StatisticsView.cs