feat/Update_Controllers_to_Allow_for_Premium_Membership

This commit is contained in:
cesnimda
2026-08-03 09:17:28 +02:00
parent de937d25dc
commit c3f4a57195
187 changed files with 26062 additions and 991 deletions
+46
View File
@@ -0,0 +1,46 @@
namespace JobTrackerApi.Models;
public static class OperationStatuses
{
public const string Queued = "queued";
public const string Running = "running";
public const string WaitingForRetry = "waiting_for_retry";
public const string WaitingForExternalFallback = "waiting_for_external_fallback";
public const string Succeeded = "succeeded";
public const string Failed = "failed";
public const string Cancelled = "cancelled";
public static bool IsTerminal(string status) => status is Succeeded or Failed or Cancelled;
}
public sealed class UserOperation
{
public Guid Id { get; set; }
public string OwnerUserId { get; set; } = string.Empty;
public string TaskType { get; set; } = string.Empty;
public string IdempotencyKey { get; set; } = string.Empty;
public string Status { get; set; } = OperationStatuses.Queued;
public int Priority { get; set; }
public string EntitlementDecision { get; set; } = string.Empty;
public string PrivacyPolicy { get; set; } = string.Empty;
public string? SubjectType { get; set; }
public string? SubjectId { get; set; }
public string? Provider { get; set; }
public string? Model { get; set; }
public int AttemptCount { get; set; }
public int MaxAttempts { get; set; } = 3;
public DateTime CreatedAtUtc { get; set; }
public DateTime AvailableAtUtc { get; set; }
public DateTime? StartedAtUtc { get; set; }
public DateTime? CompletedAtUtc { get; set; }
public DateTime? DeadlineAtUtc { get; set; }
public DateTime? CancellationRequestedAtUtc { get; set; }
public string? LeaseToken { get; set; }
public DateTime? LeaseExpiresAtUtc { get; set; }
public DateTime? LastHeartbeatAtUtc { get; set; }
public string? ProgressStage { get; set; }
public int? ProgressPercent { get; set; }
public string? FailureCategory { get; set; }
public string? FailureMessage { get; set; }
public string? ResultReference { get; set; }
}