Little test with AI + Add the equipment #8
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics grouped by year.
|
||||
/// </summary>
|
||||
/// <returns>A collection of StatsByYear entities containing the statistics.</returns>
|
||||
public IEnumerable<StatsByYear> GetStats()
|
||||
{
|
||||
var allStats = _statsByYearRepository.GetAll(_identityService.ConnectedUser);
|
||||
@@ -50,6 +54,9 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
return allStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the year statistics.
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
_statsByYearRepository.Delete(_identityService.ConnectedUser);
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics for the last month grouped by drop zone.
|
||||
/// </summary>
|
||||
/// <returns>A collection of StatsForLastMonthByDz entities containing the statistics.</returns>
|
||||
public IEnumerable<StatsForLastMonthByDz> GetStats()
|
||||
{
|
||||
var allStats = _statsForLastMonthByDzRepository.GetAll(_identityService.ConnectedUser);
|
||||
@@ -55,6 +59,9 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
return allStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the last month drop zone statistics.
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
_statsForLastMonthByDzRepository.Delete(_identityService.ConnectedUser);
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics for the last month grouped by jump type.
|
||||
/// </summary>
|
||||
/// <returns>A collection of StatsForLastMonthByJumpType entities containing the statistics.</returns>
|
||||
public IEnumerable<StatsForLastMonthByJumpType> GetStats()
|
||||
{
|
||||
var allStats = _statsForLastMonthByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
||||
@@ -55,6 +59,9 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
return allStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the last month jump type statistics.
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
_statsForLastMonthByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics for the last year grouped by drop zone.
|
||||
/// </summary>
|
||||
/// <returns>A collection of StatsForLastYearByDz entities containing the statistics.</returns>
|
||||
public IEnumerable<StatsForLastYearByDz> GetStats()
|
||||
{
|
||||
var allStats = _statsForLastYearByDzRepository.GetAll(_identityService.ConnectedUser);
|
||||
@@ -54,6 +58,9 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
return allStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the last year drop zone statistics.
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
_statsForLastYearByDzRepository.Delete(_identityService.ConnectedUser);
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics for the last year grouped by jump type.
|
||||
/// </summary>
|
||||
/// <returns>A collection of StatsForLastYearByJumpType entities containing the statistics.</returns>
|
||||
public IEnumerable<StatsForLastYearByJumpType> GetStats()
|
||||
{
|
||||
var allStats = _statsForLastYearByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
||||
@@ -54,7 +58,9 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
return allStats;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Resets the last year jump type statistics.
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
_statsForLastYearByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
||||
|
||||
@@ -38,6 +38,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a simple summary of all statistics.
|
||||
/// </summary>
|
||||
/// <returns>A SimpleSummary entity containing the simple summary statistics.</returns>
|
||||
public SimpleSummary GetSimpleSummary()
|
||||
{
|
||||
var allJumps = _jumpService.GetAllJumps();
|
||||
@@ -58,6 +62,9 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
return results;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets all statistics.
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
_statsByAircraftService.Reset();
|
||||
@@ -72,6 +79,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
_statsForLastYearByJumpTypeService.Reset();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics grouped by aircraft.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing aircraft statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsByAircraft()
|
||||
{
|
||||
var tmp = _statsByAircraftService.GetStats();
|
||||
@@ -82,6 +93,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics grouped by drop zone.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing drop zone statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsByDz()
|
||||
{
|
||||
var tmp = _statsByDzService.GetStats();
|
||||
@@ -92,6 +107,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics grouped by gear.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing gear statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsByGear()
|
||||
{
|
||||
var tmp = _statsByGearService.GetStats();
|
||||
@@ -102,6 +121,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics grouped by jump type.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing jump type statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsByJumpType()
|
||||
{
|
||||
var tmp = _statsByJumpTypeService.GetStats();
|
||||
@@ -112,6 +135,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics grouped by year.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing year statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsByYear()
|
||||
{
|
||||
var tmp = _statsByYearService.GetStats();
|
||||
@@ -122,6 +149,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics for the last month grouped by drop zone.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing last month drop zone statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsForLastMonthByDz()
|
||||
{
|
||||
var tmp = _statsForLastMonthByDzService.GetStats();
|
||||
@@ -132,6 +163,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics for the last month grouped by jump type.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing last month jump type statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsForLastMonthByJumpType()
|
||||
{
|
||||
var tmp = _statsForLastMonthByJumpTypeService.GetStats();
|
||||
@@ -142,6 +177,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics for the last year grouped by drop zone.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing last year drop zone statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsForLastYearByDz()
|
||||
{
|
||||
var tmp = _statsForLastYearByDzService.GetStats();
|
||||
@@ -152,6 +191,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics for the last year grouped by jump type.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing last year jump type statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsForLastYearByJumpType()
|
||||
{
|
||||
var tmp = _statsForLastYearByJumpTypeService.GetStats();
|
||||
@@ -162,6 +205,10 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves statistics by year grouped with jump type.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Statistic entities containing yearly jump type statistics.</returns>
|
||||
public IEnumerable<Statistic> GetStatsByYearByJumpType()
|
||||
{
|
||||
var tmp = _statsByYearByJumpTypeService.GetStats();
|
||||
|
||||
@@ -26,26 +26,51 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves all tunnel flights.
|
||||
/// </summary>
|
||||
/// <returns>A collection of TunnelFlight entities containing all tunnel flights.</returns>
|
||||
public IEnumerable<TunnelFlight> GetAllTunnelFlights()
|
||||
{
|
||||
return _tunnelFlightRepository.GetAll(_identityService.ConnectedUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a tunnel flight by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The tunnel flight ID to retrieve.</param>
|
||||
/// <returns>A TunnelFlight entity containing the tunnel flight details.</returns>
|
||||
public TunnelFlight GetTunnelFlightById(int id)
|
||||
{
|
||||
return _tunnelFlightRepository.GetById(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the total count of tunnel flights.
|
||||
/// </summary>
|
||||
/// <returns>The total number of tunnel flights.</returns>
|
||||
public int GetTunnelFlightCount()
|
||||
{
|
||||
return _tunnelFlightRepository.GetCount(_identityService.ConnectedUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a range of tunnel flights with pagination.
|
||||
/// </summary>
|
||||
/// <param name="beginIndex">The starting index for pagination.</param>
|
||||
/// <param name="endIndex">The ending index for pagination.</param>
|
||||
/// <returns>A collection of TunnelFlight entities containing the requested range.</returns>
|
||||
public IEnumerable<TunnelFlight> GetTunnelFlightsByIndexes(int beginIndex, int endIndex)
|
||||
{
|
||||
return _tunnelFlightRepository.GetBetweenIndex(_identityService.ConnectedUser, beginIndex, endIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves tunnel flights grouped by month within a date range.
|
||||
/// </summary>
|
||||
/// <param name="beginDate">The start date for grouping.</param>
|
||||
/// <param name="endDate">The end date for grouping.</param>
|
||||
/// <returns>A collection of Statistic entities grouped by month.</returns>
|
||||
public IEnumerable<Statistic> GetTunnelFlightGroupByMonth(string beginDate, string endDate)
|
||||
{
|
||||
var convertedBeginDate = Convert.ToDateTime(beginDate);
|
||||
@@ -69,6 +94,12 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
return results;
|
||||
}
|
||||
/// <summary>
|
||||
/// Retrieves tunnel flights filtered by date range.
|
||||
/// </summary>
|
||||
/// <param name="beginDate">The start date for filtering.</param>
|
||||
/// <param name="endDate">The end date for filtering.</param>
|
||||
/// <returns>A collection of TunnelFlight entities filtered by the specified date range.</returns>
|
||||
public IEnumerable<TunnelFlight> GetTunnelFlightByDates(string beginDate, string endDate)
|
||||
{
|
||||
var convertedBeginDate = Convert.ToDateTime(beginDate);
|
||||
@@ -77,6 +108,12 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
return _tunnelFlightRepository.GetBetweenDate(_identityService.ConnectedUser, convertedBeginDate, convertedEndDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new tunnel flight to the system.
|
||||
/// </summary>
|
||||
/// <param name="tunnelId">The tunnel ID to add the flight to.</param>
|
||||
/// <param name="jumpTypeId">The jump type ID for the flight.</param>
|
||||
/// <param name="newFlight">TunnelFlight entity containing the new flight data.</param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a tunnel flight by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The tunnel flight ID to delete.</param>
|
||||
public void DeleteTunnelFlightById(int id)
|
||||
{
|
||||
_tunnelFlightRepository.DeleteById(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates an existing tunnel flight.
|
||||
/// </summary>
|
||||
/// <param name="id">The tunnel flight ID to update.</param>
|
||||
/// <param name="updatedTunnelFlight">TunnelFlight entity containing the updated tunnel flight data.</param>
|
||||
public void UpdateTunnelFlight(int id, TunnelFlight updatedTunnelFlight)
|
||||
{
|
||||
var myTunnelFlight = GetTunnelFlightById(id);
|
||||
|
||||
@@ -21,27 +21,49 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new image to the system.
|
||||
/// </summary>
|
||||
/// <param name="newImage">The UserImage entity containing the new image data.</param>
|
||||
public void AddNewImage(UserImage newImage)
|
||||
{
|
||||
newImage.User = _identityService.ConnectedUser;
|
||||
_imageRepository.Add(newImage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an image by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The image ID to delete.</param>
|
||||
public void DeleteImageById(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves all images.
|
||||
/// </summary>
|
||||
/// <returns>A collection of UserImage entities containing all images.</returns>
|
||||
public IEnumerable<UserImage> GetAllImages()
|
||||
{
|
||||
return _imageRepository.GetAll(_identityService.ConnectedUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves an image by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The image ID to retrieve.</param>
|
||||
/// <returns>A UserImage entity containing the image details.</returns>
|
||||
public UserImage GetImageById(int id)
|
||||
{
|
||||
return _imageRepository.GetById(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates an existing image.
|
||||
/// </summary>
|
||||
/// <param name="id">The image ID to update.</param>
|
||||
/// <param name="Image">UserImage entity containing the updated image data.</param>
|
||||
public void UpdateImage(int id, UserImage Image)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
Reference in New Issue
Block a user