Delete backtest by id and with filters
This commit is contained in:
@@ -103,6 +103,18 @@ public class BacktestController : BaseController
|
||||
return Ok(_backtester.DeleteBacktestByUser(user, id));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes multiple backtests by their IDs for the authenticated user.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the array of backtest IDs to delete.</param>
|
||||
/// <returns>An ActionResult indicating the outcome of the operation.</returns>
|
||||
[HttpDelete("multiple")]
|
||||
public async Task<ActionResult> DeleteBacktests([FromBody] DeleteBacktestsRequest request)
|
||||
{
|
||||
var user = await GetUser();
|
||||
return Ok(_backtester.DeleteBacktestsByIdsForUser(user, request.BacktestIds));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves all backtests for a specific genetic request ID.
|
||||
/// This endpoint is used to view the results of a genetic algorithm optimization.
|
||||
|
||||
16
src/Managing.Api/Models/Requests/DeleteBacktestsRequest.cs
Normal file
16
src/Managing.Api/Models/Requests/DeleteBacktestsRequest.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Managing.Api.Models.Requests;
|
||||
|
||||
/// <summary>
|
||||
/// Request model for deleting multiple backtests by their IDs
|
||||
/// </summary>
|
||||
public class DeleteBacktestsRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Array of backtest IDs to delete
|
||||
/// </summary>
|
||||
[Required]
|
||||
[MinLength(1, ErrorMessage = "At least one backtest ID must be provided")]
|
||||
public string[] BacktestIds { get; set; } = Array.Empty<string>();
|
||||
}
|
||||
Reference in New Issue
Block a user