diff --git a/Back/skydiveLogs-api.DomainBusiness/StatsByYearService.cs b/Back/skydiveLogs-api.DomainBusiness/StatsByYearService.cs index 81bb2a0..5756c11 100644 --- a/Back/skydiveLogs-api.DomainBusiness/StatsByYearService.cs +++ b/Back/skydiveLogs-api.DomainBusiness/StatsByYearService.cs @@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness #region Public Methods + /// + /// Retrieves statistics grouped by year. + /// + /// A collection of StatsByYear entities containing the statistics. public IEnumerable GetStats() { var allStats = _statsByYearRepository.GetAll(_identityService.ConnectedUser); @@ -50,6 +54,9 @@ namespace skydiveLogs_api.DomainBusiness return allStats; } + /// + /// Resets the year statistics. + /// public void Reset() { _statsByYearRepository.Delete(_identityService.ConnectedUser); @@ -65,4 +72,4 @@ namespace skydiveLogs_api.DomainBusiness #endregion Private Fields } -} \ No newline at end of file +} diff --git a/Back/skydiveLogs-api.DomainBusiness/StatsForLastMonthByDzService.cs b/Back/skydiveLogs-api.DomainBusiness/StatsForLastMonthByDzService.cs index 5cbfdca..025074d 100644 --- a/Back/skydiveLogs-api.DomainBusiness/StatsForLastMonthByDzService.cs +++ b/Back/skydiveLogs-api.DomainBusiness/StatsForLastMonthByDzService.cs @@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness #region Public Methods + /// + /// Retrieves statistics for the last month grouped by drop zone. + /// + /// A collection of StatsForLastMonthByDz entities containing the statistics. public IEnumerable GetStats() { var allStats = _statsForLastMonthByDzRepository.GetAll(_identityService.ConnectedUser); @@ -55,6 +59,9 @@ namespace skydiveLogs_api.DomainBusiness return allStats; } + /// + /// Resets the last month drop zone statistics. + /// public void Reset() { _statsForLastMonthByDzRepository.Delete(_identityService.ConnectedUser); @@ -70,4 +77,4 @@ namespace skydiveLogs_api.DomainBusiness #endregion Private Fields } -} \ No newline at end of file +} diff --git a/Back/skydiveLogs-api.DomainBusiness/StatsForLastMonthByJumpTypeService.cs b/Back/skydiveLogs-api.DomainBusiness/StatsForLastMonthByJumpTypeService.cs index 9f89577..cb2b6d9 100644 --- a/Back/skydiveLogs-api.DomainBusiness/StatsForLastMonthByJumpTypeService.cs +++ b/Back/skydiveLogs-api.DomainBusiness/StatsForLastMonthByJumpTypeService.cs @@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness #region Public Methods + /// + /// Retrieves statistics for the last month grouped by jump type. + /// + /// A collection of StatsForLastMonthByJumpType entities containing the statistics. public IEnumerable GetStats() { var allStats = _statsForLastMonthByJumpTypeRepository.GetAll(_identityService.ConnectedUser); @@ -55,6 +59,9 @@ namespace skydiveLogs_api.DomainBusiness return allStats; } + /// + /// Resets the last month jump type statistics. + /// public void Reset() { _statsForLastMonthByJumpTypeRepository.Delete(_identityService.ConnectedUser); @@ -70,4 +77,4 @@ namespace skydiveLogs_api.DomainBusiness #endregion Private Fields } -} \ No newline at end of file +} diff --git a/Back/skydiveLogs-api.DomainBusiness/StatsForLastYearByDzService.cs b/Back/skydiveLogs-api.DomainBusiness/StatsForLastYearByDzService.cs index 6b44295..97e0aef 100644 --- a/Back/skydiveLogs-api.DomainBusiness/StatsForLastYearByDzService.cs +++ b/Back/skydiveLogs-api.DomainBusiness/StatsForLastYearByDzService.cs @@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness #region Public Methods + /// + /// Retrieves statistics for the last year grouped by drop zone. + /// + /// A collection of StatsForLastYearByDz entities containing the statistics. public IEnumerable GetStats() { var allStats = _statsForLastYearByDzRepository.GetAll(_identityService.ConnectedUser); @@ -54,6 +58,9 @@ namespace skydiveLogs_api.DomainBusiness return allStats; } + /// + /// Resets the last year drop zone statistics. + /// public void Reset() { _statsForLastYearByDzRepository.Delete(_identityService.ConnectedUser); @@ -69,4 +76,4 @@ namespace skydiveLogs_api.DomainBusiness #endregion Private Fields } -} \ No newline at end of file +} diff --git a/Back/skydiveLogs-api.DomainBusiness/StatsForLastYearByJumpTypeService.cs b/Back/skydiveLogs-api.DomainBusiness/StatsForLastYearByJumpTypeService.cs index 7f0569c..703e423 100644 --- a/Back/skydiveLogs-api.DomainBusiness/StatsForLastYearByJumpTypeService.cs +++ b/Back/skydiveLogs-api.DomainBusiness/StatsForLastYearByJumpTypeService.cs @@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness #region Public Methods + /// + /// Retrieves statistics for the last year grouped by jump type. + /// + /// A collection of StatsForLastYearByJumpType entities containing the statistics. public IEnumerable GetStats() { var allStats = _statsForLastYearByJumpTypeRepository.GetAll(_identityService.ConnectedUser); @@ -54,7 +58,9 @@ namespace skydiveLogs_api.DomainBusiness return allStats; } - + /// + /// Resets the last year jump type statistics. + /// public void Reset() { _statsForLastYearByJumpTypeRepository.Delete(_identityService.ConnectedUser); @@ -71,4 +77,4 @@ namespace skydiveLogs_api.DomainBusiness #endregion Private Fields } -} \ No newline at end of file +} diff --git a/Back/skydiveLogs-api.DomainBusiness/StatsService.cs b/Back/skydiveLogs-api.DomainBusiness/StatsService.cs index e6eb3e2..085cd1a 100644 --- a/Back/skydiveLogs-api.DomainBusiness/StatsService.cs +++ b/Back/skydiveLogs-api.DomainBusiness/StatsService.cs @@ -38,6 +38,10 @@ namespace skydiveLogs_api.DomainBusiness #region Public Methods + /// + /// Retrieves a simple summary of all statistics. + /// + /// A SimpleSummary entity containing the simple summary statistics. public SimpleSummary GetSimpleSummary() { var allJumps = _jumpService.GetAllJumps(); @@ -58,6 +62,9 @@ namespace skydiveLogs_api.DomainBusiness return results; } + /// + /// Resets all statistics. + /// public void Reset() { _statsByAircraftService.Reset(); @@ -72,6 +79,10 @@ namespace skydiveLogs_api.DomainBusiness _statsForLastYearByJumpTypeService.Reset(); } + /// + /// Retrieves statistics grouped by aircraft. + /// + /// A collection of Statistic entities containing aircraft statistics. public IEnumerable GetStatsByAircraft() { var tmp = _statsByAircraftService.GetStats(); @@ -82,6 +93,10 @@ namespace skydiveLogs_api.DomainBusiness })]; } + /// + /// Retrieves statistics grouped by drop zone. + /// + /// A collection of Statistic entities containing drop zone statistics. public IEnumerable GetStatsByDz() { var tmp = _statsByDzService.GetStats(); @@ -92,6 +107,10 @@ namespace skydiveLogs_api.DomainBusiness })]; } + /// + /// Retrieves statistics grouped by gear. + /// + /// A collection of Statistic entities containing gear statistics. public IEnumerable GetStatsByGear() { var tmp = _statsByGearService.GetStats(); @@ -102,6 +121,10 @@ namespace skydiveLogs_api.DomainBusiness })]; } + /// + /// Retrieves statistics grouped by jump type. + /// + /// A collection of Statistic entities containing jump type statistics. public IEnumerable GetStatsByJumpType() { var tmp = _statsByJumpTypeService.GetStats(); @@ -112,6 +135,10 @@ namespace skydiveLogs_api.DomainBusiness })]; } + /// + /// Retrieves statistics grouped by year. + /// + /// A collection of Statistic entities containing year statistics. public IEnumerable GetStatsByYear() { var tmp = _statsByYearService.GetStats(); @@ -122,6 +149,10 @@ namespace skydiveLogs_api.DomainBusiness })]; } + /// + /// Retrieves statistics for the last month grouped by drop zone. + /// + /// A collection of Statistic entities containing last month drop zone statistics. public IEnumerable GetStatsForLastMonthByDz() { var tmp = _statsForLastMonthByDzService.GetStats(); @@ -132,6 +163,10 @@ namespace skydiveLogs_api.DomainBusiness })]; } + /// + /// Retrieves statistics for the last month grouped by jump type. + /// + /// A collection of Statistic entities containing last month jump type statistics. public IEnumerable GetStatsForLastMonthByJumpType() { var tmp = _statsForLastMonthByJumpTypeService.GetStats(); @@ -142,6 +177,10 @@ namespace skydiveLogs_api.DomainBusiness })]; } + /// + /// Retrieves statistics for the last year grouped by drop zone. + /// + /// A collection of Statistic entities containing last year drop zone statistics. public IEnumerable GetStatsForLastYearByDz() { var tmp = _statsForLastYearByDzService.GetStats(); @@ -152,6 +191,10 @@ namespace skydiveLogs_api.DomainBusiness })]; } + /// + /// Retrieves statistics for the last year grouped by jump type. + /// + /// A collection of Statistic entities containing last year jump type statistics. public IEnumerable GetStatsForLastYearByJumpType() { var tmp = _statsForLastYearByJumpTypeService.GetStats(); @@ -162,6 +205,10 @@ namespace skydiveLogs_api.DomainBusiness })]; } + /// + /// Retrieves statistics by year grouped with jump type. + /// + /// A collection of Statistic entities containing yearly jump type statistics. public IEnumerable GetStatsByYearByJumpType() { var tmp = _statsByYearByJumpTypeService.GetStats(); @@ -191,4 +238,4 @@ namespace skydiveLogs_api.DomainBusiness #endregion Private Fields } -} \ No newline at end of file +} diff --git a/Back/skydiveLogs-api.DomainBusiness/TunnelFlightService.cs b/Back/skydiveLogs-api.DomainBusiness/TunnelFlightService.cs index ff769da..c9a3537 100644 --- a/Back/skydiveLogs-api.DomainBusiness/TunnelFlightService.cs +++ b/Back/skydiveLogs-api.DomainBusiness/TunnelFlightService.cs @@ -11,7 +11,7 @@ namespace skydiveLogs_api.DomainBusiness { #region Public Constructors - public TunnelFlightService(IJumpTypeService jumpTypeService, + public TunnelFlightService(IJumpTypeService jumpTypeService, ITunnelFlightRepository tunnelFlightRepository, IDropZoneService dropZoneService, IIdentityService identityService) @@ -26,26 +26,51 @@ namespace skydiveLogs_api.DomainBusiness #region Public Methods + /// + /// Retrieves all tunnel flights. + /// + /// A collection of TunnelFlight entities containing all tunnel flights. public IEnumerable GetAllTunnelFlights() { return _tunnelFlightRepository.GetAll(_identityService.ConnectedUser); } + /// + /// Retrieves a tunnel flight by its ID. + /// + /// The tunnel flight ID to retrieve. + /// A TunnelFlight entity containing the tunnel flight details. public TunnelFlight GetTunnelFlightById(int id) { return _tunnelFlightRepository.GetById(id); } + /// + /// Retrieves the total count of tunnel flights. + /// + /// The total number of tunnel flights. public int GetTunnelFlightCount() { return _tunnelFlightRepository.GetCount(_identityService.ConnectedUser); } + /// + /// Retrieves a range of tunnel flights with pagination. + /// + /// The starting index for pagination. + /// The ending index for pagination. + /// A collection of TunnelFlight entities containing the requested range. public IEnumerable GetTunnelFlightsByIndexes(int beginIndex, int endIndex) { return _tunnelFlightRepository.GetBetweenIndex(_identityService.ConnectedUser, beginIndex, endIndex); } + /// + /// Retrieves tunnel flights grouped by month within a date range. + /// + /// The start date for grouping. + /// The end date for grouping. + /// A collection of Statistic entities grouped by month. public IEnumerable GetTunnelFlightGroupByMonth(string beginDate, string endDate) { var convertedBeginDate = Convert.ToDateTime(beginDate); @@ -69,6 +94,12 @@ namespace skydiveLogs_api.DomainBusiness return results; } + /// + /// Retrieves tunnel flights filtered by date range. + /// + /// The start date for filtering. + /// The end date for filtering. + /// A collection of TunnelFlight entities filtered by the specified date range. public IEnumerable GetTunnelFlightByDates(string beginDate, string endDate) { var convertedBeginDate = Convert.ToDateTime(beginDate); @@ -76,7 +107,13 @@ namespace skydiveLogs_api.DomainBusiness return _tunnelFlightRepository.GetBetweenDate(_identityService.ConnectedUser, convertedBeginDate, convertedEndDate); } - + + /// + /// Adds a new tunnel flight to the system. + /// + /// The tunnel ID to add the flight to. + /// The jump type ID for the flight. + /// TunnelFlight entity containing the new flight data. public void AddNewFlight(int tunnelId, int jumpTypeId, TunnelFlight newFlight) { var tmp = _dropZoneService.GetDzById(tunnelId); @@ -93,17 +130,25 @@ namespace skydiveLogs_api.DomainBusiness var selectedJumpType = _jumpTypeService.GetJumpTypeById(jumpTypeId); - newFlight.Tunnel = selectedTunnel; newFlight.JumpType = selectedJumpType; _tunnelFlightRepository.Add(newFlight); } + /// + /// Deletes a tunnel flight by its ID. + /// + /// The tunnel flight ID to delete. public void DeleteTunnelFlightById(int id) { _tunnelFlightRepository.DeleteById(id); } + /// + /// Updates an existing tunnel flight. + /// + /// The tunnel flight ID to update. + /// TunnelFlight entity containing the updated tunnel flight data. public void UpdateTunnelFlight(int id, TunnelFlight updatedTunnelFlight) { var myTunnelFlight = GetTunnelFlightById(id); @@ -125,4 +170,4 @@ namespace skydiveLogs_api.DomainBusiness #endregion Private Fields } -} \ No newline at end of file +} diff --git a/Back/skydiveLogs-api.DomainBusiness/UserImageService.cs b/Back/skydiveLogs-api.DomainBusiness/UserImageService.cs index dce1997..94a2276 100644 --- a/Back/skydiveLogs-api.DomainBusiness/UserImageService.cs +++ b/Back/skydiveLogs-api.DomainBusiness/UserImageService.cs @@ -21,27 +21,49 @@ namespace skydiveLogs_api.DomainBusiness #region Public Methods + /// + /// Adds a new image to the system. + /// + /// The UserImage entity containing the new image data. public void AddNewImage(UserImage newImage) { newImage.User = _identityService.ConnectedUser; _imageRepository.Add(newImage); } + /// + /// Deletes an image by its ID. + /// + /// The image ID to delete. public void DeleteImageById(int id) { throw new NotImplementedException(); } + /// + /// Retrieves all images. + /// + /// A collection of UserImage entities containing all images. public IEnumerable GetAllImages() { return _imageRepository.GetAll(_identityService.ConnectedUser); } + /// + /// Retrieves an image by its ID. + /// + /// The image ID to retrieve. + /// A UserImage entity containing the image details. public UserImage GetImageById(int id) { return _imageRepository.GetById(id); } + /// + /// Updates an existing image. + /// + /// The image ID to update. + /// UserImage entity containing the updated image data. public void UpdateImage(int id, UserImage Image) { throw new NotImplementedException(); @@ -56,4 +78,4 @@ namespace skydiveLogs_api.DomainBusiness #endregion Private Fields } -} \ No newline at end of file +}