Add agent fees

This commit is contained in:
2025-09-28 20:57:42 +07:00
parent fd2387932e
commit 16a56bd26c
20 changed files with 108 additions and 166 deletions

View File

@@ -35,35 +35,11 @@ namespace Managing.Application.ManageBot
var userBots = await _botService.GetBotsByUser(user.Id);
var botList = userBots.ToList();
// Apply time filter if specified
if (request.TimeFilter != "Total")
{
var cutoffDate = GetCutoffDate(request.TimeFilter);
botList = botList.Where(bot =>
bot.StartupTime >= cutoffDate ||
bot.CreateDate >= cutoffDate).ToList();
}
result[user] = botList;
}
return result;
}
/// <summary>
/// Gets the cutoff date based on the time filter
/// </summary>
private DateTime GetCutoffDate(string timeFilter)
{
return timeFilter switch
{
"24H" => DateTime.UtcNow.AddHours(-24),
"3D" => DateTime.UtcNow.AddDays(-3),
"1W" => DateTime.UtcNow.AddDays(-7),
"1M" => DateTime.UtcNow.AddMonths(-1),
"1Y" => DateTime.UtcNow.AddYears(-1),
_ => DateTime.MinValue // Default to include all data
};
}
}
}