Little test with AI + Add the equipment #8
@@ -22,17 +22,29 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a new jump type to the system.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newJumpType">The JumpType entity containing the new jump type data.</param>
|
||||||
public void AddNewJumpType(JumpType newJumpType)
|
public void AddNewJumpType(JumpType newJumpType)
|
||||||
{
|
{
|
||||||
_jumpTypeRepository.Add(newJumpType);
|
_jumpTypeRepository.Add(newJumpType);
|
||||||
_cacheService.Delete(CacheType.JumpType);
|
_cacheService.Delete(CacheType.JumpType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a jump type by its ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The jump type ID to delete.</param>
|
||||||
public void DeleteJumpTypeById(int id)
|
public void DeleteJumpTypeById(int id)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves all jump types.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of JumpType entities containing all jump types.</returns>
|
||||||
public IEnumerable<JumpType> GetAllJumpTypes()
|
public IEnumerable<JumpType> GetAllJumpTypes()
|
||||||
{
|
{
|
||||||
if (!_cacheService.Contains(CacheType.JumpType))
|
if (!_cacheService.Contains(CacheType.JumpType))
|
||||||
@@ -43,17 +55,33 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return _cacheService.Get<IEnumerable<JumpType>>(CacheType.JumpType);
|
return _cacheService.Get<IEnumerable<JumpType>>(CacheType.JumpType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves jump types specifically used for tunnel operations.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of JumpType entities containing tunnel jump types.</returns>
|
||||||
public IEnumerable<JumpType> GetJumpTypesForTunnel()
|
public IEnumerable<JumpType> GetJumpTypesForTunnel()
|
||||||
{
|
{
|
||||||
return GetAllJumpTypes().Where(t => t.InTunnel);
|
return GetAllJumpTypes().Where(t => t.InTunnel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves a jump type by its ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The jump type ID to retrieve.</param>
|
||||||
|
/// <returns>A JumpType entity containing the jump type details.</returns>
|
||||||
public JumpType GetJumpTypeById(int id)
|
public JumpType GetJumpTypeById(int id)
|
||||||
{
|
{
|
||||||
var allJumpTypes = GetAllJumpTypes();
|
var allJumpTypes = GetAllJumpTypes();
|
||||||
return allJumpTypes.Single(g => g.Id == id);
|
return allJumpTypes.Single(g => g.Id == id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an existing jump type.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The jump type ID to update.</param>
|
||||||
|
/// <param name="jumpType">JumpType entity containing the updated jump type data.</param>
|
||||||
|
/// <param name="resetCache">Whether to reset the cache after update.</param>
|
||||||
|
/// <returns>True if the update was successful, false otherwise.</returns>
|
||||||
public bool UpdateJumpType(int id, JumpType jumpType, bool resetCache = true)
|
public bool UpdateJumpType(int id, JumpType jumpType, bool resetCache = true)
|
||||||
{
|
{
|
||||||
jumpType.Id = id;
|
jumpType.Id = id;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using skydiveLogs_api.Domain;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using skydiveLogs_api.Domain;
|
||||||
using skydiveLogs_api.DomainBusiness.Interfaces;
|
using skydiveLogs_api.DomainBusiness.Interfaces;
|
||||||
using skydiveLogs_api.DomainService.Repositories;
|
using skydiveLogs_api.DomainService.Repositories;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace skydiveLogs_api.DomainBusiness
|
namespace skydiveLogs_api.DomainBusiness
|
||||||
{
|
{
|
||||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by aircraft.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsByAircraft entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsByAircraft> GetStats()
|
public IEnumerable<StatsByAircraft> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsByAircraftRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsByAircraftRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -50,6 +54,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the aircraft statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsByAircraftRepository.Delete(_identityService.ConnectedUser);
|
_statsByAircraftRepository.Delete(_identityService.ConnectedUser);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using skydiveLogs_api.Domain;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using skydiveLogs_api.Domain;
|
||||||
using skydiveLogs_api.DomainBusiness.Interfaces;
|
using skydiveLogs_api.DomainBusiness.Interfaces;
|
||||||
using skydiveLogs_api.DomainService.Repositories;
|
using skydiveLogs_api.DomainService.Repositories;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace skydiveLogs_api.DomainBusiness
|
namespace skydiveLogs_api.DomainBusiness
|
||||||
{
|
{
|
||||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by drop zone.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsByDz entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsByDz> GetStats()
|
public IEnumerable<StatsByDz> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsByDzRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsByDzRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -50,6 +54,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the drop zone statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsByDzRepository.Delete(_identityService.ConnectedUser);
|
_statsByDzRepository.Delete(_identityService.ConnectedUser);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using skydiveLogs_api.Domain;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using skydiveLogs_api.Domain;
|
||||||
using skydiveLogs_api.DomainBusiness.Interfaces;
|
using skydiveLogs_api.DomainBusiness.Interfaces;
|
||||||
using skydiveLogs_api.DomainService.Repositories;
|
using skydiveLogs_api.DomainService.Repositories;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace skydiveLogs_api.DomainBusiness
|
namespace skydiveLogs_api.DomainBusiness
|
||||||
{
|
{
|
||||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by gear.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsByGear entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsByGear> GetStats()
|
public IEnumerable<StatsByGear> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsByGearRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsByGearRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -50,6 +54,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the gear statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsByGearRepository.Delete(_identityService.ConnectedUser);
|
_statsByGearRepository.Delete(_identityService.ConnectedUser);
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by jump type.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsByJumpType entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsByJumpType> GetStats()
|
public IEnumerable<StatsByJumpType> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -50,6 +54,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the year and jump type statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
_statsByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves statistics grouped by year and jump type.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of StatsByYearByJumpType entities containing the statistics.</returns>
|
||||||
public IEnumerable<StatsByYearByJumpType> GetStats()
|
public IEnumerable<StatsByYearByJumpType> GetStats()
|
||||||
{
|
{
|
||||||
var allStats = _statsByYearByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
var allStats = _statsByYearByJumpTypeRepository.GetAll(_identityService.ConnectedUser);
|
||||||
@@ -51,6 +55,9 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
return allStats;
|
return allStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the last year by jump type statistics.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_statsByYearByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
_statsByYearByJumpTypeRepository.Delete(_identityService.ConnectedUser);
|
||||||
|
|||||||
@@ -24,11 +24,20 @@ namespace skydiveLogs_api.DomainBusiness
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves all tunnels.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A collection of Tunnel entities containing all tunnels.</returns>
|
||||||
public IEnumerable<Tunnel> GetAllTunnels()
|
public IEnumerable<Tunnel> GetAllTunnels()
|
||||||
{
|
{
|
||||||
return GetAllRefTunnels();
|
return GetAllRefTunnels();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves a tunnel by its ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The tunnel ID to retrieve.</param>
|
||||||
|
/// <returns>A Tunnel entity containing the tunnel details.</returns>
|
||||||
public Tunnel GetTunnelById(int id)
|
public Tunnel GetTunnelById(int id)
|
||||||
{
|
{
|
||||||
var allTunnels = GetAllRefTunnels();
|
var allTunnels = GetAllRefTunnels();
|
||||||
|
|||||||
Reference in New Issue
Block a user