126 lines
3.8 KiB
C#
126 lines
3.8 KiB
C#
using Tiku.Domain.Learning;
|
|
|
|
namespace Tiku.Application.Learning;
|
|
|
|
public sealed record LearningDictionaryItem(
|
|
Guid Id,
|
|
string Code,
|
|
string Name,
|
|
string? Kind,
|
|
bool IsActive,
|
|
bool? RequiresBaseRegion = null,
|
|
int? TargetRegionCooldownDays = null);
|
|
|
|
public sealed record UpsertBusinessLineCommand(
|
|
Guid? Id,
|
|
string Code,
|
|
string Name,
|
|
LearningRegionAccessStrategy RegionAccessStrategy,
|
|
bool RequiresBaseRegion,
|
|
int TargetRegionCooldownDays,
|
|
bool IsActive);
|
|
|
|
public sealed record UpsertMarketRegionCommand(
|
|
Guid? Id,
|
|
string Code,
|
|
string Name,
|
|
string? ParentCode,
|
|
bool IsActive);
|
|
|
|
public sealed record TenantLearningLicenseItem(
|
|
Guid Id,
|
|
Guid TenantId,
|
|
Guid BusinessLineId,
|
|
bool IsPrimary,
|
|
bool IncludesNational,
|
|
bool AllowsAnyTargetRegion,
|
|
LearningLicenseStatus Status,
|
|
DateTimeOffset StartsAt,
|
|
DateTimeOffset? EndsAt,
|
|
long Version,
|
|
IReadOnlyCollection<Guid> MarketRegionIds);
|
|
|
|
public sealed record UpsertTenantLearningLicenseCommand(
|
|
Guid TenantId,
|
|
Guid? Id,
|
|
Guid BusinessLineId,
|
|
bool IsPrimary,
|
|
bool IncludesNational,
|
|
bool AllowsAnyTargetRegion,
|
|
LearningLicenseStatus Status,
|
|
DateTimeOffset StartsAt,
|
|
DateTimeOffset? EndsAt,
|
|
IReadOnlyCollection<Guid> MarketRegionIds,
|
|
Guid? BaseMarketRegionId);
|
|
|
|
public sealed record ContentSliceItem(
|
|
Guid Id,
|
|
Guid TenantId,
|
|
Guid BusinessLineId,
|
|
Guid? MarketRegionId,
|
|
LearningRegionScopeKind RegionScope,
|
|
LearningContentResourceType ResourceType,
|
|
Guid ResourceId,
|
|
long ContentVersion,
|
|
ContentSliceStatus Status);
|
|
|
|
public sealed record UpsertContentSliceCommand(
|
|
Guid TenantId,
|
|
Guid? Id,
|
|
Guid BusinessLineId,
|
|
Guid? MarketRegionId,
|
|
LearningRegionScopeKind RegionScope,
|
|
LearningContentResourceType ResourceType,
|
|
Guid ResourceId,
|
|
ContentSliceStatus Status);
|
|
|
|
public sealed record LearningProductItem(
|
|
Guid Id,
|
|
Guid TenantId,
|
|
Guid BusinessLineId,
|
|
string Code,
|
|
string Name,
|
|
bool IsActive,
|
|
IReadOnlyCollection<Guid> ContentSliceIds);
|
|
|
|
public sealed record UpsertLearningProductCommand(
|
|
Guid TenantId,
|
|
Guid? Id,
|
|
Guid BusinessLineId,
|
|
string Code,
|
|
string Name,
|
|
bool IsActive,
|
|
IReadOnlyCollection<Guid> ContentSliceIds);
|
|
|
|
public interface IPlatformLearningAccessAdministrationService
|
|
{
|
|
Task<IReadOnlyCollection<LearningDictionaryItem>> GetBusinessLinesAsync(
|
|
CancellationToken cancellationToken = default);
|
|
Task<LearningDictionaryItem> UpsertBusinessLineAsync(
|
|
UpsertBusinessLineCommand command,
|
|
CancellationToken cancellationToken = default);
|
|
Task<IReadOnlyCollection<LearningDictionaryItem>> GetMarketRegionsAsync(
|
|
CancellationToken cancellationToken = default);
|
|
Task<LearningDictionaryItem> UpsertMarketRegionAsync(
|
|
UpsertMarketRegionCommand command,
|
|
CancellationToken cancellationToken = default);
|
|
Task<TenantLearningLicenseItem?> GetTenantLicenseAsync(
|
|
Guid tenantId,
|
|
CancellationToken cancellationToken = default);
|
|
Task<TenantLearningLicenseItem> UpsertTenantLicenseAsync(
|
|
UpsertTenantLearningLicenseCommand command,
|
|
CancellationToken cancellationToken = default);
|
|
Task<IReadOnlyCollection<ContentSliceItem>> GetContentSlicesAsync(
|
|
Guid tenantId,
|
|
CancellationToken cancellationToken = default);
|
|
Task<ContentSliceItem> UpsertContentSliceAsync(
|
|
UpsertContentSliceCommand command,
|
|
CancellationToken cancellationToken = default);
|
|
Task<IReadOnlyCollection<LearningProductItem>> GetProductsAsync(
|
|
Guid tenantId,
|
|
CancellationToken cancellationToken = default);
|
|
Task<LearningProductItem> UpsertProductAsync(
|
|
UpsertLearningProductCommand command,
|
|
CancellationToken cancellationToken = default);
|
|
}
|