Little test with AI + Add the equipment (#8)
Tests using local LLM AI to add comments in the C# files For the flights tunnel, show the total to day/hours For the jump, add the equipment (now just with the wingsuit) Reviewed-on: #8 Co-authored-by: sandre <perso@sebastienandre.com> Co-committed-by: sandre <perso@sebastienandre.com>
This commit was merged in pull request #8.
This commit is contained in:
@@ -28,6 +28,14 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new jump to the system.
|
||||
/// </summary>
|
||||
/// <param name="aircraftId">The ID of the aircraft to use for this jump.</param>
|
||||
/// <param name="dzId">The ID of the drop zone for this jump.</param>
|
||||
/// <param name="jumpTypeId">The ID of the jump type for this jump.</param>
|
||||
/// <param name="gearId">The ID of the gear for this jump.</param>
|
||||
/// <param name="jump">Jump entity containing the new jump data.</param>
|
||||
public void AddNewJump(int aircraftId,
|
||||
int dzId,
|
||||
int jumpTypeId,
|
||||
@@ -48,37 +56,66 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
_jumpRepository.Add(jump);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a jump by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The jump ID to delete.</param>
|
||||
public void DeleteJumpById(int id)
|
||||
{
|
||||
_jumpRepository.DeleteById(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves all jumps for the current user.
|
||||
/// </summary>
|
||||
/// <returns>A collection of Jump entities containing all jumps.</returns>
|
||||
public IEnumerable<Jump> GetAllJumps()
|
||||
{
|
||||
return _jumpRepository.GetAll(_identityService.ConnectedUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a jump by its ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The jump ID to retrieve.</param>
|
||||
/// <returns>A Jump entity containing the jump details.</returns>
|
||||
public Jump GetJumpById(int id)
|
||||
{
|
||||
return _jumpRepository.GetById(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the total count of jumps for the current user.
|
||||
/// </summary>
|
||||
/// <returns>The total number of jumps.</returns>
|
||||
public int GetJumpCount()
|
||||
{
|
||||
return _jumpRepository.GetCount(_identityService.ConnectedUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a range of jumps for the current user 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 Jump entities containing the requested range.</returns>
|
||||
public IEnumerable<Jump> GetJumpsByIndexes(int beginIndex, int endIndex)
|
||||
{
|
||||
return _jumpRepository.GetBetweenIndex(_identityService.ConnectedUser, beginIndex, endIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates an existing jump.
|
||||
/// </summary>
|
||||
/// <param name="id">The jump ID to update.</param>
|
||||
/// <param name="updatedJump">Jump entity containing the updated jump data.</param>
|
||||
public void UpdateJump(int id, Jump updatedJump)
|
||||
{
|
||||
var myJump = GetJumpById(id);
|
||||
myJump.IsSpecial = updatedJump.IsSpecial;
|
||||
myJump.WithCutaway = updatedJump.WithCutaway;
|
||||
myJump.Notes = updatedJump.Notes;
|
||||
myJump.Equipment = updatedJump.Equipment;
|
||||
|
||||
_jumpRepository.Update(myJump);
|
||||
}
|
||||
@@ -96,4 +133,4 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user