Add comments by AI

This commit is contained in:
2026-04-10 14:35:30 +02:00
parent faa4709aea
commit 4fc0065841
7 changed files with 88 additions and 16 deletions
@@ -22,17 +22,29 @@ namespace skydiveLogs_api.DomainBusiness
#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)
{
_jumpTypeRepository.Add(newJumpType);
_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)
{
throw new NotImplementedException();
}
/// <summary>
/// Retrieves all jump types.
/// </summary>
/// <returns>A collection of JumpType entities containing all jump types.</returns>
public IEnumerable<JumpType> GetAllJumpTypes()
{
if (!_cacheService.Contains(CacheType.JumpType))
@@ -43,17 +55,33 @@ namespace skydiveLogs_api.DomainBusiness
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()
{
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)
{
var allJumpTypes = GetAllJumpTypes();
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)
{
jumpType.Id = id;
@@ -74,4 +102,4 @@ namespace skydiveLogs_api.DomainBusiness
#endregion Private Fields
}
}
}