feat(ai): centralize durable usage
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:
@@ -182,6 +182,57 @@ namespace JobTrackerApi.Migrations
|
||||
b.ToTable("AiInteractions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("JobTrackerApi.Models.AiUsageRecord", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("CallCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAtUtc")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("EstimatedTokenCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("InputCharacterCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("OutputCharacterCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("OwnerUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SourceId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SourceType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TaskType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("OwnerUserId", "CreatedAtUtc");
|
||||
|
||||
b.HasIndex("OwnerUserId", "SourceType", "SourceId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("AiUsageRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("JobTrackerApi.Models.AiWorkspaceNote", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
||||
Reference in New Issue
Block a user