94 lines
2.4 KiB
C#
94 lines
2.4 KiB
C#
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<ContentReleaseCompilationResult> PublishAsync(
|
|
PublishContentReleaseCommand command,
|
|
CancellationToken cancellationToken = default);
|
|
}
|
|
|
|
public sealed record ContentCandidateQuery(
|
|
Guid ContentOwnerTenantId,
|
|
IReadOnlyCollection<Guid> ContentReleaseIds,
|
|
IReadOnlyCollection<Guid> AudienceSegmentIds,
|
|
Guid? CurriculumNodeId,
|
|
IReadOnlyCollection<Guid>? 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<IReadOnlyCollection<ContentCandidateItem>> 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<CellPackageApplyResult> ApplyAsync(
|
|
ApplyPlatformContentPackageCommand command,
|
|
CancellationToken cancellationToken = default);
|
|
}
|
|
|
|
public sealed class ContentV2Exception(string code, string message) : Exception(message)
|
|
{
|
|
public string Code { get; } = code;
|
|
}
|