using Tiku.Domain.Content; namespace Tiku.Application.Content; public sealed record PublishContentReleaseCommand( Guid TenantId, Guid ActorUserId, Guid CurriculumVersionId, string Name); public sealed record ContentReleaseCompilationResult( Guid ContentReleaseId, int ReleaseNo, int PlacementCount, int QuestionCount, int AudienceSegmentCount, int TargetProfileCount, string SourceFingerprint, DateTimeOffset PublishedAt); public interface IContentReleaseCompiler { Task PublishAsync( PublishContentReleaseCommand command, CancellationToken cancellationToken = default); } public sealed record ContentCandidateQuery( Guid ContentOwnerTenantId, IReadOnlyCollection ContentReleaseIds, IReadOnlyCollection AudienceSegmentIds, Guid? CurriculumNodeId, IReadOnlyCollection? CollectionReleaseIds, int Limit, int Seed, string? QuestionType = null, int? Difficulty = null); public sealed record ContentCandidateItem( Guid ContentReleaseQuestionId, Guid ContentOwnerTenantId, Guid ContentReleaseId, Guid AudienceSegmentId, Guid CurriculumNodeId, Guid QuestionPlacementId, Guid QuestionAssetOwnerTenantId, Guid QuestionAssetId, Guid QuestionRevisionId, Guid AssessmentPolicyVersionId, int Ordinal, int? Difficulty, string QuestionType); public interface IContentCandidateReader { Task> GetCandidatesAsync( ContentCandidateQuery query, CancellationToken cancellationToken = default); } public sealed record ApplyPlatformContentPackageCommand( Guid PackageOwnerTenantId, Guid PlatformContentPackageVersionId, string PackageCode, string CellId, long EventSequence, string ContentHash); public enum CellPackageApplyStatus { Applied, Duplicate, IgnoredOutOfOrder } public sealed record CellPackageApplyResult( CellPackageApplyStatus Status, Guid PlatformContentPackageVersionId, string CellId, long EventSequence, string ContentHash); public interface IPlatformContentPackageProjectionService { Task ApplyAsync( ApplyPlatformContentPackageCommand command, CancellationToken cancellationToken = default); } public sealed class ContentV2Exception(string code, string message) : Exception(message) { public string Code { get; } = code; }