Adds per-library consumption settings to the domain, storage, and API

This commit is contained in:
BinaryAlley committed 2026-10-24 10:20:00 +03:00
1 parent eaca69bf2a
commit b2d274f609
47 files changed
+4371 -11

No files matched your search

@@ -60,6 +60,8 @@ public class LibraryConfigurationTests
IProperty libraryTypeProperty = entityType.GetProperty(nameof(LibraryEntity.LibraryType));
IProperty isEnabledProperty = entityType.GetProperty(nameof(LibraryEntity.IsEnabled));
IProperty downloadMetadataProperty = entityType.GetProperty(nameof(LibraryEntity.CanDownloadMetadataFromWeb));
IProperty shouldTrackConsumptionProgressProperty = entityType.GetProperty(nameof(LibraryEntity.ShouldTrackConsumptionProgress));
IProperty completionThresholdPercentageProperty = entityType.GetProperty(nameof(LibraryEntity.CompletionThresholdPercentage));
// Assert
Assert.False(titleProperty.IsNullable);
@@ -68,6 +70,8 @@ public class LibraryConfigurationTests
Assert.Equal("TEXT", libraryTypeProperty.GetColumnType());
Assert.Equal(true, isEnabledProperty.GetDefaultValue());
Assert.Equal(true, downloadMetadataProperty.GetDefaultValue());
Assert.Equal(false, shouldTrackConsumptionProgressProperty.GetDefaultValue());
Assert.True(completionThresholdPercentageProperty.IsNullable);
}
[Fact]
@@ -86,6 +90,21 @@ public class LibraryConfigurationTests
Assert.Equal(11, fingerprintProperty.GetColumnOrder());
}
[Fact]
public void Configure_WhenApplied_ShouldConfigureConsumptionSettingsColumnOrders()
{
// Arrange
IEntityType entityType = DesignTimeModel.FindEntityType(typeof(LibraryEntity))!;
// Act
IProperty shouldTrackProperty = entityType.GetProperty(nameof(LibraryEntity.ShouldTrackConsumptionProgress));
IProperty completionThresholdProperty = entityType.GetProperty(nameof(LibraryEntity.CompletionThresholdPercentage));
// Assert
Assert.Equal(16, shouldTrackProperty.GetColumnOrder());
Assert.Equal(17, completionThresholdProperty.GetColumnOrder());
}
[Fact]
public void Configure_WhenApplied_ShouldConfigureOwnedContentLocations()
{