137 lines
4.5 KiB
C#
137 lines
4.5 KiB
C#
using System.Text.Json;
|
|
using Tiku.Domain.Common;
|
|
|
|
namespace Tiku.Domain.Content;
|
|
|
|
public sealed class ContentRelease : AuditableTenantEntity
|
|
{
|
|
public Guid BusinessLineId { get; set; }
|
|
public Guid CurriculumVersionId { get; set; }
|
|
public int ReleaseNo { get; set; } = 1;
|
|
public string Name { get; set; } = string.Empty;
|
|
public ContentReleaseStatus Status { get; set; } = ContentReleaseStatus.Draft;
|
|
public string CompilerVersion { get; set; } = "content-v2";
|
|
public string SourceFingerprint { get; set; } = string.Empty;
|
|
public DateTimeOffset? PublishedAt { get; set; }
|
|
public Guid? CreatedBy { get; set; }
|
|
}
|
|
|
|
public sealed class AudienceSegment : Entity, ITenantOwned
|
|
{
|
|
public Guid ContentReleaseId { get; set; }
|
|
public string RuleHash { get; set; } = string.Empty;
|
|
public int SegmentOrdinal { get; set; }
|
|
public Guid TenantId { get; set; }
|
|
}
|
|
|
|
public sealed class AudienceSegmentMember : Entity, ITenantOwned
|
|
{
|
|
public Guid ContentReleaseId { get; set; }
|
|
public Guid AudienceSegmentId { get; set; }
|
|
public Guid ExamTargetProfileVersionId { get; set; }
|
|
public Guid TenantId { get; set; }
|
|
}
|
|
|
|
public sealed class ContentReleaseQuestion : Entity, ITenantOwned
|
|
{
|
|
public Guid ContentReleaseId { get; set; }
|
|
public Guid AudienceSegmentId { get; set; }
|
|
public Guid CurriculumNodeId { get; set; }
|
|
public Guid QuestionPlacementId { get; set; }
|
|
public Guid QuestionAssetOwnerTenantId { get; set; }
|
|
public Guid QuestionAssetId { get; set; }
|
|
public Guid QuestionRevisionId { get; set; }
|
|
public Guid AssessmentPolicyVersionId { get; set; }
|
|
public int Ordinal { get; set; }
|
|
public int? Difficulty { get; set; }
|
|
public string QuestionType { get; set; } = "choice";
|
|
public ContentReleaseQuestionStatus Status { get; set; } = ContentReleaseQuestionStatus.Active;
|
|
public Guid TenantId { get; set; }
|
|
}
|
|
|
|
public sealed class CollectionRelease : AuditableTenantEntity
|
|
{
|
|
public Guid ContentReleaseId { get; set; }
|
|
public Guid SourceCollectionId { get; set; }
|
|
public int VersionNo { get; set; } = 1;
|
|
public string Name { get; set; } = string.Empty;
|
|
public ContentReleaseStatus Status { get; set; } = ContentReleaseStatus.Draft;
|
|
public DateTimeOffset? PublishedAt { get; set; }
|
|
}
|
|
|
|
public sealed class CollectionReleaseQuestion : Entity, ITenantOwned
|
|
{
|
|
public Guid CollectionReleaseId { get; set; }
|
|
public Guid ContentReleaseQuestionId { get; set; }
|
|
public int SortOrder { get; set; }
|
|
public decimal? Score { get; set; }
|
|
public bool Required { get; set; } = true;
|
|
public Guid TenantId { get; set; }
|
|
}
|
|
|
|
public sealed class BlueprintRelease : AuditableTenantEntity
|
|
{
|
|
public Guid ContentReleaseId { get; set; }
|
|
public Guid? CollectionReleaseId { get; set; }
|
|
public Guid SourceBlueprintId { get; set; }
|
|
public Guid ExamPaperSpecificationVersionId { get; set; }
|
|
public int VersionNo { get; set; } = 1;
|
|
public string Name { get; set; } = string.Empty;
|
|
public JsonElement AssemblyRules { get; set; } = JsonDefaults.Object();
|
|
public ContentReleaseStatus Status { get; set; } = ContentReleaseStatus.Draft;
|
|
public DateTimeOffset? PublishedAt { get; set; }
|
|
}
|
|
|
|
public sealed class PlatformContentPackageVersion : AuditableTenantEntity
|
|
{
|
|
public string PackageCode { get; set; } = string.Empty;
|
|
public int VersionNo { get; set; } = 1;
|
|
public Guid BusinessLineId { get; set; }
|
|
public Guid ContentReleaseId { get; set; }
|
|
public string ContentHash { get; set; } = string.Empty;
|
|
public PlatformContentPackageStatus Status { get; set; } = PlatformContentPackageStatus.Draft;
|
|
public DateTimeOffset? PublishedAt { get; set; }
|
|
}
|
|
|
|
public sealed class PlatformContentPackageCellProjection : Entity
|
|
{
|
|
public Guid PackageOwnerTenantId { get; set; }
|
|
public string PackageCode { get; set; } = string.Empty;
|
|
public Guid PlatformContentPackageVersionId { get; set; }
|
|
public string CellId { get; set; } = string.Empty;
|
|
public long EventSequence { get; set; }
|
|
public string ContentHash { get; set; } = string.Empty;
|
|
public CellProjectionStatus Status { get; set; } = CellProjectionStatus.Pending;
|
|
public DateTimeOffset? ProjectedAt { get; set; }
|
|
public string? LastError { get; set; }
|
|
}
|
|
|
|
public enum ContentReleaseStatus
|
|
{
|
|
Draft,
|
|
Compiling,
|
|
Published,
|
|
Retired,
|
|
Failed
|
|
}
|
|
|
|
public enum ContentReleaseQuestionStatus
|
|
{
|
|
Active,
|
|
Retired
|
|
}
|
|
|
|
public enum PlatformContentPackageStatus
|
|
{
|
|
Draft,
|
|
Published,
|
|
Retired
|
|
}
|
|
|
|
public enum CellProjectionStatus
|
|
{
|
|
Pending,
|
|
Ready,
|
|
Failed
|
|
}
|