feat(data): add usage gate thresholds and task run model column
Adds AppSettings.UsageGateFiveHourPct/UsageGateSevenDayPct (defaults 80/90, clamped 0..100 in UpdateAsync) and a nullable TaskRunEntity.Model column, laying the data foundation for the usage monitor. No worker/UI changes.
This commit is contained in:
@@ -47,6 +47,11 @@ public class AppSettingsEntityConfiguration : IEntityTypeConfiguration<AppSettin
|
||||
builder.Property(s => s.SessionSkills).HasColumnName("session_skills");
|
||||
builder.Property(s => s.ModelPresets).HasColumnName("model_presets");
|
||||
|
||||
builder.Property(s => s.UsageGateFiveHourPct)
|
||||
.HasColumnName("usage_gate_five_hour_pct").IsRequired().HasDefaultValue(80);
|
||||
builder.Property(s => s.UsageGateSevenDayPct)
|
||||
.HasColumnName("usage_gate_seven_day_pct").IsRequired().HasDefaultValue(90);
|
||||
|
||||
builder.HasData(new AppSettingsEntity { Id = AppSettingsEntity.SingletonId });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public class TaskRunEntityConfiguration : IEntityTypeConfiguration<TaskRunEntity
|
||||
builder.Property(r => r.LogPath).HasColumnName("log_path");
|
||||
builder.Property(r => r.StartedAt).HasColumnName("started_at");
|
||||
builder.Property(r => r.FinishedAt).HasColumnName("finished_at");
|
||||
builder.Property(r => r.Model).HasColumnName("model");
|
||||
|
||||
builder.HasOne(r => r.Task)
|
||||
.WithMany(t => t.Runs)
|
||||
|
||||
Reference in New Issue
Block a user