feat(ai): centralize durable usage
CI and Deploy / test (pull_request) Successful in 5m19s
CI and Deploy / deploy (pull_request) Has been skipped

Add a content-free usage ledger with legacy backfill. Reserve Workspace and durable Strategy/CV work before execution so deleted history or duplicate admission cannot reset limits.
This commit is contained in:
cesnimda
2026-08-15 20:03:06 +02:00
parent dbff0f8d49
commit 134aac7bcf
28 changed files with 3539 additions and 83 deletions
+15
View File
@@ -0,0 +1,15 @@
namespace JobTrackerApi.Models;
public sealed class AiUsageRecord
{
public long Id { get; set; }
public string OwnerUserId { get; set; } = string.Empty;
public string SourceType { get; set; } = string.Empty;
public string SourceId { get; set; } = string.Empty;
public string TaskType { get; set; } = string.Empty;
public int CallCount { get; set; } = 1;
public int InputCharacterCount { get; set; }
public int OutputCharacterCount { get; set; }
public int EstimatedTokenCount { get; set; }
public DateTimeOffset CreatedAtUtc { get; set; }
}