Add store log analysis feature and related data structures

- Implement AnalyzeSlotUnregistrationsAsync method to retrieve and report store log data for cooperating stores in region 139.
- Introduce StoreLogProfileEntry record to aggregate log information.
- Add StoreLog endpoint for API access.
- Create GetStoreLogAsync and GetStoreLogEntriesAsync methods for fetching and deserializing store log entries.
- Update Program.cs to include the new analysis task option.
This commit is contained in:
a.beging
2026-01-27 20:30:52 +01:00
parent 516fceb1dc
commit ada7f979cf
6 changed files with 207 additions and 8 deletions

View File

@@ -1,3 +1,5 @@
using System.Text.Json.Serialization;
namespace FsToolbox.Cli.Tasks
{
public static partial class StoreTasks
@@ -15,6 +17,35 @@ namespace FsToolbox.Cli.Tasks
#endregion
#region Record FoodsaverProfile
/// <summary>
/// Minimal foodsaver profile information for store logs.
/// </summary>
/// <param name="Id">The foodsaver identifier.</param>
/// <param name="Name">The foodsaver display name.</param>
/// <param name="Avatar">The foodsaver avatar URL (relative).</param>
/// <param name="IsSleeping">Indicates whether the foodsaver is sleeping.</param>
public record FoodsaverProfile(int Id, string Name, string? Avatar, bool IsSleeping);
#endregion
#region Record StoreLogEntry
/// <summary>
/// Represents a store log entry with foodsaver and action information.
/// </summary>
public record StoreLogEntry(
[property: JsonPropertyName("performed_at")] DateTime PerformedAt,
[property: JsonPropertyName("action_id")] int ActionId,
[property: JsonPropertyName("date_reference")] DateTime? DateReference,
[property: JsonPropertyName("content")] string? Content,
[property: JsonPropertyName("reason")] string? Reason,
[property: JsonPropertyName("acting_foodsaver")] FoodsaverProfile? ActingFoodsaver,
[property: JsonPropertyName("affected_foodsaver")] FoodsaverProfile? AffectedFoodsaver);
#endregion
#region Record Pickup
/// <summary>