namespace KArtSell.Modules.ModelOperations.ApprovalWorkflow; using System; using System.Collections.Generic; public class ApprovalProposal { public Guid Id { get; set; } public Guid ModelId { get; set; } public ApprovalStatus Status { get; set; } public string CreatedBy { get; set; } = null!; public DateTimeOffset CreatedAt { get; set; } public string Justification { get; set; } = null!; public DateOnly EffectiveAt { get; set; } public DateTimeOffset? ProposedAt { get; set; } public string? ApprovedBy { get; set; } public DateTimeOffset? ApprovedAt { get; set; } public string? ApprovalNotes { get; set; } public string? ActivatedBy { get; set; } public DateTimeOffset? ActivatedAt { get; set; } public DateTimeOffset PublishedAt { get; set; } public int Revision { get; set; } public Guid CorrelationId { get; set; } public List Evidence { get; set; } = []; public List Events { get; set; } = []; public bool CanBeProposed => Status == ApprovalStatus.Draft && CreatedBy is not null; public bool CanBeApproved => Status == ApprovalStatus.Proposed; public bool CanBeActivated => Status == ApprovalStatus.Approved; } public enum ApprovalStatus { Draft, Proposed, Approved, Active, Rejected } public class ApprovalEvidence { public Guid Id { get; set; } public Guid ApprovalProposalId { get; set; } public string EvidenceType { get; set; } = null!; public string EvidenceUrl { get; set; } = null!; public string? ReviewerComment { get; set; } public DateTimeOffset PublishedAt { get; set; } public Guid CorrelationId { get; set; } } public class ApprovalEvent { public Guid Id { get; set; } public Guid ApprovalProposalId { get; set; } public string EventType { get; set; } = null!; public string ActorEmail { get; set; } = null!; public DateTimeOffset EventAt { get; set; } public Dictionary? Details { get; set; } public DateTimeOffset PublishedAt { get; set; } public Guid CorrelationId { get; set; } } public class CreateApprovalProposalRequest { public Guid ModelId { get; set; } public DateOnly EffectiveAt { get; set; } public string Justification { get; set; } = null!; } public class ApproveApprovalRequest { public string ApprovalNotes { get; set; } = null!; public List Evidence { get; set; } = []; } public class EvidenceItem { public string Type { get; set; } = null!; public string Url { get; set; } = null!; public string? Comment { get; set; } } public class ApprovalProposalResponse { public Guid Id { get; set; } public Guid ModelId { get; set; } public string Status { get; set; } = null!; public string CreatedBy { get; set; } = null!; public DateTimeOffset CreatedAt { get; set; } public string Justification { get; set; } = null!; public DateOnly EffectiveAt { get; set; } public string? ApprovedBy { get; set; } public DateTimeOffset? ApprovedAt { get; set; } public string? ApprovalNotes { get; set; } public List Evidence { get; set; } = []; } public class ApprovalEvidenceResponse { public Guid Id { get; set; } public string EvidenceType { get; set; } = null!; public string EvidenceUrl { get; set; } = null!; public string? ReviewerComment { get; set; } }