< Summary

Information
Class: Elsa.AI.Abstractions.Models.AIValidationDiagnostic
Assembly: Elsa.AI.Abstractions
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Abstractions/Models/AIProposal.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 63
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Code()100%210%
get_Message()100%210%
get_Severity()100%210%
get_Path()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Abstractions/Models/AIProposal.cs

#LineLine coverage
 1namespace Elsa.AI.Abstractions.Models;
 2
 3public record AIProposal
 4{
 5    public string Id { get; init; } = Guid.NewGuid().ToString("N");
 6    public string? TenantId { get; init; }
 7    public string ConversationId { get; init; } = "";
 8    public AIProposalKind Kind { get; init; }
 9    public AIProposalStatus Status { get; init; } = AIProposalStatus.Draft;
 10    public string? BaselineWorkflowDefinitionId { get; init; }
 11    public string? BaselineVersionId { get; init; }
 12    public JsonObject WorkflowPayload { get; init; } = [];
 13    public string Rationale { get; init; } = "";
 14    public ICollection<string> Warnings { get; init; } = [];
 15    public ICollection<AIValidationDiagnostic> ValidationDiagnostics { get; init; } = [];
 16    public AIGraphDiff? GraphDiff { get; init; }
 17    public string CreatedBy { get; init; } = "";
 18    public DateTimeOffset CreatedAt { get; init; } = DateTimeOffset.UtcNow;
 19    public string? ReviewedBy { get; init; }
 20    public DateTimeOffset? ReviewedAt { get; init; }
 21    public string? AppliedBy { get; init; }
 22    public DateTimeOffset? AppliedAt { get; init; }
 23}
 24
 25public record AIValidationDiagnostic
 26{
 027    public string Code { get; init; } = default!;
 028    public string Message { get; init; } = "";
 029    public AIValidationSeverity Severity { get; init; } = AIValidationSeverity.Warning;
 030    public string? Path { get; init; }
 31}
 32
 33public record AIGraphDiff
 34{
 35    public ICollection<string> AddedActivityIds { get; init; } = [];
 36    public ICollection<string> RemovedActivityIds { get; init; } = [];
 37    public ICollection<string> ChangedActivityIds { get; init; } = [];
 38    public JsonObject Data { get; init; } = [];
 39}
 40
 41public enum AIProposalKind
 42{
 43    WorkflowCreate,
 44    WorkflowUpdate
 45}
 46
 47public enum AIProposalStatus
 48{
 49    Draft,
 50    Validated,
 51    Blocked,
 52    Approved,
 53    Rejected,
 54    Applied,
 55    Expired
 56}
 57
 58public enum AIValidationSeverity
 59{
 60    Information,
 61    Warning,
 62    Error
 63}