using Jiaowu.Api.Domain.Common;

namespace Jiaowu.Api.Domain.Academic;

public sealed class DegreeAwardBatch : EntityBase
{
    public required string Name { get; set; }
    public int GraduationYear { get; set; }
    public required string DegreeName { get; set; }
    public decimal MinimumGradePoint { get; set; } = 2.0m;
    public DegreeAwardBatchStatus Status { get; set; } = DegreeAwardBatchStatus.Draft;
    public string? Notes { get; set; }
    public DateTime? CalculatedAt { get; set; }
    public DateTime? PublishedAt { get; set; }
    public ICollection<DegreeAwardResult> Results { get; set; } = [];
}

public sealed class DegreeAwardResult : EntityBase
{
    public Guid DegreeAwardBatchId { get; set; }
    public DegreeAwardBatch? DegreeAwardBatch { get; set; }
    public Guid StudentId { get; set; }
    public Student? Student { get; set; }
    public Guid GraduationAuditResultId { get; set; }
    public GraduationAuditResult? GraduationAuditResult { get; set; }
    public decimal AverageGradePoint { get; set; }
    public DegreeAwardConclusion CalculatedConclusion { get; set; }
    public DegreeAwardConclusion Conclusion { get; set; }
    public required string ExceptionReason { get; set; }
    public bool IsOverridden { get; set; }
    public string? ReviewComment { get; set; }
    public DateTime? ReviewedAt { get; set; }
}

public enum DegreeAwardBatchStatus
{
    Draft = 1,
    Published = 2
}

public enum DegreeAwardConclusion
{
    NotGranted = 1,
    Granted = 2
}
