Add data-driven dynamic question mode
This commit is contained in:
@@ -79,6 +79,35 @@ public class QuestionReportStore
|
||||
return report;
|
||||
}
|
||||
|
||||
public async Task<QuestionReport> CreateDynamicAsync(
|
||||
DynamicGenerationClaims claims,
|
||||
string userId,
|
||||
string category,
|
||||
string details)
|
||||
{
|
||||
var now = DateTime.UtcNow;
|
||||
var report = new QuestionReport
|
||||
{
|
||||
QuestionExternalId = $"dynamic:{claims.BlueprintExternalId}:v{claims.BlueprintVersion}",
|
||||
UserId = userId,
|
||||
Category = category,
|
||||
Details = details,
|
||||
Status = QuestionReportStatus.Open,
|
||||
SourceType = "dynamic",
|
||||
DynamicGeneration = new DynamicGenerationDescriptor
|
||||
{
|
||||
BlueprintExternalId = claims.BlueprintExternalId,
|
||||
BlueprintVersion = claims.BlueprintVersion,
|
||||
GeneratorVersion = claims.GeneratorVersion,
|
||||
Seed = claims.Seed
|
||||
},
|
||||
CreatedUtc = now,
|
||||
UpdatedUtc = now
|
||||
};
|
||||
await _reports.InsertOneAsync(report);
|
||||
return report;
|
||||
}
|
||||
|
||||
public async Task<QuestionReport?> GetByIdAsync(string id)
|
||||
{
|
||||
if (!ObjectId.TryParse(id, out _))
|
||||
|
||||
Reference in New Issue
Block a user