diff --git a/plugins/Lumina.Plugins.OpenLibrary/Core/Mapping/OpenLibraryMapper.cs b/plugins/Lumina.Plugins.OpenLibrary/Core/Mapping/OpenLibraryMapper.cs index 94f19e72..bd94a8b0 100644 --- a/plugins/Lumina.Plugins.OpenLibrary/Core/Mapping/OpenLibraryMapper.cs +++ b/plugins/Lumina.Plugins.OpenLibrary/Core/Mapping/OpenLibraryMapper.cs @@ -5,6 +5,7 @@ using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary; using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; using Lumina.Plugins.OpenLibrary.Common.Models.Contracts.Responses; using System; @@ -110,7 +111,7 @@ internal static partial class OpenLibraryMapper originalYear, editionRelease.Date, editionRelease.Date?.Year ?? editionRelease.Year, - NullIfWhiteSpace(releaseCountry), + MapReleaseCountry(releaseCountry), NullIfWhiteSpace(releaseVersion)), [.. genreNames.Select(name => new GenreDto(name))], [.. subjects.Select(name => new TagDto(name))], @@ -332,6 +333,19 @@ internal static partial class OpenLibraryMapper return culture is null ? new LanguageInfoDto(code, code, null) : new LanguageInfoDto(culture.TwoLetterISOLanguageName, culture.EnglishName, culture.NativeName); } + /// + /// Maps a country string into a release country. + /// + /// The country string to map. + /// The mapped release country, or when the string is empty or is not a known ISO 3166-1 alpha-2 code. + private static ReleaseCountry? MapReleaseCountry(string? rawCountry) + { + string? value = NullIfWhiteSpace(rawCountry); + if (value is null) + return null; + return Enum.TryParse(value, ignoreCase: true, out ReleaseCountry releaseCountry) ? releaseCountry : null; + } + /// /// Maps a series string into a book series DTO. /// diff --git a/src/Lumina.Application/Common/DataAccess/Entities/MediaLibrary/WrittenContentLibrary/BookLibrary/BookEntity.cs b/src/Lumina.Application/Common/DataAccess/Entities/MediaLibrary/WrittenContentLibrary/BookLibrary/BookEntity.cs index f43a92d8..5bb5dabe 100644 --- a/src/Lumina.Application/Common/DataAccess/Entities/MediaLibrary/WrittenContentLibrary/BookLibrary/BookEntity.cs +++ b/src/Lumina.Application/Common/DataAccess/Entities/MediaLibrary/WrittenContentLibrary/BookLibrary/BookEntity.cs @@ -2,6 +2,7 @@ using Lumina.Application.Common.DataAccess.Entities.Common; using Lumina.Application.Common.DataAccess.Entities.MediaContributors; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics; @@ -69,7 +70,7 @@ public class BookEntity : IStorageEntity, IAuditableEntity /// /// Gets or sets the optional country or region of release. /// - public string? ReleaseCountry { get; set; } + public ReleaseCountry? ReleaseCountry { get; set; } /// /// Gets or sets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0") diff --git a/src/Lumina.Application/Common/Mapping/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookEntityMapping.cs b/src/Lumina.Application/Common/Mapping/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookEntityMapping.cs index 0ef8978f..25152210 100644 --- a/src/Lumina.Application/Common/Mapping/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookEntityMapping.cs +++ b/src/Lumina.Application/Common/Mapping/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookEntityMapping.cs @@ -16,6 +16,7 @@ using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Boo using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects; using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.ExternalIdentifiers.LibraryManagementBoundedContext.LibraryAggregate; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary; using System; using System.Collections.Generic; @@ -63,7 +64,7 @@ public static class BookEntityMapping Optional.FromNullable(repositoryEntity.OriginalReleaseYear), Optional.FromNullable(repositoryEntity.ReReleaseDate), Optional.FromNullable(repositoryEntity.ReReleaseYear), - Optional.FromNullable(repositoryEntity.ReleaseCountry), + Optional.FromNullable(repositoryEntity.ReleaseCountry), Optional.FromNullable(repositoryEntity.ReleaseVersion) ); if (releaseInfoResult.IsFailure) diff --git a/src/Lumina.Application/Common/Mapping/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookMetadataDtoMapping.cs b/src/Lumina.Application/Common/Mapping/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookMetadataDtoMapping.cs index 2b7d8206..03593d83 100644 --- a/src/Lumina.Application/Common/Mapping/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookMetadataDtoMapping.cs +++ b/src/Lumina.Application/Common/Mapping/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookMetadataDtoMapping.cs @@ -6,6 +6,7 @@ using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Boo using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Entities; using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Linq; @@ -36,7 +37,7 @@ public static class BookMetadataDtoMapping Optional.FromNullable(metadata.ReleaseInfo.OriginalReleaseYear), Optional.FromNullable(metadata.ReleaseInfo.ReReleaseDate), Optional.FromNullable(metadata.ReleaseInfo.ReReleaseYear), - Optional.FromNullable(metadata.ReleaseInfo.ReleaseCountry), + Optional.FromNullable(metadata.ReleaseInfo.ReleaseCountry), Optional.FromNullable(metadata.ReleaseInfo.ReleaseVersion) ); if (releaseInfoResult.IsFailure) diff --git a/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandHandler.cs b/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandHandler.cs index fa7e7e5c..a1946a34 100644 --- a/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandHandler.cs +++ b/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandHandler.cs @@ -18,6 +18,7 @@ using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Boo using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects; using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.ExternalIdentifiers.LibraryManagementBoundedContext.LibraryAggregate; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; using System; using System.Collections.Generic; @@ -122,7 +123,7 @@ public class AddBookCommandHandler : ICommandHandler.FromNullable(command.Metadata.ReleaseInfo.OriginalReleaseYear), Optional.FromNullable(command.Metadata.ReleaseInfo.ReReleaseDate), Optional.FromNullable(command.Metadata.ReleaseInfo.ReReleaseYear), - Optional.FromNullable(command.Metadata.ReleaseInfo.ReleaseCountry), + Optional.FromNullable(command.Metadata.ReleaseInfo!.ReleaseCountry), Optional.FromNullable(command.Metadata.ReleaseInfo.ReleaseVersion) ); if (releaseInfoResult.IsFailure) diff --git a/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandValidator.cs b/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandValidator.cs index 498de529..e782bded 100644 --- a/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandValidator.cs +++ b/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandValidator.cs @@ -64,11 +64,6 @@ public class AddBookCommandValidator : AbstractValidator .When(r => r!.ReReleaseYear.HasValue) .WithError(Errors.Metadata.ReReleaseYearMustBeBetween1And9999); - releaseInfo.RuleFor(r => r!.ReleaseCountry) - .Matches("^[A-Za-z]{2}$") - .When(r => r!.ReleaseCountry is not null) - .WithError(Errors.Metadata.CountryCodeMustBe2CharactersLong); - releaseInfo.RuleFor(r => r!.ReleaseVersion) .MaximumLength(50) .When(r => r!.ReleaseVersion is not null) diff --git a/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/UpdateBook/UpdateBookCommandValidator.cs b/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/UpdateBook/UpdateBookCommandValidator.cs index 1d57e744..3f3de404 100644 --- a/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/UpdateBook/UpdateBookCommandValidator.cs +++ b/src/Lumina.Application/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/UpdateBook/UpdateBookCommandValidator.cs @@ -60,11 +60,6 @@ public class UpdateBookCommandValidator : AbstractValidator .When(r => r!.ReReleaseYear.HasValue) .WithError(Errors.Metadata.ReReleaseYearMustBeBetween1And9999); - releaseInfo.RuleFor(r => r!.ReleaseCountry) - .Matches("^[A-Za-z]{2}$") - .When(r => r!.ReleaseCountry is not null) - .WithError(Errors.Metadata.CountryCodeMustBe2CharactersLong); - releaseInfo.RuleFor(r => r!.ReleaseVersion) .MaximumLength(50) .When(r => r!.ReleaseVersion is not null) diff --git a/src/Lumina.Contracts/DTO/Common/ReleaseInfoDto.cs b/src/Lumina.Contracts/DTO/Common/ReleaseInfoDto.cs index 7738b2e2..da9c87ed 100644 --- a/src/Lumina.Contracts/DTO/Common/ReleaseInfoDto.cs +++ b/src/Lumina.Contracts/DTO/Common/ReleaseInfoDto.cs @@ -1,4 +1,5 @@ #region ========================================================================= USING ===================================================================================== +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Diagnostics; #endregion @@ -20,6 +21,6 @@ public record ReleaseInfoDto( int? OriginalReleaseYear, DateOnly? ReReleaseDate, int? ReReleaseYear, - string? ReleaseCountry, + ReleaseCountry? ReleaseCountry, string? ReleaseVersion ); diff --git a/src/Lumina.DataAccess/Common/Configuration/BookConfiguration.cs b/src/Lumina.DataAccess/Common/Configuration/BookConfiguration.cs index 0512ef27..cc710012 100644 --- a/src/Lumina.DataAccess/Common/Configuration/BookConfiguration.cs +++ b/src/Lumina.DataAccess/Common/Configuration/BookConfiguration.cs @@ -45,6 +45,8 @@ public class BookConfiguration : IEntityTypeConfiguration builder.Property(book => book.ReReleaseYear) .HasColumnOrder(7); builder.Property(book => book.ReleaseCountry) + .HasConversion() + .HasMaxLength(2) .HasColumnOrder(8); builder.Property(book => book.ReleaseVersion) .HasColumnOrder(9); diff --git a/src/Lumina.DataAccess/Common/Migrations/20260907140842_AddsReleaseCountryEnum.Designer.cs b/src/Lumina.DataAccess/Common/Migrations/20260907140842_AddsReleaseCountryEnum.Designer.cs new file mode 100644 index 00000000..d4a03ace --- /dev/null +++ b/src/Lumina.DataAccess/Common/Migrations/20260907140842_AddsReleaseCountryEnum.Designer.cs @@ -0,0 +1,1793 @@ +// +using System; +using Lumina.DataAccess.Core.UoW; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Lumina.DataAccess.Common.Migrations +{ + [DbContext(typeof(LuminaDbContext))] + [Migration("20260907140842_AddsReleaseCountryEnum")] + partial class AddsReleaseCountryEnum + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.11"); + + modelBuilder.Entity("BookGenres", b => + { + b.Property("BookId") + .HasColumnType("TEXT"); + + b.Property("GenreId") + .HasColumnType("TEXT"); + + b.HasKey("BookId", "GenreId"); + + b.HasIndex("GenreId"); + + b.ToTable("BookGenres", (string)null); + }); + + modelBuilder.Entity("BookTags", b => + { + b.Property("BookId") + .HasColumnType("TEXT"); + + b.Property("TagId") + .HasColumnType("TEXT"); + + b.HasKey("BookId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("BookTags", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("PermissionName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.HasKey("Id"); + + b.ToTable("Permissions", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.HasKey("Id"); + + b.ToTable("Roles", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RolePermissionEntity", b => + { + b.Property("RoleId") + .HasColumnType("TEXT"); + + b.Property("PermissionId") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.HasKey("RoleId", "PermissionId"); + + b.HasIndex("PermissionId"); + + b.HasIndex("RoleId", "PermissionId") + .IsUnique(); + + b.ToTable("RolePermissions", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserPermissionEntity", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("PermissionId") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.HasKey("UserId", "PermissionId"); + + b.HasIndex("PermissionId"); + + b.HasIndex("UserId", "PermissionId") + .IsUnique(); + + b.ToTable("UserPermissions", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserRoleEntity", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("RoleId") + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.HasKey("UserId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId", "RoleId") + .IsUnique(); + + b.ToTable("UserRoles", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Common.GenreEntity", b => + { + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Name"); + + b.ToTable("Genres", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Common.TagEntity", b => + { + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Name"); + + b.ToTable("Tags", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaContributors.BookContributorEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("BookId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("MediaContributorId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("RoleCategory") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.HasKey("Id"); + + b.HasIndex("MediaContributorId"); + + b.HasIndex("BookId", "MediaContributorId"); + + b.ToTable("BookContributors", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaContributors.MediaContributorEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Biography") + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("DateOfBirth") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("DateOfDeath") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1) + .UseCollation("NOCASE"); + + b.Property("LegalName") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.HasKey("Id"); + + b.HasIndex("DisplayName") + .IsUnique(); + + b.ToTable("MediaContributors", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.DirectoryScanFingerprintEntity", b => + { + b.Property("LibraryId") + .HasColumnType("TEXT"); + + b.Property("Path") + .HasMaxLength(1024) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("LastWriteTimeUtc") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.HasKey("LibraryId", "Path"); + + b.HasIndex("LibraryId"); + + b.ToTable("DirectoryScanFingerprints", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("ArtworkProvidersConfigurationFingerprint") + .HasMaxLength(64) + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("CanDownloadMetadataFromWeb") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true) + .HasColumnOrder(6); + + b.Property("CoverImage") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("IsEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true) + .HasColumnOrder(4); + + b.Property("IsLocked") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("LibraryType") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("MetadataProvidersConfigurationFingerprint") + .HasMaxLength(64) + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("ShouldSaveMetadataInMediaDirectories") + .HasColumnType("INTEGER") + .HasColumnOrder(7); + + b.Property("ShouldSkipUnchangedDirectoriesDuringScan") + .HasColumnType("INTEGER") + .HasColumnOrder(8); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Libraries", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("LibraryId") + .HasColumnType("TEXT"); + + b.Property("Status") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("LibraryId", "Status", "CreatedOnUtc") + .IsDescending(true, false, true); + + b.ToTable("LibraryScans", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanResultEntity", b => + { + b.Property("LibraryScanId") + .HasColumnType("TEXT"); + + b.Property("Path") + .HasMaxLength(1024) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("ContentHash") + .HasMaxLength(24) + .HasColumnType("INTEGER") + .HasColumnOrder(2); + + b.Property("FileSize") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Status") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("Ticks") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.HasKey("LibraryScanId", "Path"); + + b.HasIndex("Path"); + + b.HasIndex("ContentHash", "FileSize", "Path"); + + b.ToTable("LibraryScanResults", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanSnapshotEntity", b => + { + b.Property("LibraryId") + .HasColumnType("TEXT"); + + b.Property("Path") + .HasMaxLength(1024) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("ContentHash") + .HasColumnType("INTEGER") + .HasColumnOrder(2); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("FileSize") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Ticks") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.HasKey("LibraryId", "Path"); + + b.HasIndex("LibraryId"); + + b.ToTable("LibraryScanSnapshots", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanStagingResultsEntity", b => + { + b.Property("LibraryScanId") + .HasColumnType("TEXT"); + + b.Property("Path") + .HasMaxLength(1024) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("ContentHash") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("IsNew") + .HasColumnType("INTEGER") + .HasColumnOrder(7); + + b.Property("NeedsRehash") + .HasColumnType("INTEGER") + .HasColumnOrder(6); + + b.Property("PreviousContentHash") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("Size") + .HasColumnType("INTEGER") + .HasColumnOrder(2); + + b.Property("Ticks") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.HasKey("LibraryScanId", "Path"); + + b.HasIndex("LibraryScanId", "NeedsRehash"); + + b.ToTable("LibraryScanStagingResults", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookArtworkEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("ArtworkType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("BookId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("ContentHash") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("FileName") + .HasMaxLength(2048) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("LastUpdateUtc") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("Ordinal") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("Provider") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.HasKey("Id"); + + b.HasIndex("Status"); + + b.HasIndex("BookId", "ArtworkType", "Ordinal") + .IsUnique(); + + b.ToTable("BookArtwork", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("ASIN") + .HasMaxLength(10) + .HasColumnType("TEXT") + .HasColumnOrder(21); + + b.Property("AppleBooksId") + .HasColumnType("TEXT") + .HasColumnOrder(29); + + b.Property("BarnesAndNobleId") + .HasMaxLength(10) + .HasColumnType("TEXT") + .HasColumnOrder(28); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(33); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(32); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("Edition") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(19); + + b.Property("Format") + .HasColumnType("TEXT") + .HasColumnOrder(18); + + b.Property("GoodreadsId") + .HasColumnType("TEXT") + .HasColumnOrder(22); + + b.Property("GoogleBooksId") + .HasMaxLength(12) + .HasColumnType("TEXT") + .HasColumnOrder(27); + + b.Property("LCCN") + .HasColumnType("TEXT") + .HasColumnOrder(23); + + b.Property("LanguageCode") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("LanguageName") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("LanguageNativeName") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("LastMetadataUpdateUtc") + .HasColumnType("TEXT") + .HasColumnOrder(39); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(36); + + b.Property("LibraryThingId") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(26); + + b.Property("MetadataProvider") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(40); + + b.Property("MetadataStatus") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(38); + + b.Property("OCLCNumber") + .HasColumnType("TEXT") + .HasColumnOrder(24); + + b.Property("OpenLibraryId") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(25); + + b.Property("OriginalLanguageCode") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("OriginalLanguageName") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("OriginalLanguageNativeName") + .HasColumnType("TEXT") + .HasColumnOrder(15); + + b.Property("OriginalReleaseDate") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("OriginalReleaseYear") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("OriginalTitle") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("PageCount") + .HasColumnType("INTEGER") + .HasColumnOrder(17); + + b.Property("Path") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("TEXT") + .HasColumnOrder(37); + + b.Property("Publisher") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(16); + + b.Property("ReReleaseDate") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("ReReleaseYear") + .HasColumnType("INTEGER") + .HasColumnOrder(7); + + b.Property("ReleaseCountry") + .HasMaxLength(2) + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("ReleaseVersion") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(35); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(34); + + b.Property("VolumeNumber") + .HasColumnType("REAL") + .HasColumnOrder(20); + + b.HasKey("Id"); + + b.HasIndex("LibraryId", "MetadataStatus"); + + b.HasIndex("LibraryId", "Path"); + + b.ToTable("Books", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.LibraryArtworkProviderConfigurationEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("IsEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("PluginId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("Rank") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.HasKey("Id"); + + b.HasIndex("LibraryId", "PluginId"); + + b.ToTable("LibraryArtworkProviderConfigurations", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.LibraryBookReaderConfigurationEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("IsEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("PluginId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.HasKey("Id"); + + b.HasIndex("LibraryId", "PluginId") + .IsUnique(); + + b.ToTable("LibraryBookReaderConfigurations", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.LibraryMetadataProviderConfigurationEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("IsEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("PluginId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("Rank") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.HasKey("Id"); + + b.HasIndex("LibraryId", "PluginId"); + + b.ToTable("LibraryMetadataProviderConfigurations", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.PluginEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Author") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("Description") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("LoadError") + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("LoadStatus") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("SettingsJson") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("Version") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.HasKey("Id"); + + b.ToTable("Plugins", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Scheduling.ScheduledJobEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("Hour") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("IntervalMinutes") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("LastCompletedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("LastStartedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("Minute") + .HasColumnType("INTEGER") + .HasColumnOrder(6); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("OwnerUserId") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("ScheduleType") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("Status") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("TaskType") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.HasKey("Id"); + + b.HasIndex("Status"); + + b.ToTable("ScheduledJobs", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Scheduling.ScheduledJobExecutionEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CompletedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("IsCycleRun") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("ScheduledJobId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("StartedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("TaskType") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("WasCycleActive") + .HasColumnType("INTEGER") + .HasColumnOrder(6); + + b.HasKey("Id"); + + b.HasIndex("ScheduledJobId"); + + b.HasIndex("StartedOnUtc", "ScheduledJobId"); + + b.ToTable("ScheduledJobExecutions", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Scheduling.SchedulerDisplayPreferencesEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("DisplayTimeSpan") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("DisplayTimeUnit") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("JobTypeFilter") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UserId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("UserId") + .IsUnique(); + + b.ToTable("SchedulerDisplayPreferences", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Themes.ThemeEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Author") + .IsRequired() + .HasMaxLength(80) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("Description") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("InstallSource") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("InstalledAtUtc") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("IsCurrent") + .HasColumnType("INTEGER") + .HasColumnOrder(8); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(false) + .HasColumnOrder(9); + + b.Property("Name") + .IsRequired() + .HasMaxLength(80) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("PreviewPath") + .HasMaxLength(240) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("ThemeId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("Version") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.HasKey("Id"); + + b.HasIndex("IsCurrent") + .IsUnique() + .HasFilter("IsCurrent = 1"); + + b.HasIndex("ThemeId") + .IsUnique(); + + b.ToTable("Themes", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("Password") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("TempPassword") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("TempPasswordCreated") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("TotpSecret") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("Username") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserSettingsEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("IsPaginationEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(2); + + b.Property("IsThemeCachingEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(9); + + b.Property("ItemsPerPage") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("ShouldAggregateMetadataWhenMissing") + .HasColumnType("INTEGER") + .HasColumnOrder(10); + + b.Property("ShouldIgnoreThePrefixForAlphaPicker") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("ShouldPreserveBookStyles") + .HasColumnType("INTEGER") + .HasColumnOrder(12); + + b.Property("ShouldRenderPdfAsImages") + .HasColumnType("INTEGER") + .HasColumnOrder(11); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UserId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("UserId") + .IsUnique(); + + b.ToTable("UserSettings", (string)null); + }); + + modelBuilder.Entity("BookGenres", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany() + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.GenreEntity", null) + .WithMany() + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BookTags", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany() + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.TagEntity", null) + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RolePermissionEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", "Permission") + .WithMany("RolePermissions") + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserPermissionEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", "Permission") + .WithMany("UserPermissions") + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithMany("UserPermissions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserRoleEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithOne("UserRole") + .HasForeignKey("Lumina.Application.Common.DataAccess.Entities.Authorization.UserRoleEntity", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaContributors.BookContributorEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany("BookContributors") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.DirectoryScanFingerprintEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", null) + .WithMany() + .HasForeignKey("LibraryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithMany("Libraries") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryContentLocationEntity", "ContentLocations", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("LibraryId") + .HasColumnType("TEXT"); + + b1.Property("Path") + .IsRequired() + .HasMaxLength(260) + .HasColumnType("TEXT") + .HasColumnName("Path"); + + b1.HasKey("Id"); + + b1.HasIndex("LibraryId"); + + b1.ToTable("LibraryContentLocations", (string)null); + + b1.WithOwner() + .HasForeignKey("LibraryId"); + }); + + b.Navigation("ContentLocations"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", "Library") + .WithMany("LibraryScans") + .HasForeignKey("LibraryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithMany("LibraryScans") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Library"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanResultEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", "LibraryScan") + .WithMany("LibraryScanResults") + .HasForeignKey("LibraryScanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LibraryScan"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanSnapshotEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", "Library") + .WithMany() + .HasForeignKey("LibraryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Library"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanStagingResultsEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", null) + .WithMany() + .HasForeignKey("LibraryScanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookArtworkEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany("BookArtwork") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", b => + { + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookRatingEntity", "Ratings", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("BookId") + .HasColumnType("TEXT"); + + b1.Property("MaxValue") + .HasColumnType("decimal(3,2)"); + + b1.Property("Source") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.Property("Value") + .HasColumnType("decimal(3,2)"); + + b1.Property("VoteCount") + .HasColumnType("INTEGER"); + + b1.HasKey("Id"); + + b1.HasIndex("BookId"); + + b1.ToTable("BookRatings", (string)null); + + b1.WithOwner() + .HasForeignKey("BookId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.IsbnEntity", "ISBNs", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("BookId") + .HasColumnType("TEXT"); + + b1.Property("Format") + .IsRequired() + .HasMaxLength(6) + .HasColumnType("TEXT"); + + b1.Property("Value") + .IsRequired() + .HasMaxLength(13) + .HasColumnType("TEXT") + .HasColumnName("ISBN"); + + b1.HasKey("Id"); + + b1.HasIndex("BookId"); + + b1.ToTable("BookISBNs", (string)null); + + b1.WithOwner() + .HasForeignKey("BookId"); + }); + + b.Navigation("ISBNs"); + + b.Navigation("Ratings"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserSettingsEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", null) + .WithOne() + .HasForeignKey("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserSettingsEntity", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserPermissions"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b => + { + b.Navigation("LibraryScans"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", b => + { + b.Navigation("LibraryScanResults"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", b => + { + b.Navigation("BookArtwork"); + + b.Navigation("BookContributors"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", b => + { + b.Navigation("Libraries"); + + b.Navigation("LibraryScans"); + + b.Navigation("UserPermissions"); + + b.Navigation("UserRole"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Lumina.DataAccess/Common/Migrations/20260907140842_AddsReleaseCountryEnum.cs b/src/Lumina.DataAccess/Common/Migrations/20260907140842_AddsReleaseCountryEnum.cs new file mode 100644 index 00000000..4bcda386 --- /dev/null +++ b/src/Lumina.DataAccess/Common/Migrations/20260907140842_AddsReleaseCountryEnum.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Lumina.DataAccess.Common.Migrations +{ + /// + public partial class AddsReleaseCountryEnum : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/src/Lumina.DataAccess/Common/Migrations/LuminaDbContextModelSnapshot.cs b/src/Lumina.DataAccess/Common/Migrations/LuminaDbContextModelSnapshot.cs index 79d0b407..33199a11 100644 --- a/src/Lumina.DataAccess/Common/Migrations/LuminaDbContextModelSnapshot.cs +++ b/src/Lumina.DataAccess/Common/Migrations/LuminaDbContextModelSnapshot.cs @@ -850,6 +850,7 @@ namespace Lumina.DataAccess.Common.Migrations .HasColumnOrder(7); b.Property("ReleaseCountry") + .HasMaxLength(2) .HasColumnType("TEXT") .HasColumnOrder(8); diff --git a/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicKey.cs b/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicKey.cs new file mode 100644 index 00000000..882068ff --- /dev/null +++ b/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicKey.cs @@ -0,0 +1,132 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the musical key of a track, describing the pitch and the major or minor mode of the key. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicKey +{ + /// + /// The musical key of C major. + /// + CMajor, + + /// + /// The musical key of C sharp major. + /// + CSharpMajor, + + /// + /// The musical key of D major. + /// + DMajor, + + /// + /// The musical key of D sharp major. + /// + DSharpMajor, + + /// + /// The musical key of E major. + /// + EMajor, + + /// + /// The musical key of F major. + /// + FMajor, + + /// + /// The musical key of F sharp major. + /// + FSharpMajor, + + /// + /// The musical key of G major. + /// + GMajor, + + /// + /// The musical key of G sharp major. + /// + GSharpMajor, + + /// + /// The musical key of A major. + /// + AMajor, + + /// + /// The musical key of A sharp major. + /// + ASharpMajor, + + /// + /// The musical key of B major. + /// + BMajor, + + /// + /// The musical key of C minor. + /// + CMinor, + + /// + /// The musical key of C sharp minor. + /// + CSharpMinor, + + /// + /// The musical key of D minor. + /// + DMinor, + + /// + /// The musical key of D sharp minor. + /// + DSharpMinor, + + /// + /// The musical key of E minor. + /// + EMinor, + + /// + /// The musical key of F minor. + /// + FMinor, + + /// + /// The musical key of F sharp minor. + /// + FSharpMinor, + + /// + /// The musical key of G minor. + /// + GMinor, + + /// + /// The musical key of G sharp minor. + /// + GSharpMinor, + + /// + /// The musical key of A minor. + /// + AMinor, + + /// + /// The musical key of A sharp minor. + /// + ASharpMinor, + + /// + /// The musical key of B minor. + /// + BMinor +} diff --git a/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicMediaFormat.cs b/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicMediaFormat.cs new file mode 100644 index 00000000..7e278feb --- /dev/null +++ b/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicMediaFormat.cs @@ -0,0 +1,577 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the physical or digital medium of a music release. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicMediaFormat +{ + /// + /// The release was distributed on a 10 inch acetate disc. + /// + Inch10Acetate, + + /// + /// The release was distributed on a 10 inch shellac disc. + /// + Inch10Shellac, + + /// + /// The release was distributed on a 10 inch vinyl record. + /// + Inch10Vinyl, + + /// + /// The release was distributed on a 12 inch acetate disc. + /// + Inch12Acetate, + + /// + /// The release was distributed on a 12 inch LaserDisc. + /// + Inch12LaserDisc, + + /// + /// The release was distributed on a 12 inch shellac disc. + /// + Inch12Shellac, + + /// + /// The release was distributed on a 12 inch vinyl record. + /// + Inch12Vinyl, + + /// + /// The release was distributed on a 3 inch vinyl record. + /// + Inch3Vinyl, + + /// + /// The release was distributed on a 3.5 inch floppy disk. + /// + Inch3_5FloppyDisk, + + /// + /// The release was distributed on a 5.25 inch floppy disk. + /// + Inch5_25FloppyDisk, + + /// + /// The release was distributed on a 7 inch acetate disc. + /// + Inch7Acetate, + + /// + /// The release was distributed on a 7 inch flexi disc. + /// + Inch7FlexiDisc, + + /// + /// The release was distributed on a 7 inch shellac disc. + /// + Inch7Shellac, + + /// + /// The release was distributed on a 7 inch vinyl record. + /// + Inch7Vinyl, + + /// + /// The release was distributed on an 8 inch LaserDisc. + /// + Inch8LaserDisc, + + /// + /// The release was distributed on an 8-track cartridge. + /// + EightTrackCartridge, + + /// + /// The release was distributed on an 8 cm compact disc. + /// + Cm8CD, + + /// + /// The release was distributed on an 8 cm compact disc with graphics. + /// + Cm8CDPlusG, + + /// + /// The release was distributed on an 8 cm recordable compact disc. + /// + Cm8CDMinusR, + + /// + /// The release was distributed on an acetate disc. + /// + Acetate, + + /// + /// The release was distributed on a Betacam SP videotape. + /// + BetacamSP, + + /// + /// The release was distributed on a Betamax videocassette. + /// + Betamax, + + /// + /// The release was distributed on a Blu-ray disc. + /// + BluRay, + + /// + /// The release was distributed on a recordable Blu-ray disc. + /// + BluRayMinusR, + + /// + /// The release was distributed on a Blu-spec compact disc. + /// + BluSpecCD, + + /// + /// The release was distributed on a cartridge. + /// + Cartridge, + + /// + /// The release was distributed on a compact cassette. + /// + Cassette, + + /// + /// The release was distributed on a compact disc. + /// + CD, + + /// + /// The release was distributed on a compact disc with graphics. + /// + CDPlusG, + + /// + /// The release was distributed on a CD-i (compact disc interactive). + /// + CDMinusi, + + /// + /// The release was distributed on a recordable compact disc. + /// + CDMinusR, + + /// + /// The release was distributed on a CD Video. + /// + CDV, + + /// + /// The release was distributed on a Capacitance Electronic Disc. + /// + CED, + + /// + /// The release was distributed on a copy-controlled compact disc. + /// + CopyControlCD, + + /// + /// The release was distributed on a Digital Audio Tape. + /// + DAT, + + /// + /// The release was distributed on a compact disc used for data storage. + /// + DataCD, + + /// + /// The release was distributed on a DVD used for data storage. + /// + DataDVD, + + /// + /// The release was distributed on a recordable DVD used for data storage. + /// + DataDVDMinusR, + + /// + /// The release was distributed on a DataPlay disc. + /// + DataPlay, + + /// + /// The release was distributed on a Digital Compact Cassette. + /// + DCC, + + /// + /// The release was distributed as a digital download or stream. + /// + DigitalMedia, + + /// + /// The release was distributed on a download card. + /// + DownloadCard, + + /// + /// The release was distributed on a DTS-compatible compact disc. + /// + DTSCD, + + /// + /// The release was distributed on a DualDisc. + /// + DualDisc, + + /// + /// The release was distributed on the CD side of a DualDisc. + /// + DualDiscCDSide, + + /// + /// The release was distributed on the DVD side of a DualDisc. + /// + DualDiscDVDSide, + + /// + /// The release was distributed on the DVD-audio side of a DualDisc. + /// + DualDiscDVDAudioSide, + + /// + /// The release was distributed on the DVD-video side of a DualDisc. + /// + DualDiscDVDVideoSide, + + /// + /// The release was distributed on a DVD. + /// + DVD, + + /// + /// The release was distributed on a DVD-Audio. + /// + DVDAudio, + + /// + /// The release was distributed on a recordable DVD used for video. + /// + DVDMinusRVideo, + + /// + /// The release was distributed on a DVD-Video. + /// + DVDVideo, + + /// + /// The release was distributed on a DVD+. + /// + DVDPlus, + + /// + /// The release was distributed on the CD side of a DVD+. + /// + DVDPlusCDSide, + + /// + /// The release was distributed on the DVD-audio side of a DVD+. + /// + DVDPlusDVDAudioSide, + + /// + /// The release was distributed on the DVD-video side of a DVD+. + /// + DVDPlusDVDVideoSide, + + /// + /// The release was distributed on an Edison Diamond Disc. + /// + EdisonDiamondDisc, + + /// + /// The release was distributed on an enhanced compact disc. + /// + EnhancedCD, + + /// + /// The release was distributed on a flexi disc. + /// + FlexiDisc, + + /// + /// The release was distributed on a floppy disk. + /// + FloppyDisk, + + /// + /// The release was distributed on an HD DVD. + /// + HDDVD, + + /// + /// The release was distributed on a High Definition Compatible Digital compact disc. + /// + HDCD, + + /// + /// The release was distributed on a HiPac. + /// + HiPac, + + /// + /// The release was distributed on a High Quality compact disc. + /// + HQCD, + + /// + /// The release was distributed on a hybrid Super Audio CD. + /// + HybridSACD, + + /// + /// The release was distributed on the CD layer of a hybrid Super Audio CD. + /// + HybridSACDCDLayer, + + /// + /// The release was distributed on the SACD layer of a hybrid Super Audio CD. + /// + HybridSACDSACDLayer, + + /// + /// The release was distributed on the stereo SACD layer of a hybrid Super Audio CD. + /// + HybridSACDSACDLayer2Channels, + + /// + /// The release was distributed on the multichannel SACD layer of a hybrid Super Audio CD. + /// + HybridSACDSACDLayerMultichannel, + + /// + /// The release was distributed on a KiT album. + /// + KiTAlbum, + + /// + /// The release was distributed on a LaserDisc. + /// + LaserDisc, + + /// + /// The release was distributed on a microcassette. + /// + Microcassette, + + /// + /// The release was distributed on a microSD card. + /// + MicroSD, + + /// + /// The release was distributed on a MiniDisc. + /// + MiniDisc, + + /// + /// The release was distributed on a mini DVD. + /// + MiniDVD, + + /// + /// The release was distributed on a mini DVD-Audio. + /// + MiniDVDAudio, + + /// + /// The release was distributed on a mini DVD-Video. + /// + MiniDVDVideo, + + /// + /// The release was distributed on a MiniMax compact disc. + /// + MinimaxCD, + + /// + /// The release was distributed on a MiniMax DVD. + /// + MinimaxDVD, + + /// + /// The release was distributed on a MiniMax DVD-Audio. + /// + MinimaxDVDAudio, + + /// + /// The release was distributed on a MiniMax DVD-Video. + /// + MinimaxDVDVideo, + + /// + /// The release was distributed on a mixed-mode compact disc. + /// + MixedModeCD, + + /// + /// The medium of the release does not fall into any of the known categories. + /// + Other, + + /// + /// The release was distributed on a Pathe disc. + /// + PatheDisc, + + /// + /// The release was distributed on a phonograph record. + /// + PhonographRecord, + + /// + /// The release was distributed on a piano roll. + /// + PianoRoll, + + /// + /// The release was distributed on a Playbutton. + /// + Playbutton, + + /// + /// The release was distributed on a PlayTape. + /// + PlayTape, + + /// + /// The release was distributed on a reel-to-reel tape. + /// + ReelToReel, + + /// + /// The release was distributed on a read-only memory cartridge. + /// + ROMCartridge, + + /// + /// The release was distributed on a Super Audio CD. + /// + SACD, + + /// + /// The release was distributed on a stereo Super Audio CD. + /// + SACD2Channels, + + /// + /// The release was distributed on a multichannel Super Audio CD. + /// + SACDMultichannel, + + /// + /// The release was distributed on an SD card. + /// + SDCard, + + /// + /// The release was distributed on a shellac disc. + /// + Shellac, + + /// + /// The release was distributed on a Super High Material compact disc. + /// + SHMCD, + + /// + /// The release was distributed on a Super High Material Super Audio CD. + /// + SHMSACD, + + /// + /// The release was distributed on a multichannel Super High Material Super Audio CD. + /// + SHMSACDMultichannel, + + /// + /// The release was distributed on a slotMusic card. + /// + SlotMusic, + + /// + /// The release was distributed on a Super Video CD. + /// + SVCD, + + /// + /// The release was distributed on a Tefifon cartridge. + /// + Tefifon, + + /// + /// The release was distributed on a Universal Media Disc. + /// + UMD, + + /// + /// The release was distributed on a USB flash drive. + /// + USBFlashDrive, + + /// + /// The release was distributed on a Video CD. + /// + VCD, + + /// + /// The release was distributed on a Video High Density disc. + /// + VHD, + + /// + /// The release was distributed on a VHS videocassette. + /// + VHS, + + /// + /// The release was distributed on a vinyl record. + /// + Vinyl, + + /// + /// The release was distributed on a VinylDisc. + /// + VinylDisc, + + /// + /// The release was distributed on the CD side of a VinylDisc. + /// + VinylDiscCDSide, + + /// + /// The release was distributed on the DVD side of a VinylDisc. + /// + VinylDiscDVDSide, + + /// + /// The release was distributed on the vinyl side of a VinylDisc. + /// + VinylDiscVinylSide, + + /// + /// The release was distributed on a wax cylinder. + /// + WaxCylinder, + + /// + /// The release was distributed on a Zip disk. + /// + ZipDisk +} diff --git a/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicReleaseStatus.cs b/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicReleaseStatus.cs new file mode 100644 index 00000000..f699723b --- /dev/null +++ b/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicReleaseStatus.cs @@ -0,0 +1,47 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the status of a music release, describing the officiality of the release. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicReleaseStatus +{ + /// + /// The release was distributed without the authorization of the artist or label. + /// + Bootleg, + + /// + /// The release was announced but never distributed. + /// + Cancelled, + + /// + /// The release was expunged from the catalog of the artist or label. + /// + Expunged, + + /// + /// The release was released through official channels. + /// + Official, + + /// + /// The release was distributed for promotional purposes only. + /// + Promotion, + + /// + /// The release is a pseudo-release, not an actual release by the artist. + /// + PseudoRelease, + + /// + /// The release was distributed but later withdrawn from circulation. + /// + Withdrawn +} diff --git a/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicReleaseType.cs b/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicReleaseType.cs new file mode 100644 index 00000000..769b711b --- /dev/null +++ b/src/Lumina.Domain.SharedKernel/Common/Enums/AudioLibrary/MusicReleaseType.cs @@ -0,0 +1,97 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the type of a music release, describing the format of the release in terms of its content. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicReleaseType +{ + /// + /// A release consisting of a collection of tracks. + /// + Album, + + /// + /// A release that was aired as a broadcast. + /// + Broadcast, + + /// + /// A release that is longer than a single but shorter than an album. + /// + Ep, + + /// + /// The type of the release does not fall into any of the known categories. + /// + Other, + + /// + /// A release consisting of a small number of tracks. + /// + Single, + + /// + /// A release containing a dramatized audio performance. + /// + AudioDrama, + + /// + /// A release containing a recording of a book being read aloud. + /// + AudioBook, + + /// + /// A release that gathers tracks from various sources or artists. + /// + Compilation, + + /// + /// A release containing a continuous mix of tracks by a DJ. + /// + DjMix, + + /// + /// A release of demo recordings, typically distributed before the official release. + /// + Demo, + + /// + /// A release containing an audio recording made outside of a studio. + /// + FieldRecording, + + /// + /// A release containing a recorded interview. + /// + Interview, + + /// + /// A release recorded during a live performance. + /// + Live, + + /// + /// A release containing a compilation of tracks, typically distributed outside of official channels. + /// + Mixtape, + + /// + /// A release containing modified or reinterpreted versions of original recordings. + /// + Remix, + + /// + /// A release containing music written for a motion picture or television program. + /// + Soundtrack, + + /// + /// A release containing spoken word content. + /// + SpokenWord +} diff --git a/src/Lumina.Domain.SharedKernel/Common/Enums/Common/ReleaseCountry.cs b/src/Lumina.Domain.SharedKernel/Common/Enums/Common/ReleaseCountry.cs new file mode 100644 index 00000000..b8bd644f --- /dev/null +++ b/src/Lumina.Domain.SharedKernel/Common/Enums/Common/ReleaseCountry.cs @@ -0,0 +1,992 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.SharedKernel.Common.Enums.Common; + +/// +/// Enumeration for the country of a media release, using the ISO 3166-1 alpha-2 country codes. +/// +[DebuggerDisplay("{ToString()}")] +public enum ReleaseCountry +{ + /// + /// The ISO 3166-1 alpha-2 code of Afghanistan. + /// + AF, + + /// + /// The ISO 3166-1 alpha-2 code of Albania. + /// + AL, + + /// + /// The ISO 3166-1 alpha-2 code of Algeria. + /// + DZ, + + /// + /// The ISO 3166-1 alpha-2 code of Andorra. + /// + AD, + + /// + /// The ISO 3166-1 alpha-2 code of Angola. + /// + AO, + + /// + /// The ISO 3166-1 alpha-2 code of Antigua and Barbuda. + /// + AG, + + /// + /// The ISO 3166-1 alpha-2 code of Argentina. + /// + AR, + + /// + /// The ISO 3166-1 alpha-2 code of Armenia. + /// + AM, + + /// + /// The ISO 3166-1 alpha-2 code of Australia. + /// + AU, + + /// + /// The ISO 3166-1 alpha-2 code of Austria. + /// + AT, + + /// + /// The ISO 3166-1 alpha-2 code of Azerbaijan. + /// + AZ, + + /// + /// The ISO 3166-1 alpha-2 code of the Bahamas. + /// + BS, + + /// + /// The ISO 3166-1 alpha-2 code of Bahrain. + /// + BH, + + /// + /// The ISO 3166-1 alpha-2 code of Bangladesh. + /// + BD, + + /// + /// The ISO 3166-1 alpha-2 code of Barbados. + /// + BB, + + /// + /// The ISO 3166-1 alpha-2 code of Belarus. + /// + BY, + + /// + /// The ISO 3166-1 alpha-2 code of Belgium. + /// + BE, + + /// + /// The ISO 3166-1 alpha-2 code of Belize. + /// + BZ, + + /// + /// The ISO 3166-1 alpha-2 code of Benin. + /// + BJ, + + /// + /// The ISO 3166-1 alpha-2 code of Bhutan. + /// + BT, + + /// + /// The ISO 3166-1 alpha-2 code of Bolivia. + /// + BO, + + /// + /// The ISO 3166-1 alpha-2 code of Bosnia and Herzegovina. + /// + BA, + + /// + /// The ISO 3166-1 alpha-2 code of Botswana. + /// + BW, + + /// + /// The ISO 3166-1 alpha-2 code of Brazil. + /// + BR, + + /// + /// The ISO 3166-1 alpha-2 code of Brunei. + /// + BN, + + /// + /// The ISO 3166-1 alpha-2 code of Bulgaria. + /// + BG, + + /// + /// The ISO 3166-1 alpha-2 code of Burkina Faso. + /// + BF, + + /// + /// The ISO 3166-1 alpha-2 code of Burundi. + /// + BI, + + /// + /// The ISO 3166-1 alpha-2 code of Cabo Verde. + /// + CV, + + /// + /// The ISO 3166-1 alpha-2 code of Cambodia. + /// + KH, + + /// + /// The ISO 3166-1 alpha-2 code of Cameroon. + /// + CM, + + /// + /// The ISO 3166-1 alpha-2 code of Canada. + /// + CA, + + /// + /// The ISO 3166-1 alpha-2 code of the Central African Republic. + /// + CF, + + /// + /// The ISO 3166-1 alpha-2 code of Chad. + /// + TD, + + /// + /// The ISO 3166-1 alpha-2 code of Chile. + /// + CL, + + /// + /// The ISO 3166-1 alpha-2 code of China. + /// + CN, + + /// + /// The ISO 3166-1 alpha-2 code of Colombia. + /// + CO, + + /// + /// The ISO 3166-1 alpha-2 code of Comoros. + /// + KM, + + /// + /// The ISO 3166-1 alpha-2 code of Congo. + /// + CG, + + /// + /// The ISO 3166-1 alpha-2 code of the Democratic Republic of the Congo. + /// + CD, + + /// + /// The ISO 3166-1 alpha-2 code of Costa Rica. + /// + CR, + + /// + /// The ISO 3166-1 alpha-2 code of Cote d'Ivoire. + /// + CI, + + /// + /// The ISO 3166-1 alpha-2 code of Croatia. + /// + HR, + + /// + /// The ISO 3166-1 alpha-2 code of Cuba. + /// + CU, + + /// + /// The ISO 3166-1 alpha-2 code of Cyprus. + /// + CY, + + /// + /// The ISO 3166-1 alpha-2 code of Czechia. + /// + CZ, + + /// + /// The ISO 3166-1 alpha-2 code of Denmark. + /// + DK, + + /// + /// The ISO 3166-1 alpha-2 code of Djibouti. + /// + DJ, + + /// + /// The ISO 3166-1 alpha-2 code of Dominica. + /// + DM, + + /// + /// The ISO 3166-1 alpha-2 code of the Dominican Republic. + /// + DO, + + /// + /// The ISO 3166-1 alpha-2 code of Ecuador. + /// + EC, + + /// + /// The ISO 3166-1 alpha-2 code of Egypt. + /// + EG, + + /// + /// The ISO 3166-1 alpha-2 code of El Salvador. + /// + SV, + + /// + /// The ISO 3166-1 alpha-2 code of Equatorial Guinea. + /// + GQ, + + /// + /// The ISO 3166-1 alpha-2 code of Eritrea. + /// + ER, + + /// + /// The ISO 3166-1 alpha-2 code of Estonia. + /// + EE, + + /// + /// The ISO 3166-1 alpha-2 code of Eswatini. + /// + SZ, + + /// + /// The ISO 3166-1 alpha-2 code of Ethiopia. + /// + ET, + + /// + /// The ISO 3166-1 alpha-2 code of Fiji. + /// + FJ, + + /// + /// The ISO 3166-1 alpha-2 code of Finland. + /// + FI, + + /// + /// The ISO 3166-1 alpha-2 code of France. + /// + FR, + + /// + /// The ISO 3166-1 alpha-2 code of Gabon. + /// + GA, + + /// + /// The ISO 3166-1 alpha-2 code of the Gambia. + /// + GM, + + /// + /// The ISO 3166-1 alpha-2 code of Georgia. + /// + GE, + + /// + /// The ISO 3166-1 alpha-2 code of Germany. + /// + DE, + + /// + /// The ISO 3166-1 alpha-2 code of Ghana. + /// + GH, + + /// + /// The ISO 3166-1 alpha-2 code of Greece. + /// + GR, + + /// + /// The ISO 3166-1 alpha-2 code of Grenada. + /// + GD, + + /// + /// The ISO 3166-1 alpha-2 code of Guatemala. + /// + GT, + + /// + /// The ISO 3166-1 alpha-2 code of Guinea. + /// + GN, + + /// + /// The ISO 3166-1 alpha-2 code of Guinea-Bissau. + /// + GW, + + /// + /// The ISO 3166-1 alpha-2 code of Guyana. + /// + GY, + + /// + /// The ISO 3166-1 alpha-2 code of Haiti. + /// + HT, + + /// + /// The ISO 3166-1 alpha-2 code of Honduras. + /// + HN, + + /// + /// The ISO 3166-1 alpha-2 code of Hungary. + /// + HU, + + /// + /// The ISO 3166-1 alpha-2 code of Iceland. + /// + IS, + + /// + /// The ISO 3166-1 alpha-2 code of India. + /// + IN, + + /// + /// The ISO 3166-1 alpha-2 code of Indonesia. + /// + ID, + + /// + /// The ISO 3166-1 alpha-2 code of Iran. + /// + IR, + + /// + /// The ISO 3166-1 alpha-2 code of Iraq. + /// + IQ, + + /// + /// The ISO 3166-1 alpha-2 code of Ireland. + /// + IE, + + /// + /// The ISO 3166-1 alpha-2 code of Israel. + /// + IL, + + /// + /// The ISO 3166-1 alpha-2 code of Italy. + /// + IT, + + /// + /// The ISO 3166-1 alpha-2 code of Jamaica. + /// + JM, + + /// + /// The ISO 3166-1 alpha-2 code of Japan. + /// + JP, + + /// + /// The ISO 3166-1 alpha-2 code of Jordan. + /// + JO, + + /// + /// The ISO 3166-1 alpha-2 code of Kazakhstan. + /// + KZ, + + /// + /// The ISO 3166-1 alpha-2 code of Kenya. + /// + KE, + + /// + /// The ISO 3166-1 alpha-2 code of Kiribati. + /// + KI, + + /// + /// The ISO 3166-1 alpha-2 code of North Korea. + /// + KP, + + /// + /// The ISO 3166-1 alpha-2 code of South Korea. + /// + KR, + + /// + /// The ISO 3166-1 alpha-2 code of Kuwait. + /// + KW, + + /// + /// The ISO 3166-1 alpha-2 code of Kyrgyzstan. + /// + KG, + + /// + /// The ISO 3166-1 alpha-2 code of Laos. + /// + LA, + + /// + /// The ISO 3166-1 alpha-2 code of Latvia. + /// + LV, + + /// + /// The ISO 3166-1 alpha-2 code of Lebanon. + /// + LB, + + /// + /// The ISO 3166-1 alpha-2 code of Lesotho. + /// + LS, + + /// + /// The ISO 3166-1 alpha-2 code of Liberia. + /// + LR, + + /// + /// The ISO 3166-1 alpha-2 code of Libya. + /// + LY, + + /// + /// The ISO 3166-1 alpha-2 code of Liechtenstein. + /// + LI, + + /// + /// The ISO 3166-1 alpha-2 code of Lithuania. + /// + LT, + + /// + /// The ISO 3166-1 alpha-2 code of Luxembourg. + /// + LU, + + /// + /// The ISO 3166-1 alpha-2 code of Madagascar. + /// + MG, + + /// + /// The ISO 3166-1 alpha-2 code of Malawi. + /// + MW, + + /// + /// The ISO 3166-1 alpha-2 code of Malaysia. + /// + MY, + + /// + /// The ISO 3166-1 alpha-2 code of Maldives. + /// + MV, + + /// + /// The ISO 3166-1 alpha-2 code of Mali. + /// + ML, + + /// + /// The ISO 3166-1 alpha-2 code of Malta. + /// + MT, + + /// + /// The ISO 3166-1 alpha-2 code of the Marshall Islands. + /// + MH, + + /// + /// The ISO 3166-1 alpha-2 code of Mauritania. + /// + MR, + + /// + /// The ISO 3166-1 alpha-2 code of Mauritius. + /// + MU, + + /// + /// The ISO 3166-1 alpha-2 code of Mexico. + /// + MX, + + /// + /// The ISO 3166-1 alpha-2 code of Micronesia. + /// + FM, + + /// + /// The ISO 3166-1 alpha-2 code of Moldova. + /// + MD, + + /// + /// The ISO 3166-1 alpha-2 code of Monaco. + /// + MC, + + /// + /// The ISO 3166-1 alpha-2 code of Mongolia. + /// + MN, + + /// + /// The ISO 3166-1 alpha-2 code of Montenegro. + /// + ME, + + /// + /// The ISO 3166-1 alpha-2 code of Morocco. + /// + MA, + + /// + /// The ISO 3166-1 alpha-2 code of Mozambique. + /// + MZ, + + /// + /// The ISO 3166-1 alpha-2 code of Myanmar. + /// + MM, + + /// + /// The ISO 3166-1 alpha-2 code of Namibia. + /// + NA, + + /// + /// The ISO 3166-1 alpha-2 code of Nauru. + /// + NR, + + /// + /// The ISO 3166-1 alpha-2 code of Nepal. + /// + NP, + + /// + /// The ISO 3166-1 alpha-2 code of the Netherlands. + /// + NL, + + /// + /// The ISO 3166-1 alpha-2 code of New Zealand. + /// + NZ, + + /// + /// The ISO 3166-1 alpha-2 code of Nicaragua. + /// + NI, + + /// + /// The ISO 3166-1 alpha-2 code of Niger. + /// + NE, + + /// + /// The ISO 3166-1 alpha-2 code of Nigeria. + /// + NG, + + /// + /// The ISO 3166-1 alpha-2 code of North Macedonia. + /// + MK, + + /// + /// The ISO 3166-1 alpha-2 code of Norway. + /// + NO, + + /// + /// The ISO 3166-1 alpha-2 code of Oman. + /// + OM, + + /// + /// The ISO 3166-1 alpha-2 code of Pakistan. + /// + PK, + + /// + /// The ISO 3166-1 alpha-2 code of Palau. + /// + PW, + + /// + /// The ISO 3166-1 alpha-2 code of the State of Palestine. + /// + PS, + + /// + /// The ISO 3166-1 alpha-2 code of Panama. + /// + PA, + + /// + /// The ISO 3166-1 alpha-2 code of Papua New Guinea. + /// + PG, + + /// + /// The ISO 3166-1 alpha-2 code of Paraguay. + /// + PY, + + /// + /// The ISO 3166-1 alpha-2 code of Peru. + /// + PE, + + /// + /// The ISO 3166-1 alpha-2 code of the Philippines. + /// + PH, + + /// + /// The ISO 3166-1 alpha-2 code of Poland. + /// + PL, + + /// + /// The ISO 3166-1 alpha-2 code of Portugal. + /// + PT, + + /// + /// The ISO 3166-1 alpha-2 code of Qatar. + /// + QA, + + /// + /// The ISO 3166-1 alpha-2 code of Romania. + /// + RO, + + /// + /// The ISO 3166-1 alpha-2 code of Russia. + /// + RU, + + /// + /// The ISO 3166-1 alpha-2 code of Rwanda. + /// + RW, + + /// + /// The ISO 3166-1 alpha-2 code of Saint Kitts and Nevis. + /// + KN, + + /// + /// The ISO 3166-1 alpha-2 code of Saint Lucia. + /// + LC, + + /// + /// The ISO 3166-1 alpha-2 code of Saint Vincent and the Grenadines. + /// + VC, + + /// + /// The ISO 3166-1 alpha-2 code of Samoa. + /// + WS, + + /// + /// The ISO 3166-1 alpha-2 code of San Marino. + /// + SM, + + /// + /// The ISO 3166-1 alpha-2 code of Sao Tome and Principe. + /// + ST, + + /// + /// The ISO 3166-1 alpha-2 code of Saudi Arabia. + /// + SA, + + /// + /// The ISO 3166-1 alpha-2 code of Senegal. + /// + SN, + + /// + /// The ISO 3166-1 alpha-2 code of Serbia. + /// + RS, + + /// + /// The ISO 3166-1 alpha-2 code of Seychelles. + /// + SC, + + /// + /// The ISO 3166-1 alpha-2 code of Sierra Leone. + /// + SL, + + /// + /// The ISO 3166-1 alpha-2 code of Singapore. + /// + SG, + + /// + /// The ISO 3166-1 alpha-2 code of Slovakia. + /// + SK, + + /// + /// The ISO 3166-1 alpha-2 code of Slovenia. + /// + SI, + + /// + /// The ISO 3166-1 alpha-2 code of the Solomon Islands. + /// + SB, + + /// + /// The ISO 3166-1 alpha-2 code of Somalia. + /// + SO, + + /// + /// The ISO 3166-1 alpha-2 code of South Africa. + /// + ZA, + + /// + /// The ISO 3166-1 alpha-2 code of South Sudan. + /// + SS, + + /// + /// The ISO 3166-1 alpha-2 code of Spain. + /// + ES, + + /// + /// The ISO 3166-1 alpha-2 code of Sri Lanka. + /// + LK, + + /// + /// The ISO 3166-1 alpha-2 code of Sudan. + /// + SD, + + /// + /// The ISO 3166-1 alpha-2 code of Suriname. + /// + SR, + + /// + /// The ISO 3166-1 alpha-2 code of Sweden. + /// + SE, + + /// + /// The ISO 3166-1 alpha-2 code of Switzerland. + /// + CH, + + /// + /// The ISO 3166-1 alpha-2 code of Syria. + /// + SY, + + /// + /// The ISO 3166-1 alpha-2 code of Taiwan. + /// + TW, + + /// + /// The ISO 3166-1 alpha-2 code of Tajikistan. + /// + TJ, + + /// + /// The ISO 3166-1 alpha-2 code of Tanzania. + /// + TZ, + + /// + /// The ISO 3166-1 alpha-2 code of Thailand. + /// + TH, + + /// + /// The ISO 3166-1 alpha-2 code of Timor-Leste. + /// + TL, + + /// + /// The ISO 3166-1 alpha-2 code of Togo. + /// + TG, + + /// + /// The ISO 3166-1 alpha-2 code of Tonga. + /// + TO, + + /// + /// The ISO 3166-1 alpha-2 code of Trinidad and Tobago. + /// + TT, + + /// + /// The ISO 3166-1 alpha-2 code of Tunisia. + /// + TN, + + /// + /// The ISO 3166-1 alpha-2 code of Turkey. + /// + TR, + + /// + /// The ISO 3166-1 alpha-2 code of Turkmenistan. + /// + TM, + + /// + /// The ISO 3166-1 alpha-2 code of Tuvalu. + /// + TV, + + /// + /// The ISO 3166-1 alpha-2 code of Uganda. + /// + UG, + + /// + /// The ISO 3166-1 alpha-2 code of Ukraine. + /// + UA, + + /// + /// The ISO 3166-1 alpha-2 code of the United Arab Emirates. + /// + AE, + + /// + /// The ISO 3166-1 alpha-2 code of the United Kingdom. + /// + GB, + + /// + /// The ISO 3166-1 alpha-2 code of the United States. + /// + US, + + /// + /// The ISO 3166-1 alpha-2 code of Uruguay. + /// + UY, + + /// + /// The ISO 3166-1 alpha-2 code of Uzbekistan. + /// + UZ, + + /// + /// The ISO 3166-1 alpha-2 code of Vanuatu. + /// + VU, + + /// + /// The ISO 3166-1 alpha-2 code of the Vatican City. + /// + VA, + + /// + /// The ISO 3166-1 alpha-2 code of Venezuela. + /// + VE, + + /// + /// The ISO 3166-1 alpha-2 code of Vietnam. + /// + VN, + + /// + /// The ISO 3166-1 alpha-2 code of Yemen. + /// + YE, + + /// + /// The ISO 3166-1 alpha-2 code of Zambia. + /// + ZM, + + /// + /// The ISO 3166-1 alpha-2 code of Zimbabwe. + /// + ZW +} diff --git a/src/Lumina.Domain.SharedKernel/Common/Enums/MediaContributors/MediaContributorRoleCategory.cs b/src/Lumina.Domain.SharedKernel/Common/Enums/MediaContributors/MediaContributorRoleCategory.cs index 1005ee9b..597b7d0c 100644 --- a/src/Lumina.Domain.SharedKernel/Common/Enums/MediaContributors/MediaContributorRoleCategory.cs +++ b/src/Lumina.Domain.SharedKernel/Common/Enums/MediaContributors/MediaContributorRoleCategory.cs @@ -40,5 +40,60 @@ public enum MediaContributorRoleCategory /// /// The contributor narrated the media item. /// - Narrator + Narrator, + + /// + /// The contributor is credited as the artist of the media item. + /// + Artist, + + /// + /// The contributor performed the media item, whether singing or playing an instrument. + /// + Performer, + + /// + /// The contributor wrote the music of the media item. + /// + Composer, + + /// + /// The contributor wrote the lyrics of the media item. + /// + Lyricist, + + /// + /// The contributor oversaw the production of the media item. + /// + Producer, + + /// + /// The contributor operated the recording equipment during the production of the media item. + /// + Engineer, + + /// + /// The contributor conducted the ensemble performing the media item. + /// + Conductor, + + /// + /// The contributor arranged the music of the media item. + /// + Arranger, + + /// + /// The contributor mixed the audio of the media item. + /// + Mixer, + + /// + /// The contributor created a remix of the media item. + /// + Remixer, + + /// + /// The contributor released the media item under a record label. + /// + RecordLabel } diff --git a/src/Lumina.Domain.SharedKernel/Common/Enums/MediaContributors/MediaContributorType.cs b/src/Lumina.Domain.SharedKernel/Common/Enums/MediaContributors/MediaContributorType.cs new file mode 100644 index 00000000..aa370de8 --- /dev/null +++ b/src/Lumina.Domain.SharedKernel/Common/Enums/MediaContributors/MediaContributorType.cs @@ -0,0 +1,33 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; + +/// +/// Enumeration for the type of a media contributor, distinguishing whether the contributor is a single person, +/// a group of people, or an organization. +/// +[DebuggerDisplay("{ToString()}")] +public enum MediaContributorType +{ + /// + /// The contributor is a single person. + /// + Person, + + /// + /// The contributor is a group of people, like a band or an orchestra. + /// + Group, + + /// + /// The contributor is an organization, like a record label or a studio. + /// + Organization, + + /// + /// The type of the contributor does not fall into any of the known categories. + /// + Other +} diff --git a/src/Lumina.Domain/Common/Errors/Errors.Metadata.cs b/src/Lumina.Domain/Common/Errors/Errors.Metadata.cs index 29aa8125..c1440d63 100644 --- a/src/Lumina.Domain/Common/Errors/Errors.Metadata.cs +++ b/src/Lumina.Domain/Common/Errors/Errors.Metadata.cs @@ -22,6 +22,7 @@ public static partial class Errors public static Error TagsListCannotBeNull => Error.Validation(description: nameof(TagsListCannotBeNull)); public static Error TagNameCannotBeEmpty => Error.Validation(description: nameof(TagNameCannotBeEmpty)); public static Error TagNameMustBeMaximum50CharactersLong => Error.Validation(description: nameof(TagNameMustBeMaximum50CharactersLong)); + public static Error MoodNameCannotBeEmpty => Error.Validation(description: nameof(MoodNameCannotBeEmpty)); public static Error LanguageCodeCannotBeEmpty => Error.Validation(description: nameof(LanguageCodeCannotBeEmpty)); public static Error LanguageNameCannotBeEmpty => Error.Validation(description: nameof(LanguageNameCannotBeEmpty)); public static Error LanguageCodeMustBe2CharactersLong => Error.Validation(description: nameof(LanguageCodeMustBe2CharactersLong)); diff --git a/src/Lumina.Domain/Common/Errors/Errors.Music.cs b/src/Lumina.Domain/Common/Errors/Errors.Music.cs new file mode 100644 index 00000000..8564c459 --- /dev/null +++ b/src/Lumina.Domain/Common/Errors/Errors.Music.cs @@ -0,0 +1,26 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Primitives; +#endregion + +namespace Lumina.Domain.Common.Errors; + +/// +/// Music error types. +/// +public static partial class Errors +{ + public static class Music + { + public static Error ArtistNameCannotBeEmpty => Error.Validation(description: nameof(ArtistNameCannotBeEmpty)); + public static Error MusicBrainzIdInvalidFormat => Error.Validation(description: nameof(MusicBrainzIdInvalidFormat)); + public static Error IsrcValueCannotBeEmpty => Error.Validation(description: nameof(IsrcValueCannotBeEmpty)); + public static Error IsrcInvalidFormat => Error.Validation(description: nameof(IsrcInvalidFormat)); + public static Error BarcodeValueCannotBeEmpty => Error.Validation(description: nameof(BarcodeValueCannotBeEmpty)); + public static Error InvalidFormatForBarcode => Error.Validation(description: nameof(InvalidFormatForBarcode)); + public static Error CreditRoleDisplayNameCannotBeEmpty => Error.Validation(description: nameof(CreditRoleDisplayNameCannotBeEmpty)); + public static Error TheArtistAlreadyHasTheAlbum => Error.Forbidden(description: nameof(TheArtistAlreadyHasTheAlbum)); + public static Error TheArtistDoesNotHaveTheAlbum => Error.Forbidden(description: nameof(TheArtistDoesNotHaveTheAlbum)); + public static Error TheTrackIsAlreadyInTheAlbum => Error.Forbidden(description: nameof(TheTrackIsAlreadyInTheAlbum)); + public static Error TheTrackIsNotInTheAlbum => Error.Forbidden(description: nameof(TheTrackIsNotInTheAlbum)); + } +} diff --git a/src/Lumina.Domain/Common/ValueObjects/Metadata/Mood.cs b/src/Lumina.Domain/Common/ValueObjects/Metadata/Mood.cs new file mode 100644 index 00000000..01c38c57 --- /dev/null +++ b/src/Lumina.Domain/Common/ValueObjects/Metadata/Mood.cs @@ -0,0 +1,62 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Errors; +using Lumina.Domain.Common.Models.Core; +using Lumina.Domain.Common.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Common.ValueObjects.Metadata; + +/// +/// Value Object for the moods of a media element. +/// +[DebuggerDisplay("{Name}")] +public class Mood : ValueObject +{ + /// + /// Gets the name of the mood element of the media item. + /// + public string Name { get; } + + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private Mood(string name) + { + Name = name.Trim(); + } + + /// + /// Creates a new instance of the class. + /// + /// The value of the mood. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create(string? name) + { + if (string.IsNullOrWhiteSpace(name)) + return Errors.Errors.Metadata.MoodNameCannotBeEmpty; + return new Mood(name); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Name; + } + + /// + /// Customized ToString() method. + /// + /// Custom string value showing relevant data for current class. + public override string ToString() + { + return Name; + } +} diff --git a/src/Lumina.Domain/Common/ValueObjects/Metadata/ReleaseInfo.cs b/src/Lumina.Domain/Common/ValueObjects/Metadata/ReleaseInfo.cs index cc1d0492..a3347b08 100644 --- a/src/Lumina.Domain/Common/ValueObjects/Metadata/ReleaseInfo.cs +++ b/src/Lumina.Domain/Common/ValueObjects/Metadata/ReleaseInfo.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Domain.Common.Models.Core; using Lumina.Domain.Common.Primitives; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics; @@ -38,7 +39,7 @@ public class ReleaseInfo : ValueObject /// /// Gets the optional country or region of release. /// - public Optional ReleaseCountry { get; } + public Optional ReleaseCountry { get; } /// /// Gets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0") @@ -59,7 +60,7 @@ public class ReleaseInfo : ValueObject Optional originalReleaseYear, Optional reReleaseDate, Optional reReleaseYear, - Optional releaseCountry, + Optional releaseCountry, Optional releaseVersion) { OriginalReleaseDate = originalReleaseDate; @@ -87,7 +88,7 @@ public class ReleaseInfo : ValueObject Optional originalReleaseYear, Optional reReleaseDate, Optional reReleaseYear, - Optional releaseCountry, + Optional releaseCountry, Optional releaseVersion) { if (originalReleaseDate.HasValue && originalReleaseYear.HasValue && originalReleaseDate.Value.Year != originalReleaseYear.Value) diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/AudioLibraryAggregate/ValueObjects/AudioMetadata.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioMetadata.cs similarity index 91% rename from src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/AudioLibraryAggregate/ValueObjects/AudioMetadata.cs rename to src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioMetadata.cs index c4f845eb..1326fb7d 100644 --- a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/AudioLibraryAggregate/ValueObjects/AudioMetadata.cs +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioMetadata.cs @@ -1,12 +1,11 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Domain.Common.Primitives; - using Lumina.Domain.Common.ValueObjects.Metadata; using System.Collections.Generic; using System.Diagnostics; #endregion -namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLibraryAggregate.ValueObjects; +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects; /// /// Value Object for the audio metadata of a media element. @@ -15,7 +14,7 @@ namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLib public class AudioMetadata : BaseMetadata { /// - /// Gets the duration of the video in seconds. + /// Gets the duration of the audio in seconds. /// public int DurationInSeconds { get; } @@ -48,19 +47,20 @@ public class AudioMetadata : BaseMetadata /// Initializes a new instance of the class. /// /// The title of the audio. - /// The optional original title of the video. + /// The optional original title of the audio. /// The duration of the audio, in seconds. /// The sample rate of the audio, in Hz. /// The number of audio channels. /// The release information of the audio. /// The description of the audio. /// The language of the audio. - /// The optional original language of the video. + /// The optional original language of the audio. /// The bit depth of the audio. /// The audio codec used. /// The genres of the audio. /// The tags associated with the audio. - public AudioMetadata( + /// The bitrate of the audio in kbps. + private AudioMetadata( string title, Optional originalTitle, int durationInSeconds, @@ -89,18 +89,19 @@ public class AudioMetadata : BaseMetadata /// Creates a new instance of the class. /// /// The title of the audio. - /// The optional original title of the video. + /// The optional original title of the audio. /// The duration of the audio, in seconds. /// The sample rate of the audio, in Hz. /// The number of audio channels. - /// The release information of the audio. + /// The release information of the audio. /// The description of the audio. /// The language of the audio. - /// The optional original language of the video. + /// The optional original language of the audio. /// The bit depth of the audio. /// The audio codec used. /// The genres of the audio. /// The tags associated with the audio. + /// The bitrate of the audio in kbps. /// /// An containing either a successfully created , or an error message. /// @@ -110,9 +111,8 @@ public class AudioMetadata : BaseMetadata int durationInSeconds, int sampleRate, int channels, - ReleaseInfo release, - Optional - description, + ReleaseInfo releaseInfo, + Optional description, List genres, List tags, Optional language, @@ -127,7 +127,7 @@ public class AudioMetadata : BaseMetadata durationInSeconds, sampleRate, channels, - release, + releaseInfo, description, genres, tags, diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioRating.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioRating.cs new file mode 100644 index 00000000..212f5505 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioRating.cs @@ -0,0 +1,79 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Errors; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Common.ValueObjects.Metadata; +using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects; + +/// +/// Value Object for the rating of an audio media element. +/// +[DebuggerDisplay("{Value}/{MaxValue}")] +public class AudioRating : Rating +{ + /// + /// Gets the optional source of the rating (e.g., "MusicBrainz", "Last.fm"). + /// + public Optional Source { get; } + + /// + /// Initializes a new instance of the class. + /// + /// The numeric value of the rating. + /// The maximum possible rating value. + /// The optional source of the rating. + /// The optional number of votes or reviews. + private AudioRating(decimal value, decimal maxValue, Optional source, Optional voteCount) + : base(value, maxValue, voteCount) + { + Source = source; + } + + /// + /// Creates a new instance of the class. + /// + /// The numeric value of the rating. + /// The maximum possible rating value. + /// The optional source of the rating. + /// The optional number of votes or reviews. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create(decimal value, decimal maxValue, Optional source, Optional voteCount) + { + if (value > maxValue) + return Errors.Metadata.RatingValueCannotBeGreaterThanMaxValue; + + return new AudioRating(value, maxValue, source, voteCount); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + yield return MaxValue; + yield return Source; + yield return VoteCount; + } + + /// + /// Customized ToString() method. + /// + /// Custom string value showing relevant data for current class. + public override string ToString() + { + string baseString = $"{Value}/{MaxValue}"; + if (Source.HasValue) + baseString += $" ({Source.Value})"; + if (VoteCount.HasValue) + baseString += $" [{VoteCount.Value} votes]"; + return baseString; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/LibraryManagementBoundedContext/LibraryAggregate/LibraryId.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/LibraryManagementBoundedContext/LibraryAggregate/LibraryId.cs new file mode 100644 index 00000000..7e89ed9f --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/LibraryManagementBoundedContext/LibraryAggregate/LibraryId.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Models.Core; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.LibraryManagementBoundedContext.LibraryAggregate; + +/// +/// Value Object for the Id of a media library, duplicated from the LibraryManagement bounded context to keep the cross bounded context references decoupled. +/// +[DebuggerDisplay("{Value}")] +public sealed class LibraryId : EntityId +{ + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private LibraryId(Guid value) : base(value) + { + } + + /// + /// Creates a new instance of the class. + /// + /// The created instance. + public static LibraryId CreateUnique() + { + return new LibraryId(Guid.NewGuid()); + } + + /// + /// Creates a new instance of the class, from a pre-existing . + /// + /// The value used to create the instance. + /// The created instance. + public static LibraryId Create(Guid value) + { + return new LibraryId(value); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorId.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorId.cs new file mode 100644 index 00000000..28fe2ebb --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorId.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Models.Core; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.MediaContributorBoundedContext.MediaContributorAggregate; + +/// +/// Value Object for the Id of a media contributor, duplicated from the MediaContributor bounded context to keep the cross bounded context references decoupled. +/// +[DebuggerDisplay("{Value}")] +public sealed class MediaContributorId : EntityId +{ + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private MediaContributorId(Guid value) : base(value) + { + } + + /// + /// Creates a new instance of the class. + /// + /// The created instance. + public static MediaContributorId CreateUnique() + { + return new MediaContributorId(Guid.NewGuid()); + } + + /// + /// Creates a new instance of the class, from a pre-existing . + /// + /// The value used to create the instance. + /// The created instance. + public static MediaContributorId Create(Guid value) + { + return new MediaContributorId(value); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Artist.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Artist.cs new file mode 100644 index 00000000..f9227955 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Artist.cs @@ -0,0 +1,205 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Errors; +using Lumina.Domain.Common.Models.Core; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.MediaContributorBoundedContext.MediaContributorAggregate; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.Entities; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate; + +/// +/// Aggregate root for an artist. +/// +/// +/// An artist is the entity that produced a musical work, whatever or whoever that might be. An artist is a single person, like Freddie Mercury, a group of people, +/// like Queen, or a collaboration between artists, like Queen and David Bowie. The media contributors that make up the artist, together with the roles they play, +/// are tracked as credits, and the artist can also reference the single media contributor it corresponds to, so that an artist and the person behind it are never duplicated. +/// +[DebuggerDisplay("Id: {Id} Name: {Name}")] +public sealed class Artist : AggregateRoot +{ + private readonly List _credits; + private readonly List _albums; + + /// + /// Gets the name of the artist. + /// + public string Name { get; private set; } + + /// + /// Gets the website of the artist, if applicable. + /// + public Optional Website { get; private set; } + + /// + /// Gets the MusicBrainz identifier of the artist, if applicable. + /// + public Optional MusicBrainzArtistId { get; private set; } + + /// + /// Gets the Id of the media contributor the artist corresponds to, if applicable. + /// + public Optional MediaContributorId { get; private set; } + + /// + /// Gets the list of the credits of the media contributors that make up the artist. + /// + public IReadOnlyCollection Credits => _credits.AsReadOnly(); + + /// + /// Gets the list of albums of the artist. + /// + public IReadOnlyCollection Albums => _albums.AsReadOnly(); + + /// + /// Initializes a new instance of the class. + /// + /// The object representing the unique identifier of the artist. + /// The name of the artist. + /// The optional website of the artist. + /// The optional MusicBrainz identifier of the artist. + /// The optional Id of the media contributor the artist corresponds to. + /// The list of the credits of the media contributors that make up the artist. + /// The list of albums of the artist. + /// The date and time when the entity was created. + /// The date and time when the entity was last updated. + private Artist( + ArtistId id, + string name, + Optional website, + Optional musicBrainzArtistId, + Optional mediaContributorId, + List credits, + List albums, + DateTime createdOnUtc, + Optional updatedOnUtc) : base(id) + { + Id = id; + Name = name; + Website = website; + MusicBrainzArtistId = musicBrainzArtistId; + MediaContributorId = mediaContributorId; + _credits = credits; + _albums = albums; + CreatedOnUtc = createdOnUtc; + UpdatedOnUtc = updatedOnUtc.HasValue ? updatedOnUtc.Value : null; + } + + /// + /// Creates a new instance of the class. + /// + /// The name of the artist. + /// The optional website of the artist. + /// The optional MusicBrainz identifier of the artist. + /// The optional Id of the media contributor the artist corresponds to. + /// The list of the credits of the media contributors that make up the artist. + /// The list of albums of the artist. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create( + string name, + Optional website, + Optional musicBrainzArtistId, + Optional mediaContributorId, + List credits, + List albums) + { + if (string.IsNullOrWhiteSpace(name)) + return Errors.Music.ArtistNameCannotBeEmpty; + + return new Artist( + ArtistId.CreateUnique(), + name, + website, + musicBrainzArtistId, + mediaContributorId, + credits, + albums, + DateTime.UtcNow, + Optional.None()); + } + + /// + /// Creates a new instance of the class, with a pre-existing . + /// + /// The object representing the unique identifier of the artist. + /// The name of the artist. + /// The optional website of the artist. + /// The optional MusicBrainz identifier of the artist. + /// The optional Id of the media contributor the artist corresponds to. + /// The list of the credits of the media contributors that make up the artist. + /// The list of albums of the artist. + /// The date and time when the entity was created. + /// The date and time when the entity was last updated. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create( + ArtistId id, + string name, + Optional website, + Optional musicBrainzArtistId, + Optional mediaContributorId, + List credits, + List albums, + DateTime createdOnUtc, + Optional updatedOnUtc) + { + if (string.IsNullOrWhiteSpace(name)) + return Errors.Music.ArtistNameCannotBeEmpty; + + return new Artist( + id, + name, + website, + musicBrainzArtistId, + mediaContributorId, + credits, + albums, + createdOnUtc, + updatedOnUtc); + } + + /// + /// Adds an album to the artist. + /// + /// The album to be added. + /// An representing either a successful operation, or an error. + public Result AddAlbum(Album album) + { + if (_albums.Contains(album)) + return Errors.Music.TheArtistAlreadyHasTheAlbum; + _albums.Add(album); + return Result.Created; + } + + /// + /// Removes an album from the artist. + /// + /// The album to be removed. + /// An representing either a successful operation, or an error. + public Result RemoveAlbum(Album album) + { + if (!_albums.Contains(album)) + return Errors.Music.TheArtistDoesNotHaveTheAlbum; + _albums.Remove(album); + return Result.Deleted; + } + + /// + /// Replaces the credits of the media contributors that make up the artist with the provided . + /// + /// The credits of the media contributors that make up the artist. + public void UpdateCredits(IReadOnlyCollection credits) + { + // replace the contents of the collection in place, preserving the readonly reference invariants of the aggregate + _credits.Clear(); + _credits.AddRange(credits); + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Entities/Album.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Entities/Album.cs new file mode 100644 index 00000000..3008b344 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Entities/Album.cs @@ -0,0 +1,236 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Errors; +using Lumina.Domain.Common.Models.Core; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; +using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.Entities; + +/// +/// Entity for an album, a release of an artist. +/// +[DebuggerDisplay("{Id}: {Metadata.Title}")] +public sealed class Album : Entity +{ + private readonly List _credits; + private readonly List _ratings; + private readonly List _tracks; + + /// + /// Gets the album metadata of the album. + /// + public AlbumMetadata Metadata { get; private set; } + + /// + /// Gets the physical or digital medium of the album, if applicable. + /// + public Optional MediaFormat { get; private set; } + + /// + /// Gets the barcode of the album, if applicable. + /// + public Optional Barcode { get; private set; } + + /// + /// Gets the catalog number of the album, if applicable. + /// + public Optional CatalogNumber { get; private set; } + + /// + /// Gets the MusicBrainz identifier of the release, if applicable. + /// + public Optional MusicBrainzReleaseId { get; private set; } + + /// + /// Gets the MusicBrainz identifier of the release group, if applicable. + /// + public Optional MusicBrainzReleaseGroupId { get; private set; } + + /// + /// Gets the MusicBrainz identifier of the release artist, if applicable. + /// + public Optional MusicBrainzReleaseArtistId { get; private set; } + + /// + /// Gets the list of the credits of the media contributors of the album. + /// + public IReadOnlyCollection Credits => _credits.AsReadOnly(); + + /// + /// Gets the list of ratings for this album. + /// + public IReadOnlyCollection Ratings => _ratings.AsReadOnly(); + + /// + /// Gets the list of tracks of the album. + /// + public IReadOnlyCollection Tracks => _tracks.AsReadOnly(); + + /// + /// Initializes a new instance of the class. + /// + /// The object representing the unique identifier of the album. + /// The album metadata of the album. + /// The optional physical or digital medium of the album. + /// The optional barcode of the album. + /// The optional catalog number of the album. + /// The optional MusicBrainz identifier of the release. + /// The optional MusicBrainz identifier of the release group. + /// The optional MusicBrainz identifier of the release artist. + /// The list of the credits of the media contributors of the album. + /// The list of ratings for the album. + /// The list of tracks of the album. + private Album( + AlbumId id, + AlbumMetadata metadata, + Optional mediaFormat, + Optional barcode, + Optional catalogNumber, + Optional musicBrainzReleaseId, + Optional musicBrainzReleaseGroupId, + Optional musicBrainzReleaseArtistId, + List credits, + List ratings, + List tracks) : base(id) + { + Id = id; + Metadata = metadata; + MediaFormat = mediaFormat; + Barcode = barcode; + CatalogNumber = catalogNumber; + MusicBrainzReleaseId = musicBrainzReleaseId; + MusicBrainzReleaseGroupId = musicBrainzReleaseGroupId; + MusicBrainzReleaseArtistId = musicBrainzReleaseArtistId; + _credits = credits; + _ratings = ratings; + _tracks = tracks; + } + + /// + /// Creates a new instance of the class. + /// + /// The album metadata of the album. + /// The optional physical or digital medium of the album. + /// The optional barcode of the album. + /// The optional catalog number of the album. + /// The optional MusicBrainz identifier of the release. + /// The optional MusicBrainz identifier of the release group. + /// The optional MusicBrainz identifier of the release artist. + /// The list of the credits of the media contributors of the album. + /// The list of ratings for the album. + /// The list of tracks of the album. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create( + AlbumMetadata metadata, + Optional mediaFormat, + Optional barcode, + Optional catalogNumber, + Optional musicBrainzReleaseId, + Optional musicBrainzReleaseGroupId, + Optional musicBrainzReleaseArtistId, + List credits, + List ratings, + List tracks) + { + return new Album( + AlbumId.CreateUnique(), + metadata, + mediaFormat, + barcode, + catalogNumber, + musicBrainzReleaseId, + musicBrainzReleaseGroupId, + musicBrainzReleaseArtistId, + credits, + ratings, + tracks); + } + + /// + /// Creates a new instance of the class, with a pre-existing . + /// + /// The object representing the unique identifier of the album. + /// The album metadata of the album. + /// The optional physical or digital medium of the album. + /// The optional barcode of the album. + /// The optional catalog number of the album. + /// The optional MusicBrainz identifier of the release. + /// The optional MusicBrainz identifier of the release group. + /// The optional MusicBrainz identifier of the release artist. + /// The list of the credits of the media contributors of the album. + /// The list of ratings for the album. + /// The list of tracks of the album. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create( + AlbumId id, + AlbumMetadata metadata, + Optional mediaFormat, + Optional barcode, + Optional catalogNumber, + Optional musicBrainzReleaseId, + Optional musicBrainzReleaseGroupId, + Optional musicBrainzReleaseArtistId, + List credits, + List ratings, + List tracks) + { + return new Album( + id, + metadata, + mediaFormat, + barcode, + catalogNumber, + musicBrainzReleaseId, + musicBrainzReleaseGroupId, + musicBrainzReleaseArtistId, + credits, + ratings, + tracks); + } + + /// + /// Adds a track to the album. + /// + /// The track to be added. + /// An representing either a successful operation, or an error. + public Result AddTrack(Track track) + { + if (_tracks.Contains(track)) + return Errors.Music.TheTrackIsAlreadyInTheAlbum; + _tracks.Add(track); + return Result.Created; + } + + /// + /// Removes a track from the album. + /// + /// The track to be removed. + /// An representing either a successful operation, or an error. + public Result RemoveTrack(Track track) + { + if (!_tracks.Contains(track)) + return Errors.Music.TheTrackIsNotInTheAlbum; + _tracks.Remove(track); + return Result.Deleted; + } + + /// + /// Replaces the credits of the media contributors of the album with the provided . + /// + /// The credits of the media contributors of the album. + public void UpdateCredits(IReadOnlyCollection credits) + { + // replace the contents of the collection in place, preserving the readonly reference invariants of the entity + _credits.Clear(); + _credits.AddRange(credits); + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Entities/Track.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Entities/Track.cs new file mode 100644 index 00000000..ca77eb72 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Entities/Track.cs @@ -0,0 +1,296 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Models.Core; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Common.ValueObjects.Metadata; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.LibraryManagementBoundedContext.LibraryAggregate; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; +using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.Entities; + +/// +/// Entity for a track, the individual song of an album. +/// +[DebuggerDisplay("{Id}: {Metadata.Title}")] +public sealed class Track : Entity +{ + private readonly List _isrcs; + private readonly List _moods; + private readonly List _credits; + private readonly List _ratings; + + /// + /// Gets the Id of the media library this track belongs to. + /// + public LibraryId LibraryId { get; private set; } + + /// + /// Gets the file system path of the track. + /// + public string Path { get; private set; } + + /// + /// Gets the audio metadata of the track. + /// + public AudioMetadata Metadata { get; private set; } + + /// + /// Gets the number of the track on its disc. + /// + public int TrackNumber { get; private set; } + + /// + /// Gets the number of the disc the track belongs to, if applicable. + /// + public Optional DiscNumber { get; private set; } + + /// + /// Gets the script used by the language of the track, if applicable. + /// + public Optional Script { get; private set; } + + /// + /// Gets the musical key of the track, if applicable. + /// + public Optional Key { get; private set; } + + /// + /// Gets the tempo of the track in beats per minute, if applicable. + /// + public Optional Bpm { get; private set; } + + /// + /// Gets the title of the work the track is a recording of, if applicable. + /// + public Optional Work { get; private set; } + + /// + /// Gets the MusicBrainz identifier of the recording, if applicable. + /// + public Optional MusicBrainzRecordingId { get; private set; } + + /// + /// Gets the MusicBrainz identifier of the track, if applicable. + /// + public Optional MusicBrainzTrackId { get; private set; } + + /// + /// Gets the MusicBrainz identifier of the work, if applicable. + /// + public Optional MusicBrainzWorkId { get; private set; } + + /// + /// Gets the list of moods of the track. + /// + public IReadOnlyCollection Moods => _moods.AsReadOnly(); + + /// + /// Gets the list of ISRC (International Standard Recording Code) of the track. + /// + public IReadOnlyCollection Isrcs => _isrcs.AsReadOnly(); + + /// + /// Gets the list of the credits of the media contributors of the track. + /// + public IReadOnlyCollection Credits => _credits.AsReadOnly(); + + /// + /// Gets the list of ratings for this track. + /// + public IReadOnlyCollection Ratings => _ratings.AsReadOnly(); + + /// + /// Initializes a new instance of the class. + /// + /// The object representing the unique identifier of the track. + /// The Id of the media library this track belongs to. + /// The file system path of the track. + /// The audio metadata of the track. + /// The number of the track on its disc. + /// The optional number of the disc the track belongs to. + /// The list of ISRC of the track. + /// The optional script used by the language of the track. + /// The optional musical key of the track. + /// The optional tempo of the track in beats per minute. + /// The list of moods of the track. + /// The optional title of the work the track is a recording of. + /// The optional MusicBrainz identifier of the recording. + /// The optional MusicBrainz identifier of the track. + /// The optional MusicBrainz identifier of the work. + /// The list of the credits of the media contributors of the track. + /// The list of ratings for the track. + private Track( + TrackId id, + LibraryId libraryId, + string path, + AudioMetadata metadata, + int trackNumber, + Optional discNumber, + List isrcs, + Optional script, + Optional key, + Optional bpm, + List moods, + Optional work, + Optional musicBrainzRecordingId, + Optional musicBrainzTrackId, + Optional musicBrainzWorkId, + List credits, + List ratings) : base(id) + { + Id = id; + LibraryId = libraryId; + Path = path; + Metadata = metadata; + TrackNumber = trackNumber; + DiscNumber = discNumber; + _isrcs = isrcs; + _moods = moods; + Script = script; + Key = key; + Bpm = bpm; + Work = work; + MusicBrainzRecordingId = musicBrainzRecordingId; + MusicBrainzTrackId = musicBrainzTrackId; + MusicBrainzWorkId = musicBrainzWorkId; + _credits = credits; + _ratings = ratings; + } + + /// + /// Creates a new instance of the class. + /// + /// The Id of the media library this track belongs to. + /// The file system path of the track. + /// The audio metadata of the track. + /// The number of the track on its disc. + /// The optional number of the disc the track belongs to. + /// The list of ISRC of the track. + /// The optional script used by the language of the track. + /// The optional musical key of the track. + /// The optional tempo of the track in beats per minute. + /// The list of moods of the track. + /// The optional title of the work the track is a recording of. + /// The optional MusicBrainz identifier of the recording. + /// The optional MusicBrainz identifier of the track. + /// The optional MusicBrainz identifier of the work. + /// The list of the credits of the media contributors of the track. + /// The list of ratings for the track. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create( + LibraryId libraryId, + string path, + AudioMetadata metadata, + int trackNumber, + Optional discNumber, + List isrcs, + Optional script, + Optional key, + Optional bpm, + List moods, + Optional work, + Optional musicBrainzRecordingId, + Optional musicBrainzTrackId, + Optional musicBrainzWorkId, + List credits, + List ratings) + { + return new Track( + TrackId.CreateUnique(), + libraryId, + path, + metadata, + trackNumber, + discNumber, + isrcs, + script, + key, + bpm, + moods, + work, + musicBrainzRecordingId, + musicBrainzTrackId, + musicBrainzWorkId, + credits, + ratings); + } + + /// + /// Creates a new instance of the class, with a pre-existing . + /// + /// The object representing the unique identifier of the track. + /// The Id of the media library this track belongs to. + /// The file system path of the track. + /// The audio metadata of the track. + /// The number of the track on its disc. + /// The optional number of the disc the track belongs to. + /// The list of ISRC of the track. + /// The optional script used by the language of the track. + /// The optional musical key of the track. + /// The optional tempo of the track in beats per minute. + /// The list of moods of the track. + /// The optional title of the work the track is a recording of. + /// The optional MusicBrainz identifier of the recording. + /// The optional MusicBrainz identifier of the track. + /// The optional MusicBrainz identifier of the work. + /// The list of the credits of the media contributors of the track. + /// The list of ratings for the track. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create( + TrackId id, + LibraryId libraryId, + string path, + AudioMetadata metadata, + int trackNumber, + Optional discNumber, + List isrcs, + Optional script, + Optional key, + Optional bpm, + List moods, + Optional work, + Optional musicBrainzRecordingId, + Optional musicBrainzTrackId, + Optional musicBrainzWorkId, + List credits, + List ratings) + { + return new Track( + id, + libraryId, + path, + metadata, + trackNumber, + discNumber, + isrcs, + script, + key, + bpm, + moods, + work, + musicBrainzRecordingId, + musicBrainzTrackId, + musicBrainzWorkId, + credits, + ratings); + } + + /// + /// Replaces the credits of the media contributors of the track with the provided . + /// + /// The credits of the media contributors of the track. + public void UpdateCredits(IReadOnlyCollection credits) + { + // replace the contents of the collection in place, preserving the readonly reference invariants of the entity + _credits.Clear(); + _credits.AddRange(credits); + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/AlbumId.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/AlbumId.cs new file mode 100644 index 00000000..94440675 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/AlbumId.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Models.Core; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; + +/// +/// Value Object for the Id of an album. +/// +[DebuggerDisplay("{Value}")] +public sealed class AlbumId : EntityId +{ + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private AlbumId(Guid value) : base(value) + { + } + + /// + /// Creates a new instance of the class. + /// + /// The created instance. + public static AlbumId CreateUnique() + { + return new AlbumId(Guid.NewGuid()); + } + + /// + /// Creates a new instance of the class, from a pre-existing . + /// + /// The value used to create the instance. + /// The created instance. + public static AlbumId Create(Guid value) + { + return new AlbumId(value); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/AlbumMetadata.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/AlbumMetadata.cs new file mode 100644 index 00000000..80ebc675 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/AlbumMetadata.cs @@ -0,0 +1,133 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Common.ValueObjects.Metadata; +using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; + +/// +/// Value Object for the metadata of an album. +/// +[DebuggerDisplay("{Title}")] +public class AlbumMetadata : BaseMetadata +{ + /// + /// Gets the type of the release, if applicable. + /// + public Optional ReleaseType { get; } + + /// + /// Gets the status of the release, if applicable. + /// + public Optional ReleaseStatus { get; } + + /// + /// Gets the number of discs of the release, if applicable. + /// + public Optional TotalDiscs { get; } + + /// + /// Gets the number of tracks of the release. + /// + public int TotalTracks { get; } + + /// + /// Initializes a new instance of the class. + /// + /// The title of the album. + /// The optional original title of the album, if applicable. + /// The description of the album, if applicable. + /// The release information of the album. + /// The genres of the album. + /// The tags associated with the album. + /// The language of the album, if applicable. + /// The optional original language of the album, if applicable. + /// The optional type of the release. + /// The optional status of the release. + /// The optional number of discs of the release. + /// The number of tracks of the release. + private AlbumMetadata( + string title, + Optional originalTitle, + Optional description, + ReleaseInfo releaseInfo, + List genres, + List tags, + Optional language, + Optional originalLanguage, + Optional releaseType, + Optional releaseStatus, + Optional totalDiscs, + int totalTracks) + : base(title, originalTitle, description, releaseInfo, genres, tags, language, originalLanguage) + { + ReleaseType = releaseType; + ReleaseStatus = releaseStatus; + TotalDiscs = totalDiscs; + TotalTracks = totalTracks; + } + + /// + /// Creates a new instance of the class. + /// + /// The title of the album. + /// The optional original title of the album, if applicable. + /// The description of the album, if applicable. + /// The release information of the album. + /// The genres of the album. + /// The tags associated with the album. + /// The language of the album, if applicable. + /// The optional original language of the album, if applicable. + /// The optional type of the release. + /// The optional status of the release. + /// The optional number of discs of the release. + /// The number of tracks of the release. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create( + string title, + Optional originalTitle, + Optional description, + ReleaseInfo releaseInfo, + List genres, + List tags, + Optional language, + Optional originalLanguage, + Optional releaseType, + Optional releaseStatus, + Optional totalDiscs, + int totalTracks) + { + return new AlbumMetadata( + title, + originalTitle, + description, + releaseInfo, + genres, + tags, + language, + originalLanguage, + releaseType, + releaseStatus, + totalDiscs, + totalTracks); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + foreach (object component in base.GetEqualityComponents()) + yield return component; + yield return ReleaseType; + yield return ReleaseStatus; + yield return TotalDiscs; + yield return TotalTracks; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/ArtistId.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/ArtistId.cs new file mode 100644 index 00000000..6cd270c4 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/ArtistId.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Models.Core; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; + +/// +/// Value Object for the Id of an artist. +/// +[DebuggerDisplay("{Value}")] +public sealed class ArtistId : EntityId +{ + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private ArtistId(Guid value) : base(value) + { + } + + /// + /// Creates a new instance of the class. + /// + /// The created instance. + public static ArtistId CreateUnique() + { + return new ArtistId(Guid.NewGuid()); + } + + /// + /// Creates a new instance of the class, from a pre-existing . + /// + /// The value used to create the instance. + /// The created instance. + public static ArtistId Create(Guid value) + { + return new ArtistId(value); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/Barcode.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/Barcode.cs new file mode 100644 index 00000000..82282edd --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/Barcode.cs @@ -0,0 +1,61 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Errors; +using Lumina.Domain.Common.Models.Core; +using Lumina.Domain.Common.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text.RegularExpressions; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; + +/// +/// Value Object for the barcode of an album. +/// +[DebuggerDisplay("{Value}")] +public sealed class Barcode : ValueObject +{ + private static readonly Regex s_barcodeRegex = new(@"^\d{12,13}$", RegexOptions.Compiled); + + /// + /// Gets the value of the barcode. + /// + public string Value { get; } + + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private Barcode(string value) + { + Value = value; + } + + /// + /// Creates a new instance of the class. + /// + /// The value of the barcode. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create(string? value) + { + if (string.IsNullOrWhiteSpace(value)) + return Errors.Music.BarcodeValueCannotBeEmpty; + + string cleanedValue = value.Trim(); + if (!s_barcodeRegex.IsMatch(cleanedValue)) + return Errors.Music.InvalidFormatForBarcode; + + return new Barcode(cleanedValue); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/Isrc.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/Isrc.cs new file mode 100644 index 00000000..7fe8c356 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/Isrc.cs @@ -0,0 +1,61 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Errors; +using Lumina.Domain.Common.Models.Core; +using Lumina.Domain.Common.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text.RegularExpressions; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; + +/// +/// Value Object for the ISRC (International Standard Recording Code) of a track. +/// +[DebuggerDisplay("{Value}")] +public sealed class Isrc : ValueObject +{ + private static readonly Regex s_isrcRegex = new(@"^[A-Z]{2}[A-Z0-9]{3}[0-9]{7}$", RegexOptions.Compiled); + + /// + /// Gets the value of the ISRC. + /// + public string Value { get; } + + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private Isrc(string value) + { + Value = value; + } + + /// + /// Creates a new instance of the class. + /// + /// The value of the ISRC. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create(string? value) + { + if (string.IsNullOrWhiteSpace(value)) + return Errors.Music.IsrcValueCannotBeEmpty; + + string cleanedValue = value.Trim().ToUpperInvariant(); + if (!s_isrcRegex.IsMatch(cleanedValue)) + return Errors.Music.IsrcInvalidFormat; + + return new Isrc(cleanedValue); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/MediaContributorCredit.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/MediaContributorCredit.cs new file mode 100644 index 00000000..99f63868 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/MediaContributorCredit.cs @@ -0,0 +1,76 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Errors; +using Lumina.Domain.Common.Models.Core; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.MediaContributorBoundedContext.MediaContributorAggregate; +using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; + +/// +/// Value Object for the credit of a media contributor in a music media element, carrying the role the contributor played. +/// The role carries both a free-form display name, as returned by the metadata providers, and the canonical category +/// the display name normalizes to, so that roles describing the same kind of contribution are never treated as distinct. +/// +[DebuggerDisplay("{RoleDisplayName}")] +public sealed class MediaContributorCredit : ValueObject +{ + /// + /// Gets the unique identifier of the credited media contributor. + /// + public MediaContributorId ContributorId { get; } + + /// + /// Gets the display name of the role the contributor played. + /// + public string RoleDisplayName { get; } + + /// + /// Gets the canonical category of the role the contributor played. + /// + public MediaContributorRoleCategory RoleCategory { get; } + + /// + /// Initializes a new instance of the class. + /// + /// The unique identifier of the credited media contributor. + /// The display name of the role the contributor played. + /// The canonical category of the role the contributor played. + private MediaContributorCredit(MediaContributorId contributorId, string roleDisplayName, MediaContributorRoleCategory roleCategory) + { + ContributorId = contributorId; + RoleDisplayName = roleDisplayName; + RoleCategory = roleCategory; + } + + /// + /// Creates a new instance of the class. + /// + /// The unique identifier of the credited media contributor. + /// The display name of the role the contributor played. + /// The canonical category of the role the contributor played. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create(MediaContributorId contributorId, string roleDisplayName, MediaContributorRoleCategory roleCategory) + { + if (string.IsNullOrWhiteSpace(roleDisplayName)) + return Errors.Music.CreditRoleDisplayNameCannotBeEmpty; + + return new MediaContributorCredit(contributorId, roleDisplayName, roleCategory); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return ContributorId; + yield return RoleDisplayName; + yield return RoleCategory; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/MusicBrainzId.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/MusicBrainzId.cs new file mode 100644 index 00000000..37501bd7 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/MusicBrainzId.cs @@ -0,0 +1,67 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Errors; +using Lumina.Domain.Common.Models.Core; +using Lumina.Domain.Common.Primitives; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; + +/// +/// Value Object for a MusicBrainz identifier. +/// +[DebuggerDisplay("{Value}")] +public sealed class MusicBrainzId : ValueObject +{ + /// + /// Gets the unique identifier assigned by MusicBrainz. + /// + public Guid Value { get; } + + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private MusicBrainzId(Guid value) + { + Value = value; + } + + /// + /// Creates a new instance of the class, from a pre-existing . + /// + /// The value used to create the instance. + /// The created instance. + public static Result Create(Guid value) + { + return new MusicBrainzId(value); + } + + /// + /// Creates a new instance of the class, from a . + /// + /// The value used to create the instance. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create(string? value) + { + if (string.IsNullOrWhiteSpace(value)) + return Errors.Music.MusicBrainzIdInvalidFormat; + if (!Guid.TryParse(value, out Guid parsedValue)) + return Errors.Music.MusicBrainzIdInvalidFormat; + + return new MusicBrainzId(parsedValue); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/TrackId.cs b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/TrackId.cs new file mode 100644 index 00000000..17e7e1e6 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ValueObjects/TrackId.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Models.Core; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects; + +/// +/// Value Object for the Id of a track. +/// +[DebuggerDisplay("{Value}")] +public sealed class TrackId : EntityId +{ + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private TrackId(Guid value) : base(value) + { + } + + /// + /// Creates a new instance of the class. + /// + /// The created instance. + public static TrackId CreateUnique() + { + return new TrackId(Guid.NewGuid()); + } + + /// + /// Creates a new instance of the class, from a pre-existing . + /// + /// The value used to create the instance. + /// The created instance. + public static TrackId Create(Guid value) + { + return new TrackId(value); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributor.cs b/src/Lumina.Domain/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributor.cs index a2f59b1e..06e0b6b0 100644 --- a/src/Lumina.Domain/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributor.cs +++ b/src/Lumina.Domain/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributor.cs @@ -2,6 +2,7 @@ using Lumina.Domain.Common.Models.Core; using Lumina.Domain.Common.Primitives; using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects; +using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; using System; using System.Diagnostics; #endregion @@ -9,14 +10,20 @@ using System.Diagnostics; namespace Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate; /// -/// Aggregate root for a media contributor, the person that contributed to a media item. -/// A media contributor is a person, unique by name, agnostic of the kind of media it contributed to, and of -/// the roles it played in the media items. The roles a contributor plays are tracked per media item, so that a -/// single contributor that is both an actor and a writer is never duplicated. +/// Aggregate root for a media contributor. /// +/// +/// A media contributor can be a single person or a group of people, like a band, and is unique by name, agnostic of the kind of media it contributed to, and of the roles +/// it played in the media items. The roles a contributor plays are tracked per media item, so that a single contributor that is both an actor and a writer is never duplicated. +/// [DebuggerDisplay("{Id}: {Name}")] public class MediaContributor : AggregateRoot { + /// + /// Gets the type of the contributor, whether it is a person, a group, or an organization. + /// + public MediaContributorType Type { get; private set; } + /// /// Gets the name of the contributor. /// @@ -41,18 +48,21 @@ public class MediaContributor : AggregateRoot /// Initializes a new instance of the class. /// /// The unique identifier of the contributor. + /// The type of the contributor. /// The name of the contributor. /// The optional biography of the contributor. /// The optional date of birth of the contributor. /// The optional date of death of the contributor. private MediaContributor( MediaContributorId id, + MediaContributorType type, MediaContributorName name, Optional biography, Optional dateOfBirth, Optional dateOfDeath) : base(id) { Id = id; + Type = type; Name = name; Biography = biography; DateOfBirth = dateOfBirth; @@ -62,12 +72,14 @@ public class MediaContributor : AggregateRoot /// /// Creates a new instance of the class. /// + /// The type of the contributor. /// The name of the contributor. /// The created instance. - public static Result Create(MediaContributorName name) + public static Result Create(MediaContributorType type, MediaContributorName name) { return new MediaContributor( MediaContributorId.CreateUnique(), + type, name, Optional.None(), Optional.None(), @@ -78,6 +90,7 @@ public class MediaContributor : AggregateRoot /// Creates a new instance of the class, from a pre-existing . /// /// The unique identifier of the contributor. + /// The type of the contributor. /// The name of the contributor. /// The optional biography of the contributor. /// The optional date of birth of the contributor. @@ -85,11 +98,12 @@ public class MediaContributor : AggregateRoot /// The created instance. public static Result Create( MediaContributorId id, + MediaContributorType type, MediaContributorName name, Optional biography, Optional dateOfBirth, Optional dateOfDeath) { - return new MediaContributor(id, name, biography, dateOfBirth, dateOfDeath); + return new MediaContributor(id, type, name, biography, dateOfBirth, dateOfDeath); } } diff --git a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/MovieLibraryAggregate/Services/IMovieLibraryService.cs b/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/MovieLibraryAggregate/Services/IMovieLibraryService.cs deleted file mode 100644 index 34fc2432..00000000 --- a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/MovieLibraryAggregate/Services/IMovieLibraryService.cs +++ /dev/null @@ -1,16 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using System.Collections.Generic; -#endregion - -namespace Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services; - -/// -/// Interface for the service for managing movie libraries. -/// -public interface IMovieLibraryService -{ - /// - /// Gets the collection of movies in the library. - /// - public ICollection Movies { get; } -} diff --git a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/MovieLibraryAggregate/Services/MovieLibraryService.cs b/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/MovieLibraryAggregate/Services/MovieLibraryService.cs deleted file mode 100644 index d8415b3d..00000000 --- a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/MovieLibraryAggregate/Services/MovieLibraryService.cs +++ /dev/null @@ -1,17 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using System; -using System.Collections.Generic; -#endregion - -namespace Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services; - -/// -/// Service for managing movie libraries. -/// -public sealed class MovieLibraryService : IMovieLibraryService -{ - /// - /// Gets the collection of movies in the library. - /// - public ICollection Movies => throw new NotImplementedException(); -} \ No newline at end of file diff --git a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/Services/IVideoLibraryService.cs b/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/Services/IVideoLibraryService.cs deleted file mode 100644 index 758a51a8..00000000 --- a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/Services/IVideoLibraryService.cs +++ /dev/null @@ -1,22 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services; -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services; -#endregion - -namespace Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.Services; - -/// -/// Interface for the service for managing video content. -/// -public interface IVideoLibraryService -{ - /// - /// Gets the service for managing a movie library. - /// - public IMovieLibraryService MovieLibraryService { get; } - - /// - /// Gets the service for managing a TV shows library. - /// - public ITvShowLibraryService TvShowLibraryService { get; } -} diff --git a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/Services/VideoLibraryService.cs b/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/Services/VideoLibraryService.cs deleted file mode 100644 index 3bfe300b..00000000 --- a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/Services/VideoLibraryService.cs +++ /dev/null @@ -1,33 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services; -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services; -#endregion - -namespace Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.Services; - -/// -/// Service for managing video content. -/// -public class VideoLibraryService : IVideoLibraryService -{ - /// - /// Gets the service for managing a movie library. - /// - public IMovieLibraryService MovieLibraryService { get; private set; } - - /// - /// Gets the service for managing a TV shows library. - /// - public ITvShowLibraryService TvShowLibraryService { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - /// Injected movie library service. - /// Injected TV show library service. - public VideoLibraryService(IMovieLibraryService movieLibraryService, ITvShowLibraryService tvShowLibraryService) - { - MovieLibraryService = movieLibraryService; - TvShowLibraryService = tvShowLibraryService; - } -} diff --git a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/TvShowLibraryAggregate/Services/ITvShowLibraryService.cs b/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/TvShowLibraryAggregate/Services/ITvShowLibraryService.cs deleted file mode 100644 index 311df28e..00000000 --- a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/TvShowLibraryAggregate/Services/ITvShowLibraryService.cs +++ /dev/null @@ -1,16 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using System.Collections.Generic; -#endregion - -namespace Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services; - -/// -/// Interface for the service for managing TV show libraries. -/// -public interface ITvShowLibraryService -{ - /// - /// Gets the collection of TV shows in the library. - /// - public ICollection TvShows { get; } -} diff --git a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/TvShowLibraryAggregate/Services/TvShowLibraryService.cs b/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/TvShowLibraryAggregate/Services/TvShowLibraryService.cs deleted file mode 100644 index b62ef2ed..00000000 --- a/src/Lumina.Domain/Core/BoundedContexts/VideoLibraryBoundedContext/TvShowLibraryAggregate/Services/TvShowLibraryService.cs +++ /dev/null @@ -1,17 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using System; -using System.Collections.Generic; -#endregion - -namespace Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services; - -/// -/// Service for managing TV show libraries. -/// -public class TvShowLibraryService : ITvShowLibraryService -{ - /// - /// Gets the collection of TV shows in the library. - /// - public ICollection TvShows => throw new NotImplementedException(); -} \ No newline at end of file diff --git a/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/BookLibraryAggregate/Book.cs b/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/BookLibraryAggregate/Book.cs index 914b0c97..e46c330e 100644 --- a/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/BookLibraryAggregate/Book.cs +++ b/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/BookLibraryAggregate/Book.cs @@ -112,6 +112,9 @@ public sealed class Book : AggregateRoot /// Gets the list of objects representing the unique identifiers of the media contributors (actors, directors, etc) starring in this book. /// public IReadOnlyCollection Contributors => _contributors.AsReadOnly(); + // TODO: the roles of the media contributors currently live only in the persistence layer (BookContributorEntity), and are lost + // at the domain level. To keep consistency with the Music aggregate, which models its credits as a MediaContributorCredit value + // object carrying both the contributor and the role, the roles should be moved into the Book aggregate as well. /// /// Gets the list of ratings for this book. diff --git a/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/Services/IWrittenContentLibraryService.cs b/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/Services/IWrittenContentLibraryService.cs deleted file mode 100644 index e7e0c8ae..00000000 --- a/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/Services/IWrittenContentLibraryService.cs +++ /dev/null @@ -1,16 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services; -#endregion - -namespace Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services; - -/// -/// Interface for the service for managing written content. -/// -public interface IWrittenContentLibraryService -{ - /// - /// Gets the service for managing book libraries. - /// - public IBookLibraryService BookLibraryService { get; } -} diff --git a/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/Services/WrittenContentLibraryService.cs b/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/Services/WrittenContentLibraryService.cs deleted file mode 100644 index 241c3535..00000000 --- a/src/Lumina.Domain/Core/BoundedContexts/WrittenContentLibraryBoundedContext/Services/WrittenContentLibraryService.cs +++ /dev/null @@ -1,25 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services; -#endregion - -namespace Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services; - -/// -/// Service for managing written content. -/// -public class WrittenContentLibraryService : IWrittenContentLibraryService -{ - /// - /// Gets the service for managing book libraries. - /// - public IBookLibraryService BookLibraryService { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - /// Injected book library service. - public WrittenContentLibraryService(IBookLibraryService bookLibraryService) - { - BookLibraryService = bookLibraryService; - } -} diff --git a/src/Lumina.Domain/Core/Services/IMediaLibraryService.cs b/src/Lumina.Domain/Core/Services/IMediaLibraryService.cs deleted file mode 100644 index ca9574ff..00000000 --- a/src/Lumina.Domain/Core/Services/IMediaLibraryService.cs +++ /dev/null @@ -1,27 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.Services; -using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services; -#endregion - -namespace Lumina.Domain.Core.Services; - -/// -/// Interface for the service for managing a media library. -/// -public interface IMediaLibraryService -{ - /// - /// Gets the service for managing a audio library. - /// - //public IAudioLibraryService AudioLibraryService { get; } - - /// - /// Gets the service for managing a video library. - /// - public IVideoLibraryService VideoLibraryService { get; } - - /// - /// Gets the service for managing a written content library. - /// - public IWrittenContentLibraryService WrittenContentLibraryService { get; } -} \ No newline at end of file diff --git a/src/Lumina.Domain/Core/Services/MediaLibraryService.cs b/src/Lumina.Domain/Core/Services/MediaLibraryService.cs deleted file mode 100644 index 8cbdf521..00000000 --- a/src/Lumina.Domain/Core/Services/MediaLibraryService.cs +++ /dev/null @@ -1,33 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.Services; -using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services; -#endregion - -namespace Lumina.Domain.Core.Services; - -/// -/// Service for managing media libraries. -/// -public class MediaLibraryService : IMediaLibraryService // TODO: perhaps a better naming would be IMediaLibraryFacade (same for injected facades here) -{ - /// - /// Gets the service for managing a video library. - /// - public IVideoLibraryService VideoLibraryService { get; private set; } - - /// - /// Gets the service for managing a written content library. - /// - public IWrittenContentLibraryService WrittenContentLibraryService { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - /// Injected video library service. - /// Injected written content library service. - public MediaLibraryService(IVideoLibraryService videoLibraryService, IWrittenContentLibraryService writtenContentLibraryService) - { - VideoLibraryService = videoLibraryService; - WrittenContentLibraryService = writtenContentLibraryService; - } -} diff --git a/src/Lumina.Infrastructure/Core/MediaLibrary/Management/Scanning/Jobs/Common/MetadataAggregator.cs b/src/Lumina.Infrastructure/Core/MediaLibrary/Management/Scanning/Jobs/Common/MetadataAggregator.cs index 3d314e8b..85abe3e3 100644 --- a/src/Lumina.Infrastructure/Core/MediaLibrary/Management/Scanning/Jobs/Common/MetadataAggregator.cs +++ b/src/Lumina.Infrastructure/Core/MediaLibrary/Management/Scanning/Jobs/Common/MetadataAggregator.cs @@ -66,7 +66,7 @@ internal static class MetadataAggregator FirstOrDefaultValue(first?.OriginalReleaseYear, second?.OriginalReleaseYear), FirstOrDefaultValue(first?.ReReleaseDate, second?.ReReleaseDate), FirstOrDefaultValue(first?.ReReleaseYear, second?.ReReleaseYear), - FirstOrDefaultReference(first?.ReleaseCountry, second?.ReleaseCountry), + FirstOrDefaultValue(first?.ReleaseCountry, second?.ReleaseCountry), FirstOrDefaultReference(first?.ReleaseVersion, second?.ReleaseVersion)); } diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/AddBook/AddBookEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/AddBook/AddBookEndpointSummary.cs index 4c02bb3c..2988ff81 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/AddBook/AddBookEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/AddBook/AddBookEndpointSummary.cs @@ -6,6 +6,7 @@ using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books; using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; using System; using System.Collections.Generic; @@ -40,7 +41,7 @@ public class AddBookEndpointSummary : Summary OriginalReleaseYear: 1954, ReReleaseDate: DateOnly.ParseExact("2001-09-06", "yyyy-MM-dd", null), ReReleaseYear: 2001, - ReleaseCountry: "uk", + ReleaseCountry: ReleaseCountry.GB, ReleaseVersion: "50th Anniversary Edition" ), Genres: new List() { @@ -237,7 +238,7 @@ public class AddBookEndpointSummary : Summary OriginalReleaseYear: 1954, ReReleaseDate: DateOnly.ParseExact("2001-09-06", "yyyy-MM-dd", null), ReReleaseYear: 2001, - ReleaseCountry: "uk", + ReleaseCountry: ReleaseCountry.GB, ReleaseVersion: "50th Anniversary Edition" ), Genres: diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBook/GetBookEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBook/GetBookEndpointSummary.cs index 86965b7f..f1b38187 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBook/GetBookEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBook/GetBookEndpointSummary.cs @@ -1,4 +1,4 @@ -#region ========================================================================= USING ===================================================================================== +#region ========================================================================= USING ===================================================================================== using FastEndpoints; using Lumina.Contracts.DTO.Common; using Lumina.Contracts.DTO.MediaContributors; @@ -8,6 +8,7 @@ using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.B using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -99,7 +100,7 @@ public class GetBookEndpointSummary : Summary OriginalReleaseYear: 1954, ReReleaseDate: DateOnly.ParseExact("2001-09-06", "yyyy-MM-dd", null), ReReleaseYear: 2001, - ReleaseCountry: "uk", + ReleaseCountry: ReleaseCountry.GB, ReleaseVersion: "50th Anniversary Edition" ), Genres: diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBooks/GetBooksEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBooks/GetBooksEndpointSummary.cs index 5f001ff6..1d3841f1 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBooks/GetBooksEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBooks/GetBooksEndpointSummary.cs @@ -1,4 +1,4 @@ -#region ========================================================================= USING ===================================================================================== +#region ========================================================================= USING ===================================================================================== using FastEndpoints; using Lumina.Contracts.DTO.Common; using Lumina.Contracts.DTO.MediaContributors; @@ -63,7 +63,7 @@ public class GetBooksEndpointSummary : Summary() { @@ -171,7 +171,7 @@ public class GetBooksEndpointSummary : Summary() { diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/UpdateBook/UpdateBookEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/UpdateBook/UpdateBookEndpointSummary.cs index 392faaf0..6d42a2b0 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/UpdateBook/UpdateBookEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/UpdateBook/UpdateBookEndpointSummary.cs @@ -1,4 +1,4 @@ -#region ========================================================================= USING ===================================================================================== +#region ========================================================================= USING ===================================================================================== using FastEndpoints; using Lumina.Contracts.DTO.Common; using Lumina.Contracts.DTO.MediaContributors; @@ -8,6 +8,7 @@ using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.B using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -82,7 +83,7 @@ public class UpdateBookEndpointSummary : Summary /// Gets the optional country or region of release. /// - public string? ReleaseCountry { get; set; } + public ReleaseCountry? ReleaseCountry { get; set; } /// /// Gets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0") diff --git a/src/Lumina.Presentation.Web/Common/DTO/WrittenContentLibrary/BookLibrary/BookDto.cs b/src/Lumina.Presentation.Web/Common/DTO/WrittenContentLibrary/BookLibrary/BookDto.cs index 3159edd1..cce23ee3 100644 --- a/src/Lumina.Presentation.Web/Common/DTO/WrittenContentLibrary/BookLibrary/BookDto.cs +++ b/src/Lumina.Presentation.Web/Common/DTO/WrittenContentLibrary/BookLibrary/BookDto.cs @@ -1,5 +1,6 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics; @@ -67,7 +68,7 @@ public class BookDto /// /// Gets the optional country or region of release. /// - public string? ReleaseCountry { get; init; } + public ReleaseCountry? ReleaseCountry { get; init; } /// /// Gets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0") diff --git a/src/Lumina.Presentation.Web/Common/Enums/Common/ReleaseCountry.cs b/src/Lumina.Presentation.Web/Common/Enums/Common/ReleaseCountry.cs new file mode 100644 index 00000000..c989ec33 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/Common/ReleaseCountry.cs @@ -0,0 +1,988 @@ + +namespace Lumina.Presentation.Web.Common.Enums.Common; + +/// +/// Enumeration for the country of a media release, using the ISO 3166-1 alpha-2 country codes. +/// +public enum ReleaseCountry +{ + /// + /// The ISO 3166-1 alpha-2 code of Afghanistan. + /// + AF, + + /// + /// The ISO 3166-1 alpha-2 code of Albania. + /// + AL, + + /// + /// The ISO 3166-1 alpha-2 code of Algeria. + /// + DZ, + + /// + /// The ISO 3166-1 alpha-2 code of Andorra. + /// + AD, + + /// + /// The ISO 3166-1 alpha-2 code of Angola. + /// + AO, + + /// + /// The ISO 3166-1 alpha-2 code of Antigua and Barbuda. + /// + AG, + + /// + /// The ISO 3166-1 alpha-2 code of Argentina. + /// + AR, + + /// + /// The ISO 3166-1 alpha-2 code of Armenia. + /// + AM, + + /// + /// The ISO 3166-1 alpha-2 code of Australia. + /// + AU, + + /// + /// The ISO 3166-1 alpha-2 code of Austria. + /// + AT, + + /// + /// The ISO 3166-1 alpha-2 code of Azerbaijan. + /// + AZ, + + /// + /// The ISO 3166-1 alpha-2 code of the Bahamas. + /// + BS, + + /// + /// The ISO 3166-1 alpha-2 code of Bahrain. + /// + BH, + + /// + /// The ISO 3166-1 alpha-2 code of Bangladesh. + /// + BD, + + /// + /// The ISO 3166-1 alpha-2 code of Barbados. + /// + BB, + + /// + /// The ISO 3166-1 alpha-2 code of Belarus. + /// + BY, + + /// + /// The ISO 3166-1 alpha-2 code of Belgium. + /// + BE, + + /// + /// The ISO 3166-1 alpha-2 code of Belize. + /// + BZ, + + /// + /// The ISO 3166-1 alpha-2 code of Benin. + /// + BJ, + + /// + /// The ISO 3166-1 alpha-2 code of Bhutan. + /// + BT, + + /// + /// The ISO 3166-1 alpha-2 code of Bolivia. + /// + BO, + + /// + /// The ISO 3166-1 alpha-2 code of Bosnia and Herzegovina. + /// + BA, + + /// + /// The ISO 3166-1 alpha-2 code of Botswana. + /// + BW, + + /// + /// The ISO 3166-1 alpha-2 code of Brazil. + /// + BR, + + /// + /// The ISO 3166-1 alpha-2 code of Brunei. + /// + BN, + + /// + /// The ISO 3166-1 alpha-2 code of Bulgaria. + /// + BG, + + /// + /// The ISO 3166-1 alpha-2 code of Burkina Faso. + /// + BF, + + /// + /// The ISO 3166-1 alpha-2 code of Burundi. + /// + BI, + + /// + /// The ISO 3166-1 alpha-2 code of Cabo Verde. + /// + CV, + + /// + /// The ISO 3166-1 alpha-2 code of Cambodia. + /// + KH, + + /// + /// The ISO 3166-1 alpha-2 code of Cameroon. + /// + CM, + + /// + /// The ISO 3166-1 alpha-2 code of Canada. + /// + CA, + + /// + /// The ISO 3166-1 alpha-2 code of the Central African Republic. + /// + CF, + + /// + /// The ISO 3166-1 alpha-2 code of Chad. + /// + TD, + + /// + /// The ISO 3166-1 alpha-2 code of Chile. + /// + CL, + + /// + /// The ISO 3166-1 alpha-2 code of China. + /// + CN, + + /// + /// The ISO 3166-1 alpha-2 code of Colombia. + /// + CO, + + /// + /// The ISO 3166-1 alpha-2 code of Comoros. + /// + KM, + + /// + /// The ISO 3166-1 alpha-2 code of Congo. + /// + CG, + + /// + /// The ISO 3166-1 alpha-2 code of the Democratic Republic of the Congo. + /// + CD, + + /// + /// The ISO 3166-1 alpha-2 code of Costa Rica. + /// + CR, + + /// + /// The ISO 3166-1 alpha-2 code of Cote d'Ivoire. + /// + CI, + + /// + /// The ISO 3166-1 alpha-2 code of Croatia. + /// + HR, + + /// + /// The ISO 3166-1 alpha-2 code of Cuba. + /// + CU, + + /// + /// The ISO 3166-1 alpha-2 code of Cyprus. + /// + CY, + + /// + /// The ISO 3166-1 alpha-2 code of Czechia. + /// + CZ, + + /// + /// The ISO 3166-1 alpha-2 code of Denmark. + /// + DK, + + /// + /// The ISO 3166-1 alpha-2 code of Djibouti. + /// + DJ, + + /// + /// The ISO 3166-1 alpha-2 code of Dominica. + /// + DM, + + /// + /// The ISO 3166-1 alpha-2 code of the Dominican Republic. + /// + DO, + + /// + /// The ISO 3166-1 alpha-2 code of Ecuador. + /// + EC, + + /// + /// The ISO 3166-1 alpha-2 code of Egypt. + /// + EG, + + /// + /// The ISO 3166-1 alpha-2 code of El Salvador. + /// + SV, + + /// + /// The ISO 3166-1 alpha-2 code of Equatorial Guinea. + /// + GQ, + + /// + /// The ISO 3166-1 alpha-2 code of Eritrea. + /// + ER, + + /// + /// The ISO 3166-1 alpha-2 code of Estonia. + /// + EE, + + /// + /// The ISO 3166-1 alpha-2 code of Eswatini. + /// + SZ, + + /// + /// The ISO 3166-1 alpha-2 code of Ethiopia. + /// + ET, + + /// + /// The ISO 3166-1 alpha-2 code of Fiji. + /// + FJ, + + /// + /// The ISO 3166-1 alpha-2 code of Finland. + /// + FI, + + /// + /// The ISO 3166-1 alpha-2 code of France. + /// + FR, + + /// + /// The ISO 3166-1 alpha-2 code of Gabon. + /// + GA, + + /// + /// The ISO 3166-1 alpha-2 code of the Gambia. + /// + GM, + + /// + /// The ISO 3166-1 alpha-2 code of Georgia. + /// + GE, + + /// + /// The ISO 3166-1 alpha-2 code of Germany. + /// + DE, + + /// + /// The ISO 3166-1 alpha-2 code of Ghana. + /// + GH, + + /// + /// The ISO 3166-1 alpha-2 code of Greece. + /// + GR, + + /// + /// The ISO 3166-1 alpha-2 code of Grenada. + /// + GD, + + /// + /// The ISO 3166-1 alpha-2 code of Guatemala. + /// + GT, + + /// + /// The ISO 3166-1 alpha-2 code of Guinea. + /// + GN, + + /// + /// The ISO 3166-1 alpha-2 code of Guinea-Bissau. + /// + GW, + + /// + /// The ISO 3166-1 alpha-2 code of Guyana. + /// + GY, + + /// + /// The ISO 3166-1 alpha-2 code of Haiti. + /// + HT, + + /// + /// The ISO 3166-1 alpha-2 code of Honduras. + /// + HN, + + /// + /// The ISO 3166-1 alpha-2 code of Hungary. + /// + HU, + + /// + /// The ISO 3166-1 alpha-2 code of Iceland. + /// + IS, + + /// + /// The ISO 3166-1 alpha-2 code of India. + /// + IN, + + /// + /// The ISO 3166-1 alpha-2 code of Indonesia. + /// + ID, + + /// + /// The ISO 3166-1 alpha-2 code of Iran. + /// + IR, + + /// + /// The ISO 3166-1 alpha-2 code of Iraq. + /// + IQ, + + /// + /// The ISO 3166-1 alpha-2 code of Ireland. + /// + IE, + + /// + /// The ISO 3166-1 alpha-2 code of Israel. + /// + IL, + + /// + /// The ISO 3166-1 alpha-2 code of Italy. + /// + IT, + + /// + /// The ISO 3166-1 alpha-2 code of Jamaica. + /// + JM, + + /// + /// The ISO 3166-1 alpha-2 code of Japan. + /// + JP, + + /// + /// The ISO 3166-1 alpha-2 code of Jordan. + /// + JO, + + /// + /// The ISO 3166-1 alpha-2 code of Kazakhstan. + /// + KZ, + + /// + /// The ISO 3166-1 alpha-2 code of Kenya. + /// + KE, + + /// + /// The ISO 3166-1 alpha-2 code of Kiribati. + /// + KI, + + /// + /// The ISO 3166-1 alpha-2 code of North Korea. + /// + KP, + + /// + /// The ISO 3166-1 alpha-2 code of South Korea. + /// + KR, + + /// + /// The ISO 3166-1 alpha-2 code of Kuwait. + /// + KW, + + /// + /// The ISO 3166-1 alpha-2 code of Kyrgyzstan. + /// + KG, + + /// + /// The ISO 3166-1 alpha-2 code of Laos. + /// + LA, + + /// + /// The ISO 3166-1 alpha-2 code of Latvia. + /// + LV, + + /// + /// The ISO 3166-1 alpha-2 code of Lebanon. + /// + LB, + + /// + /// The ISO 3166-1 alpha-2 code of Lesotho. + /// + LS, + + /// + /// The ISO 3166-1 alpha-2 code of Liberia. + /// + LR, + + /// + /// The ISO 3166-1 alpha-2 code of Libya. + /// + LY, + + /// + /// The ISO 3166-1 alpha-2 code of Liechtenstein. + /// + LI, + + /// + /// The ISO 3166-1 alpha-2 code of Lithuania. + /// + LT, + + /// + /// The ISO 3166-1 alpha-2 code of Luxembourg. + /// + LU, + + /// + /// The ISO 3166-1 alpha-2 code of Madagascar. + /// + MG, + + /// + /// The ISO 3166-1 alpha-2 code of Malawi. + /// + MW, + + /// + /// The ISO 3166-1 alpha-2 code of Malaysia. + /// + MY, + + /// + /// The ISO 3166-1 alpha-2 code of Maldives. + /// + MV, + + /// + /// The ISO 3166-1 alpha-2 code of Mali. + /// + ML, + + /// + /// The ISO 3166-1 alpha-2 code of Malta. + /// + MT, + + /// + /// The ISO 3166-1 alpha-2 code of the Marshall Islands. + /// + MH, + + /// + /// The ISO 3166-1 alpha-2 code of Mauritania. + /// + MR, + + /// + /// The ISO 3166-1 alpha-2 code of Mauritius. + /// + MU, + + /// + /// The ISO 3166-1 alpha-2 code of Mexico. + /// + MX, + + /// + /// The ISO 3166-1 alpha-2 code of Micronesia. + /// + FM, + + /// + /// The ISO 3166-1 alpha-2 code of Moldova. + /// + MD, + + /// + /// The ISO 3166-1 alpha-2 code of Monaco. + /// + MC, + + /// + /// The ISO 3166-1 alpha-2 code of Mongolia. + /// + MN, + + /// + /// The ISO 3166-1 alpha-2 code of Montenegro. + /// + ME, + + /// + /// The ISO 3166-1 alpha-2 code of Morocco. + /// + MA, + + /// + /// The ISO 3166-1 alpha-2 code of Mozambique. + /// + MZ, + + /// + /// The ISO 3166-1 alpha-2 code of Myanmar. + /// + MM, + + /// + /// The ISO 3166-1 alpha-2 code of Namibia. + /// + NA, + + /// + /// The ISO 3166-1 alpha-2 code of Nauru. + /// + NR, + + /// + /// The ISO 3166-1 alpha-2 code of Nepal. + /// + NP, + + /// + /// The ISO 3166-1 alpha-2 code of the Netherlands. + /// + NL, + + /// + /// The ISO 3166-1 alpha-2 code of New Zealand. + /// + NZ, + + /// + /// The ISO 3166-1 alpha-2 code of Nicaragua. + /// + NI, + + /// + /// The ISO 3166-1 alpha-2 code of Niger. + /// + NE, + + /// + /// The ISO 3166-1 alpha-2 code of Nigeria. + /// + NG, + + /// + /// The ISO 3166-1 alpha-2 code of North Macedonia. + /// + MK, + + /// + /// The ISO 3166-1 alpha-2 code of Norway. + /// + NO, + + /// + /// The ISO 3166-1 alpha-2 code of Oman. + /// + OM, + + /// + /// The ISO 3166-1 alpha-2 code of Pakistan. + /// + PK, + + /// + /// The ISO 3166-1 alpha-2 code of Palau. + /// + PW, + + /// + /// The ISO 3166-1 alpha-2 code of the State of Palestine. + /// + PS, + + /// + /// The ISO 3166-1 alpha-2 code of Panama. + /// + PA, + + /// + /// The ISO 3166-1 alpha-2 code of Papua New Guinea. + /// + PG, + + /// + /// The ISO 3166-1 alpha-2 code of Paraguay. + /// + PY, + + /// + /// The ISO 3166-1 alpha-2 code of Peru. + /// + PE, + + /// + /// The ISO 3166-1 alpha-2 code of the Philippines. + /// + PH, + + /// + /// The ISO 3166-1 alpha-2 code of Poland. + /// + PL, + + /// + /// The ISO 3166-1 alpha-2 code of Portugal. + /// + PT, + + /// + /// The ISO 3166-1 alpha-2 code of Qatar. + /// + QA, + + /// + /// The ISO 3166-1 alpha-2 code of Romania. + /// + RO, + + /// + /// The ISO 3166-1 alpha-2 code of Russia. + /// + RU, + + /// + /// The ISO 3166-1 alpha-2 code of Rwanda. + /// + RW, + + /// + /// The ISO 3166-1 alpha-2 code of Saint Kitts and Nevis. + /// + KN, + + /// + /// The ISO 3166-1 alpha-2 code of Saint Lucia. + /// + LC, + + /// + /// The ISO 3166-1 alpha-2 code of Saint Vincent and the Grenadines. + /// + VC, + + /// + /// The ISO 3166-1 alpha-2 code of Samoa. + /// + WS, + + /// + /// The ISO 3166-1 alpha-2 code of San Marino. + /// + SM, + + /// + /// The ISO 3166-1 alpha-2 code of Sao Tome and Principe. + /// + ST, + + /// + /// The ISO 3166-1 alpha-2 code of Saudi Arabia. + /// + SA, + + /// + /// The ISO 3166-1 alpha-2 code of Senegal. + /// + SN, + + /// + /// The ISO 3166-1 alpha-2 code of Serbia. + /// + RS, + + /// + /// The ISO 3166-1 alpha-2 code of Seychelles. + /// + SC, + + /// + /// The ISO 3166-1 alpha-2 code of Sierra Leone. + /// + SL, + + /// + /// The ISO 3166-1 alpha-2 code of Singapore. + /// + SG, + + /// + /// The ISO 3166-1 alpha-2 code of Slovakia. + /// + SK, + + /// + /// The ISO 3166-1 alpha-2 code of Slovenia. + /// + SI, + + /// + /// The ISO 3166-1 alpha-2 code of the Solomon Islands. + /// + SB, + + /// + /// The ISO 3166-1 alpha-2 code of Somalia. + /// + SO, + + /// + /// The ISO 3166-1 alpha-2 code of South Africa. + /// + ZA, + + /// + /// The ISO 3166-1 alpha-2 code of South Sudan. + /// + SS, + + /// + /// The ISO 3166-1 alpha-2 code of Spain. + /// + ES, + + /// + /// The ISO 3166-1 alpha-2 code of Sri Lanka. + /// + LK, + + /// + /// The ISO 3166-1 alpha-2 code of Sudan. + /// + SD, + + /// + /// The ISO 3166-1 alpha-2 code of Suriname. + /// + SR, + + /// + /// The ISO 3166-1 alpha-2 code of Sweden. + /// + SE, + + /// + /// The ISO 3166-1 alpha-2 code of Switzerland. + /// + CH, + + /// + /// The ISO 3166-1 alpha-2 code of Syria. + /// + SY, + + /// + /// The ISO 3166-1 alpha-2 code of Taiwan. + /// + TW, + + /// + /// The ISO 3166-1 alpha-2 code of Tajikistan. + /// + TJ, + + /// + /// The ISO 3166-1 alpha-2 code of Tanzania. + /// + TZ, + + /// + /// The ISO 3166-1 alpha-2 code of Thailand. + /// + TH, + + /// + /// The ISO 3166-1 alpha-2 code of Timor-Leste. + /// + TL, + + /// + /// The ISO 3166-1 alpha-2 code of Togo. + /// + TG, + + /// + /// The ISO 3166-1 alpha-2 code of Tonga. + /// + TO, + + /// + /// The ISO 3166-1 alpha-2 code of Trinidad and Tobago. + /// + TT, + + /// + /// The ISO 3166-1 alpha-2 code of Tunisia. + /// + TN, + + /// + /// The ISO 3166-1 alpha-2 code of Turkey. + /// + TR, + + /// + /// The ISO 3166-1 alpha-2 code of Turkmenistan. + /// + TM, + + /// + /// The ISO 3166-1 alpha-2 code of Tuvalu. + /// + TV, + + /// + /// The ISO 3166-1 alpha-2 code of Uganda. + /// + UG, + + /// + /// The ISO 3166-1 alpha-2 code of Ukraine. + /// + UA, + + /// + /// The ISO 3166-1 alpha-2 code of the United Arab Emirates. + /// + AE, + + /// + /// The ISO 3166-1 alpha-2 code of the United Kingdom. + /// + GB, + + /// + /// The ISO 3166-1 alpha-2 code of the United States. + /// + US, + + /// + /// The ISO 3166-1 alpha-2 code of Uruguay. + /// + UY, + + /// + /// The ISO 3166-1 alpha-2 code of Uzbekistan. + /// + UZ, + + /// + /// The ISO 3166-1 alpha-2 code of Vanuatu. + /// + VU, + + /// + /// The ISO 3166-1 alpha-2 code of the Vatican City. + /// + VA, + + /// + /// The ISO 3166-1 alpha-2 code of Venezuela. + /// + VE, + + /// + /// The ISO 3166-1 alpha-2 code of Vietnam. + /// + VN, + + /// + /// The ISO 3166-1 alpha-2 code of Yemen. + /// + YE, + + /// + /// The ISO 3166-1 alpha-2 code of Zambia. + /// + ZM, + + /// + /// The ISO 3166-1 alpha-2 code of Zimbabwe. + /// + ZW +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/SaveBook/SaveBookEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/SaveBook/SaveBookEndpointSummary.cs index 22a8b39c..a5fe6ee9 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/SaveBook/SaveBookEndpointSummary.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/SaveBook/SaveBookEndpointSummary.cs @@ -1,4 +1,4 @@ -#region ========================================================================= USING ===================================================================================== +#region ========================================================================= USING ===================================================================================== using FastEndpoints; using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.DTO.MediaContributors; @@ -6,6 +6,7 @@ using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary; using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary; using Lumina.Presentation.Web.Common.Enums.BookLibrary; using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books; +using Lumina.Presentation.Web.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -83,7 +84,7 @@ public class SaveBookEndpointSummary : Summary + text/microsoft-resx @@ -378,4 +378,593 @@ معرّف Goodreads - + + + أفغانستان + + + ألبانيا + + + الجزائر + + + أندورا + + + أنغولا + + + أنتيغوا وبربودا + + + الأرجنتين + + + أرمينيا + + + أستراليا + + + النمسا + + + أذربيجان + + + جزر البهاما + + + البحرين + + + بنغلاديش + + + بربادوس + + + بيلاروس + + + بلجيكا + + + بليز + + + بنين + + + بوتان + + + بوليفيا + + + البوسنة والهرسك + + + بوتسوانا + + + البرازيل + + + بروناي + + + بلغاريا + + + بوركينا فاسو + + + بوروندي + + + الرأس الأخضر + + + كمبوديا + + + الكاميرون + + + كندا + + + جمهورية أفريقيا الوسطى + + + تشاد + + + تشيلي + + + الصين + + + كولومبيا + + + جزر القمر + + + الكونغو - برازافيل + + + الكونغو - كينشاسا + + + كوستاريكا + + + ساحل العاج + + + كرواتيا + + + كوبا + + + قبرص + + + التشيك + + + الدانمرك + + + جيبوتي + + + دومينيكا + + + جمهورية الدومينيكان + + + الإكوادور + + + مصر + + + السلفادور + + + غينيا الاستوائية + + + إريتريا + + + إستونيا + + + إسواتيني + + + إثيوبيا + + + فيجي + + + فنلندا + + + فرنسا + + + الغابون + + + غامبيا + + + جورجيا + + + ألمانيا + + + غانا + + + اليونان + + + غرينادا + + + غواتيمالا + + + غينيا + + + غينيا بيساو + + + غيانا + + + هايتي + + + هندوراس + + + هنغاريا + + + آيسلندا + + + الهند + + + إندونيسيا + + + إيران + + + العراق + + + أيرلندا + + + إسرائيل + + + إيطاليا + + + جامايكا + + + اليابان + + + الأردن + + + كازاخستان + + + كينيا + + + كيريباتي + + + كوريا الشمالية + + + كوريا الجنوبية + + + الكويت + + + قيرغيزستان + + + لاوس + + + لاتفيا + + + لبنان + + + ليسوتو + + + ليبيريا + + + ليبيا + + + ليختنشتاين + + + ليتوانيا + + + لوكسمبورغ + + + مدغشقر + + + ملاوي + + + ماليزيا + + + جزر المالديف + + + مالي + + + مالطا + + + جزر مارشال + + + موريتانيا + + + موريشيوس + + + المكسيك + + + ميكرونيزيا + + + مولدوفا + + + موناكو + + + منغوليا + + + الجبل الأسود + + + المغرب + + + موزمبيق + + + ميانمار (بورما) + + + ناميبيا + + + ناورو + + + نيبال + + + هولندا + + + نيوزيلندا + + + نيكاراغوا + + + النيجر + + + نيجيريا + + + مقدونيا الشمالية + + + النرويج + + + عُمان + + + باكستان + + + بالاو + + + الأراضي الفلسطينية + + + بنما + + + بابوا غينيا الجديدة + + + باراغواي + + + بيرو + + + الفلبين + + + بولندا + + + البرتغال + + + قطر + + + رومانيا + + + روسيا + + + رواندا + + + سانت كيتس ونيفيس + + + سانت لوسيا + + + سانت فنسنت وجزر غرينادين + + + ساموا + + + سان مارينو + + + ساو تومي وبرينسيبي + + + المملكة العربية السعودية + + + السنغال + + + صربيا + + + سيشل + + + سيراليون + + + سنغافورة + + + سلوفاكيا + + + سلوفينيا + + + جزر سليمان + + + الصومال + + + جنوب أفريقيا + + + جنوب السودان + + + إسبانيا + + + سريلانكا + + + السودان + + + سورينام + + + السويد + + + سويسرا + + + سوريا + + + تايوان + + + طاجيكستان + + + تنزانيا + + + تايلاند + + + تيمور - ليشتي + + + توغو + + + تونغا + + + ترينيداد وتوباغو + + + تونس + + + تركيا + + + تركمانستان + + + توفالو + + + أوغندا + + + أوكرانيا + + + الإمارات العربية المتحدة + + + المملكة المتحدة + + + الولايات المتحدة + + + أورغواي + + + أوزبكستان + + + فانواتو + + + الفاتيكان + + + فنزويلا + + + فيتنام + + + اليمن + + + زامبيا + + + زيمبابوي + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.de-DE.resx index 60701ae8..736bfbd1 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.de-DE.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.de-DE.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,593 @@ Goodreads-ID - + + + Afghanistan + + + Albanien + + + Algerien + + + Andorra + + + Angola + + + Antigua und Barbuda + + + Argentinien + + + Armenien + + + Australien + + + Österreich + + + Aserbaidschan + + + Bahamas + + + Bahrain + + + Bangladesch + + + Barbados + + + Belarus + + + Belgien + + + Belize + + + Benin + + + Bhutan + + + Bolivien + + + Bosnien und Herzegowina + + + Botsuana + + + Brasilien + + + Brunei Darussalam + + + Bulgarien + + + Burkina Faso + + + Burundi + + + Cabo Verde + + + Kambodscha + + + Kamerun + + + Kanada + + + Zentralafrikanische Republik + + + Tschad + + + Chile + + + China + + + Kolumbien + + + Komoren + + + Kongo-Brazzaville + + + Kongo-Kinshasa + + + Costa Rica + + + Côte d’Ivoire + + + Kroatien + + + Kuba + + + Zypern + + + Tschechien + + + Dänemark + + + Dschibuti + + + Dominica + + + Dominikanische Republik + + + Ecuador + + + Ägypten + + + El Salvador + + + Äquatorialguinea + + + Eritrea + + + Estland + + + Eswatini + + + Äthiopien + + + Fidschi + + + Finnland + + + Frankreich + + + Gabun + + + Gambia + + + Georgien + + + Deutschland + + + Ghana + + + Griechenland + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Ungarn + + + Island + + + Indien + + + Indonesien + + + Iran + + + Irak + + + Irland + + + Israel + + + Italien + + + Jamaika + + + Japan + + + Jordanien + + + Kasachstan + + + Kenia + + + Kiribati + + + Nordkorea + + + Südkorea + + + Kuwait + + + Kirgisistan + + + Laos + + + Lettland + + + Libanon + + + Lesotho + + + Liberia + + + Libyen + + + Liechtenstein + + + Litauen + + + Luxemburg + + + Madagaskar + + + Malawi + + + Malaysia + + + Malediven + + + Mali + + + Malta + + + Marshallinseln + + + Mauretanien + + + Mauritius + + + Mexiko + + + Mikronesien + + + Republik Moldau + + + Monaco + + + Mongolei + + + Montenegro + + + Marokko + + + Mosambik + + + Myanmar + + + Namibia + + + Nauru + + + Nepal + + + Niederlande + + + Neuseeland + + + Nicaragua + + + Niger + + + Nigeria + + + Nordmazedonien + + + Norwegen + + + Oman + + + Pakistan + + + Palau + + + Palästinensische Autonomiegebiete + + + Panama + + + Papua-Neuguinea + + + Paraguay + + + Peru + + + Philippinen + + + Polen + + + Portugal + + + Katar + + + Rumänien + + + Russland + + + Ruanda + + + St. Kitts und Nevis + + + St. Lucia + + + St. Vincent und die Grenadinen + + + Samoa + + + San Marino + + + São Tomé und Príncipe + + + Saudi-Arabien + + + Senegal + + + Serbien + + + Seychellen + + + Sierra Leone + + + Singapur + + + Slowakei + + + Slowenien + + + Salomonen + + + Somalia + + + Südafrika + + + Südsudan + + + Spanien + + + Sri Lanka + + + Sudan + + + Suriname + + + Schweden + + + Schweiz + + + Syrien + + + Taiwan + + + Tadschikistan + + + Tansania + + + Thailand + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad und Tobago + + + Tunesien + + + Türkei + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ukraine + + + Vereinigte Arabische Emirate + + + Vereinigtes Königreich + + + Vereinigte Staaten + + + Uruguay + + + Usbekistan + + + Vanuatu + + + Vatikanstadt + + + Venezuela + + + Vietnam + + + Jemen + + + Sambia + + + Simbabwe + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.en-US.resx index 53d224d1..7ad32787 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.en-US.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.en-US.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,593 @@ The cover image could not be uploaded. - + + + Afghanistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua & Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaijan + + + Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belgium + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia & Herzegovina + + + Botswana + + + Brazil + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Cape Verde + + + Cambodia + + + Cameroon + + + Canada + + + Central African Republic + + + Chad + + + Chile + + + China + + + Colombia + + + Comoros + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Côte d’Ivoire + + + Croatia + + + Cuba + + + Cyprus + + + Czechia + + + Denmark + + + Djibouti + + + Dominica + + + Dominican Republic + + + Ecuador + + + Egypt + + + El Salvador + + + Equatorial Guinea + + + Eritrea + + + Estonia + + + Eswatini + + + Ethiopia + + + Fiji + + + Finland + + + France + + + Gabon + + + Gambia + + + Georgia + + + Germany + + + Ghana + + + Greece + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Hungary + + + Iceland + + + India + + + Indonesia + + + Iran + + + Iraq + + + Ireland + + + Israel + + + Italy + + + Jamaica + + + Japan + + + Jordan + + + Kazakhstan + + + Kenya + + + Kiribati + + + North Korea + + + South Korea + + + Kuwait + + + Kyrgyzstan + + + Laos + + + Latvia + + + Lebanon + + + Lesotho + + + Liberia + + + Libya + + + Liechtenstein + + + Lithuania + + + Luxembourg + + + Madagascar + + + Malawi + + + Malaysia + + + Maldives + + + Mali + + + Malta + + + Marshall Islands + + + Mauritania + + + Mauritius + + + Mexico + + + Micronesia + + + Moldova + + + Monaco + + + Mongolia + + + Montenegro + + + Morocco + + + Mozambique + + + Myanmar (Burma) + + + Namibia + + + Nauru + + + Nepal + + + Netherlands + + + New Zealand + + + Nicaragua + + + Niger + + + Nigeria + + + North Macedonia + + + Norway + + + Oman + + + Pakistan + + + Palau + + + Palestinian Territories + + + Panama + + + Papua New Guinea + + + Paraguay + + + Peru + + + Philippines + + + Poland + + + Portugal + + + Qatar + + + Romania + + + Russia + + + Rwanda + + + St. Kitts & Nevis + + + St. Lucia + + + St. Vincent & Grenadines + + + Samoa + + + San Marino + + + São Tomé & Príncipe + + + Saudi Arabia + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovakia + + + Slovenia + + + Solomon Islands + + + Somalia + + + South Africa + + + South Sudan + + + Spain + + + Sri Lanka + + + Sudan + + + Suriname + + + Sweden + + + Switzerland + + + Syria + + + Taiwan + + + Tajikistan + + + Tanzania + + + Thailand + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad & Tobago + + + Tunisia + + + Türkiye + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ukraine + + + United Arab Emirates + + + United Kingdom + + + United States + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Vatican City + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.es-ES.resx index de95fe36..d8e42082 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.es-ES.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.es-ES.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,593 @@ ID de Goodreads - + + + Afganistán + + + Albania + + + Argelia + + + Andorra + + + Angola + + + Antigua y Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaiyán + + + Bahamas + + + Baréin + + + Bangladés + + + Barbados + + + Bielorrusia + + + Bélgica + + + Belice + + + Benín + + + Bután + + + Bolivia + + + Bosnia y Herzegovina + + + Botsuana + + + Brasil + + + Brunéi + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Cabo Verde + + + Camboya + + + Camerún + + + Canadá + + + República Centroafricana + + + Chad + + + Chile + + + China + + + Colombia + + + Comoras + + + Congo + + + República Democrática del Congo + + + Costa Rica + + + Côte d’Ivoire + + + Croacia + + + Cuba + + + Chipre + + + Chequia + + + Dinamarca + + + Yibuti + + + Dominica + + + República Dominicana + + + Ecuador + + + Egipto + + + El Salvador + + + Guinea Ecuatorial + + + Eritrea + + + Estonia + + + Esuatini + + + Etiopía + + + Fiyi + + + Finlandia + + + Francia + + + Gabón + + + Gambia + + + Georgia + + + Alemania + + + Ghana + + + Grecia + + + Granada + + + Guatemala + + + Guinea + + + Guinea-Bisáu + + + Guyana + + + Haití + + + Honduras + + + Hungría + + + Islandia + + + India + + + Indonesia + + + Irán + + + Irak + + + Irlanda + + + Israel + + + Italia + + + Jamaica + + + Japón + + + Jordania + + + Kazajistán + + + Kenia + + + Kiribati + + + Corea del Norte + + + Corea del Sur + + + Kuwait + + + Kirguistán + + + Laos + + + Letonia + + + Líbano + + + Lesoto + + + Liberia + + + Libia + + + Liechtenstein + + + Lituania + + + Luxemburgo + + + Madagascar + + + Malaui + + + Malasia + + + Maldivas + + + Mali + + + Malta + + + Islas Marshall + + + Mauritania + + + Mauricio + + + México + + + Micronesia + + + Moldavia + + + Mónaco + + + Mongolia + + + Montenegro + + + Marruecos + + + Mozambique + + + Myanmar (Birmania) + + + Namibia + + + Nauru + + + Nepal + + + Países Bajos + + + Nueva Zelanda + + + Nicaragua + + + Níger + + + Nigeria + + + Macedonia del Norte + + + Noruega + + + Omán + + + Pakistán + + + Palaos + + + Territorios Palestinos + + + Panamá + + + Papúa Nueva Guinea + + + Paraguay + + + Perú + + + Filipinas + + + Polonia + + + Portugal + + + Catar + + + Rumanía + + + Rusia + + + Ruanda + + + San Cristóbal y Nieves + + + Santa Lucía + + + San Vicente y las Granadinas + + + Samoa + + + San Marino + + + Santo Tomé y Príncipe + + + Arabia Saudí + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leona + + + Singapur + + + Eslovaquia + + + Eslovenia + + + Islas Salomón + + + Somalia + + + Sudáfrica + + + Sudán del Sur + + + España + + + Sri Lanka + + + Sudán + + + Surinam + + + Suecia + + + Suiza + + + Siria + + + Taiwán + + + Tayikistán + + + Tanzania + + + Tailandia + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad y Tobago + + + Túnez + + + Turquía + + + Turkmenistán + + + Tuvalu + + + Uganda + + + Ucrania + + + Emiratos Árabes Unidos + + + Reino Unido + + + Estados Unidos + + + Uruguay + + + Uzbekistán + + + Vanuatu + + + Ciudad del Vaticano + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabue + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.fr-FR.resx index 24f103cc..29f61f5e 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.fr-FR.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.fr-FR.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,593 @@ Identifiant Goodreads - + + + Afghanistan + + + Albanie + + + Algérie + + + Andorre + + + Angola + + + Antigua-et-Barbuda + + + Argentine + + + Arménie + + + Australie + + + Autriche + + + Azerbaïdjan + + + Bahamas + + + Bahreïn + + + Bangladesh + + + Barbade + + + Biélorussie + + + Belgique + + + Belize + + + Bénin + + + Bhoutan + + + Bolivie + + + Bosnie-Herzégovine + + + Botswana + + + Brésil + + + Brunei + + + Bulgarie + + + Burkina Faso + + + Burundi + + + Cap-Vert + + + Cambodge + + + Cameroun + + + Canada + + + République centrafricaine + + + Tchad + + + Chili + + + Chine + + + Colombie + + + Comores + + + Congo-Brazzaville + + + Congo-Kinshasa + + + Costa Rica + + + Côte d’Ivoire + + + Croatie + + + Cuba + + + Chypre + + + Tchéquie + + + Danemark + + + Djibouti + + + Dominique + + + République dominicaine + + + Équateur + + + Égypte + + + Salvador + + + Guinée équatoriale + + + Érythrée + + + Estonie + + + Eswatini + + + Éthiopie + + + Fidji + + + Finlande + + + France + + + Gabon + + + Gambie + + + Géorgie + + + Allemagne + + + Ghana + + + Grèce + + + Grenade + + + Guatemala + + + Guinée + + + Guinée-Bissau + + + Guyana + + + Haïti + + + Honduras + + + Hongrie + + + Islande + + + Inde + + + Indonésie + + + Iran + + + Irak + + + Irlande + + + Israël + + + Italie + + + Jamaïque + + + Japon + + + Jordanie + + + Kazakhstan + + + Kenya + + + Kiribati + + + Corée du Nord + + + Corée du Sud + + + Koweït + + + Kirghizstan + + + Laos + + + Lettonie + + + Liban + + + Lesotho + + + Liberia + + + Libye + + + Liechtenstein + + + Lituanie + + + Luxembourg + + + Madagascar + + + Malawi + + + Malaisie + + + Maldives + + + Mali + + + Malte + + + Îles Marshall + + + Mauritanie + + + Maurice + + + Mexique + + + Micronésie + + + Moldavie + + + Monaco + + + Mongolie + + + Monténégro + + + Maroc + + + Mozambique + + + Myanmar (Birmanie) + + + Namibie + + + Nauru + + + Népal + + + Pays-Bas + + + Nouvelle-Zélande + + + Nicaragua + + + Niger + + + Nigeria + + + Macédoine du Nord + + + Norvège + + + Oman + + + Pakistan + + + Palaos + + + Territoires palestiniens + + + Panama + + + Papouasie-Nouvelle-Guinée + + + Paraguay + + + Pérou + + + Philippines + + + Pologne + + + Portugal + + + Qatar + + + Roumanie + + + Russie + + + Rwanda + + + Saint-Christophe-et-Niévès + + + Sainte-Lucie + + + Saint-Vincent-et-les Grenadines + + + Samoa + + + Saint-Marin + + + Sao Tomé-et-Principe + + + Arabie saoudite + + + Sénégal + + + Serbie + + + Seychelles + + + Sierra Leone + + + Singapour + + + Slovaquie + + + Slovénie + + + Îles Salomon + + + Somalie + + + Afrique du Sud + + + Soudan du Sud + + + Espagne + + + Sri Lanka + + + Soudan + + + Suriname + + + Suède + + + Suisse + + + Syrie + + + Taïwan + + + Tadjikistan + + + Tanzanie + + + Thaïlande + + + Timor oriental + + + Togo + + + Tonga + + + Trinité-et-Tobago + + + Tunisie + + + Turquie + + + Turkménistan + + + Tuvalu + + + Ouganda + + + Ukraine + + + Émirats arabes unis + + + Royaume-Uni + + + États-Unis + + + Uruguay + + + Ouzbékistan + + + Vanuatu + + + État de la Cité du Vatican + + + Venezuela + + + Viêt Nam + + + Yémen + + + Zambie + + + Zimbabwe + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.it-IT.resx index cbd9098d..665c573b 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.it-IT.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.it-IT.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,593 @@ ID Goodreads - + + + Afghanistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua e Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaigian + + + Bahamas + + + Bahrein + + + Bangladesh + + + Barbados + + + Bielorussia + + + Belgio + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia ed Erzegovina + + + Botswana + + + Brasile + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Capo Verde + + + Cambogia + + + Camerun + + + Canada + + + Repubblica Centrafricana + + + Ciad + + + Cile + + + Cina + + + Colombia + + + Comore + + + Congo-Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Costa d’Avorio + + + Croazia + + + Cuba + + + Cipro + + + Cechia + + + Danimarca + + + Gibuti + + + Dominica + + + Repubblica Dominicana + + + Ecuador + + + Egitto + + + El Salvador + + + Guinea Equatoriale + + + Eritrea + + + Estonia + + + Eswatini + + + Etiopia + + + Figi + + + Finlandia + + + Francia + + + Gabon + + + Gambia + + + Georgia + + + Germania + + + Ghana + + + Grecia + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Ungheria + + + Islanda + + + India + + + Indonesia + + + Iran + + + Iraq + + + Irlanda + + + Israele + + + Italia + + + Giamaica + + + Giappone + + + Giordania + + + Kazakistan + + + Kenya + + + Kiribati + + + Corea del Nord + + + Corea del Sud + + + Kuwait + + + Kirghizistan + + + Laos + + + Lettonia + + + Libano + + + Lesotho + + + Liberia + + + Libia + + + Liechtenstein + + + Lituania + + + Lussemburgo + + + Madagascar + + + Malawi + + + Malaysia + + + Maldive + + + Mali + + + Malta + + + Isole Marshall + + + Mauritania + + + Mauritius + + + Messico + + + Micronesia + + + Moldavia + + + Monaco + + + Mongolia + + + Montenegro + + + Marocco + + + Mozambico + + + Myanmar (Birmania) + + + Namibia + + + Nauru + + + Nepal + + + Paesi Bassi + + + Nuova Zelanda + + + Nicaragua + + + Niger + + + Nigeria + + + Macedonia del Nord + + + Norvegia + + + Oman + + + Pakistan + + + Palau + + + Territori Palestinesi + + + Panama + + + Papua Nuova Guinea + + + Paraguay + + + Perù + + + Filippine + + + Polonia + + + Portogallo + + + Qatar + + + Romania + + + Russia + + + Ruanda + + + Saint Kitts e Nevis + + + Saint Lucia + + + Saint Vincent e Grenadine + + + Samoa + + + San Marino + + + São Tomé e Príncipe + + + Arabia Saudita + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovacchia + + + Slovenia + + + Isole Salomone + + + Somalia + + + Sudafrica + + + Sud Sudan + + + Spagna + + + Sri Lanka + + + Sudan + + + Suriname + + + Svezia + + + Svizzera + + + Siria + + + Taiwan + + + Tagikistan + + + Tanzania + + + Thailandia + + + Timor Est + + + Togo + + + Tonga + + + Trinidad e Tobago + + + Tunisia + + + Turchia + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ucraina + + + Emirati Arabi Uniti + + + Regno Unito + + + Stati Uniti + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Città del Vaticano + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.ja-JP.resx index 20364219..bbe6519c 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.ja-JP.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.ja-JP.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,593 @@ Goodreads ID - + + + アフガニスタン + + + アルバニア + + + アルジェリア + + + アンドラ + + + アンゴラ + + + アンティグア・バーブーダ + + + アルゼンチン + + + アルメニア + + + オーストラリア + + + オーストリア + + + アゼルバイジャン + + + バハマ + + + バーレーン + + + バングラデシュ + + + バルバドス + + + ベラルーシ + + + ベルギー + + + ベリーズ + + + ベナン + + + ブータン + + + ボリビア + + + ボスニア・ヘルツェゴビナ + + + ボツワナ + + + ブラジル + + + ブルネイ + + + ブルガリア + + + ブルキナファソ + + + ブルンジ + + + カーボベルデ + + + カンボジア + + + カメルーン + + + カナダ + + + 中央アフリカ共和国 + + + チャド + + + チリ + + + 中国 + + + コロンビア + + + コモロ + + + コンゴ共和国(ブラザビル) + + + コンゴ民主共和国(キンシャサ) + + + コスタリカ + + + コートジボワール + + + クロアチア + + + キューバ + + + キプロス + + + チェコ + + + デンマーク + + + ジブチ + + + ドミニカ国 + + + ドミニカ共和国 + + + エクアドル + + + エジプト + + + エルサルバドル + + + 赤道ギニア + + + エリトリア + + + エストニア + + + エスワティニ + + + エチオピア + + + フィジー + + + フィンランド + + + フランス + + + ガボン + + + ガンビア + + + ジョージア + + + ドイツ + + + ガーナ + + + ギリシャ + + + グレナダ + + + グアテマラ + + + ギニア + + + ギニアビサウ + + + ガイアナ + + + ハイチ + + + ホンジュラス + + + ハンガリー + + + アイスランド + + + インド + + + インドネシア + + + イラン + + + イラク + + + アイルランド + + + イスラエル + + + イタリア + + + ジャマイカ + + + 日本 + + + ヨルダン + + + カザフスタン + + + ケニア + + + キリバス + + + 北朝鮮 + + + 韓国 + + + クウェート + + + キルギス + + + ラオス + + + ラトビア + + + レバノン + + + レソト + + + リベリア + + + リビア + + + リヒテンシュタイン + + + リトアニア + + + ルクセンブルク + + + マダガスカル + + + マラウイ + + + マレーシア + + + モルディブ + + + マリ + + + マルタ + + + マーシャル諸島 + + + モーリタニア + + + モーリシャス + + + メキシコ + + + ミクロネシア連邦 + + + モルドバ + + + モナコ + + + モンゴル + + + モンテネグロ + + + モロッコ + + + モザンビーク + + + ミャンマー (ビルマ) + + + ナミビア + + + ナウル + + + ネパール + + + オランダ + + + ニュージーランド + + + ニカラグア + + + ニジェール + + + ナイジェリア + + + 北マケドニア + + + ノルウェー + + + オマーン + + + パキスタン + + + パラオ + + + パレスチナ自治区 + + + パナマ + + + パプアニューギニア + + + パラグアイ + + + ペルー + + + フィリピン + + + ポーランド + + + ポルトガル + + + カタール + + + ルーマニア + + + ロシア + + + ルワンダ + + + セントクリストファー・ネーヴィス + + + セントルシア + + + セントビンセント及びグレナディーン諸島 + + + サモア + + + サンマリノ + + + サントメ・プリンシペ + + + サウジアラビア + + + セネガル + + + セルビア + + + セーシェル + + + シエラレオネ + + + シンガポール + + + スロバキア + + + スロベニア + + + ソロモン諸島 + + + ソマリア + + + 南アフリカ + + + 南スーダン + + + スペイン + + + スリランカ + + + スーダン + + + スリナム + + + スウェーデン + + + スイス + + + シリア + + + 台湾 + + + タジキスタン + + + タンザニア + + + タイ + + + 東ティモール + + + トーゴ + + + トンガ + + + トリニダード・トバゴ + + + チュニジア + + + トルコ + + + トルクメニスタン + + + ツバル + + + ウガンダ + + + ウクライナ + + + アラブ首長国連邦 + + + イギリス + + + アメリカ合衆国 + + + ウルグアイ + + + ウズベキスタン + + + バヌアツ + + + バチカン市国 + + + ベネズエラ + + + ベトナム + + + イエメン + + + ザンビア + + + ジンバブエ + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.resx index 53d224d1..fbdda4b4 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,592 @@ The cover image could not be uploaded. - + + Afghanistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua and Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaijan + + + the Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belgium + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia and Herzegovina + + + Botswana + + + Brazil + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Cabo Verde + + + Cambodia + + + Cameroon + + + Canada + + + the Central African Republic + + + Chad + + + Chile + + + China + + + Colombia + + + Comoros + + + Congo + + + the Democratic Republic of the Congo + + + Costa Rica + + + Cote d'Ivoire + + + Croatia + + + Cuba + + + Cyprus + + + Czechia + + + Denmark + + + Djibouti + + + Dominica + + + the Dominican Republic + + + Ecuador + + + Egypt + + + El Salvador + + + Equatorial Guinea + + + Eritrea + + + Estonia + + + Eswatini + + + Ethiopia + + + Fiji + + + Finland + + + France + + + Gabon + + + the Gambia + + + Georgia + + + Germany + + + Ghana + + + Greece + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Hungary + + + Iceland + + + India + + + Indonesia + + + Iran + + + Iraq + + + Ireland + + + Israel + + + Italy + + + Jamaica + + + Japan + + + Jordan + + + Kazakhstan + + + Kenya + + + Kiribati + + + North Korea + + + South Korea + + + Kuwait + + + Kyrgyzstan + + + Laos + + + Latvia + + + Lebanon + + + Lesotho + + + Liberia + + + Libya + + + Liechtenstein + + + Lithuania + + + Luxembourg + + + Madagascar + + + Malawi + + + Malaysia + + + Maldives + + + Mali + + + Malta + + + the Marshall Islands + + + Mauritania + + + Mauritius + + + Mexico + + + Micronesia + + + Moldova + + + Monaco + + + Mongolia + + + Montenegro + + + Morocco + + + Mozambique + + + Myanmar + + + Namibia + + + Nauru + + + Nepal + + + the Netherlands + + + New Zealand + + + Nicaragua + + + Niger + + + Nigeria + + + North Macedonia + + + Norway + + + Oman + + + Pakistan + + + Palau + + + the State of Palestine + + + Panama + + + Papua New Guinea + + + Paraguay + + + Peru + + + the Philippines + + + Poland + + + Portugal + + + Qatar + + + Romania + + + Russia + + + Rwanda + + + Saint Kitts and Nevis + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Samoa + + + San Marino + + + Sao Tome and Principe + + + Saudi Arabia + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovakia + + + Slovenia + + + the Solomon Islands + + + Somalia + + + South Africa + + + South Sudan + + + Spain + + + Sri Lanka + + + Sudan + + + Suriname + + + Sweden + + + Switzerland + + + Syria + + + Taiwan + + + Tajikistan + + + Tanzania + + + Thailand + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad and Tobago + + + Tunisia + + + Turkey + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ukraine + + + the United Arab Emirates + + + the United Kingdom + + + the United States + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + the Vatican City + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.ro-RO.resx index ed005b8d..3acbe541 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.ro-RO.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.ro-RO.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,593 @@ ID Goodreads - + + + Afganistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua și Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaidjan + + + Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belgia + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia și Herțegovina + + + Botswana + + + Brazilia + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Capul Verde + + + Cambodgia + + + Camerun + + + Canada + + + Republica Centrafricană + + + Ciad + + + Chile + + + China + + + Columbia + + + Comore + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Côte d’Ivoire + + + Croația + + + Cuba + + + Cipru + + + Cehia + + + Danemarca + + + Djibouti + + + Dominica + + + Republica Dominicană + + + Ecuador + + + Egipt + + + El Salvador + + + Guineea Ecuatorială + + + Eritreea + + + Estonia + + + Eswatini + + + Etiopia + + + Fiji + + + Finlanda + + + Franța + + + Gabon + + + Gambia + + + Georgia + + + Germania + + + Ghana + + + Grecia + + + Grenada + + + Guatemala + + + Guineea + + + Guineea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Ungaria + + + Islanda + + + India + + + Indonezia + + + Iran + + + Irak + + + Irlanda + + + Israel + + + Italia + + + Jamaica + + + Japonia + + + Iordania + + + Kazahstan + + + Kenya + + + Kiribati + + + Coreea de Nord + + + Coreea de Sud + + + Kuweit + + + Kârgâzstan + + + Laos + + + Letonia + + + Liban + + + Lesotho + + + Liberia + + + Libia + + + Liechtenstein + + + Lituania + + + Luxemburg + + + Madagascar + + + Malawi + + + Malaysia + + + Maldive + + + Mali + + + Malta + + + Insulele Marshall + + + Mauritania + + + Mauritius + + + Mexic + + + Micronezia + + + Republica Moldova + + + Monaco + + + Mongolia + + + Muntenegru + + + Maroc + + + Mozambic + + + Myanmar (Birmania) + + + Namibia + + + Nauru + + + Nepal + + + Țările de Jos + + + Noua Zeelandă + + + Nicaragua + + + Niger + + + Nigeria + + + Macedonia de Nord + + + Norvegia + + + Oman + + + Pakistan + + + Palau + + + Teritoriile Palestiniene + + + Panama + + + Papua-Noua Guinee + + + Paraguay + + + Peru + + + Filipine + + + Polonia + + + Portugalia + + + Qatar + + + România + + + Rusia + + + Rwanda + + + Saint Kitts și Nevis + + + Sfânta Lucia + + + Saint Vincent și Grenadinele + + + Samoa + + + San Marino + + + São Tomé și Príncipe + + + Arabia Saudită + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovacia + + + Slovenia + + + Insulele Solomon + + + Somalia + + + Africa de Sud + + + Sudanul de Sud + + + Spania + + + Sri Lanka + + + Sudan + + + Suriname + + + Suedia + + + Elveția + + + Siria + + + Taiwan + + + Tadjikistan + + + Tanzania + + + Thailanda + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad și Tobago + + + Tunisia + + + Turcia + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ucraina + + + Emiratele Arabe Unite + + + Regatul Unit + + + Statele Unite ale Americii + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Statul Cetății Vaticanului + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.uk-UA.resx index 34a49dc7..ef5ae45a 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.uk-UA.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.uk-UA.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,593 @@ ID на Goodreads - + + + Афганістан + + + Албанія + + + Алжир + + + Андорра + + + Ангола + + + Антигуа і Барбуда + + + Аргентина + + + Вірменія + + + Австралія + + + Австрія + + + Азербайджан + + + Багамські Острови + + + Бахрейн + + + Бангладеш + + + Барбадос + + + Білорусь + + + Бельгія + + + Беліз + + + Бенін + + + Бутан + + + Болівія + + + Боснія і Герцеговина + + + Ботсвана + + + Бразилія + + + Бруней + + + Болгарія + + + Буркіна-Фасо + + + Бурунді + + + Кабо-Верде + + + Камбоджа + + + Камерун + + + Канада + + + Центральноафриканська Республіка + + + Чад + + + Чилі + + + Китай + + + Колумбія + + + Комори + + + Конго – Браззавіль + + + Конго – Кіншаса + + + Коста-Рика + + + Кот-дʼІвуар + + + Хорватія + + + Куба + + + Кіпр + + + Чехія + + + Данія + + + Джибуті + + + Домініка + + + Домініканська Республіка + + + Еквадор + + + Єгипет + + + Сальвадор + + + Екваторіальна Гвінея + + + Еритрея + + + Естонія + + + Есватіні + + + Ефіопія + + + Фіджі + + + Фінляндія + + + Франція + + + Габон + + + Гамбія + + + Грузія + + + Німеччина + + + Гана + + + Греція + + + Гренада + + + Гватемала + + + Гвінея + + + Гвінея-Бісау + + + Гаяна + + + Гаїті + + + Гондурас + + + Угорщина + + + Ісландія + + + Індія + + + Індонезія + + + Іран + + + Ірак + + + Ірландія + + + Ізраїль + + + Італія + + + Ямайка + + + Японія + + + Йорданія + + + Казахстан + + + Кенія + + + Кірибаті + + + Північна Корея + + + Південна Корея + + + Кувейт + + + Киргизстан + + + Лаос + + + Латвія + + + Ліван + + + Лесото + + + Ліберія + + + Лівія + + + Ліхтенштейн + + + Литва + + + Люксембург + + + Мадагаскар + + + Малаві + + + Малайзія + + + Мальдіви + + + Малі + + + Мальта + + + Маршаллові Острови + + + Мавританія + + + Маврикій + + + Мексика + + + Мікронезія + + + Молдова + + + Монако + + + Монголія + + + Чорногорія + + + Марокко + + + Мозамбік + + + Мʼянма (Бірма) + + + Намібія + + + Науру + + + Непал + + + Нідерланди + + + Нова Зеландія + + + Нікарагуа + + + Нігер + + + Нігерія + + + Північна Македонія + + + Норвегія + + + Оман + + + Пакистан + + + Палау + + + Палестинські території + + + Панама + + + Папуа-Нова Гвінея + + + Парагвай + + + Перу + + + Філіппіни + + + Польща + + + Португалія + + + Катар + + + Румунія + + + Росія + + + Руанда + + + Сент-Кітс і Невіс + + + Сент-Люсія + + + Сент-Вінсент і Гренадіни + + + Самоа + + + Сан-Марино + + + Сан-Томе і Принсіпі + + + Саудівська Аравія + + + Сенегал + + + Сербія + + + Сейшельські Острови + + + Сьєрра-Леоне + + + Сінгапур + + + Словаччина + + + Словенія + + + Соломонові Острови + + + Сомалі + + + Південно-Африканська Республіка + + + Південний Судан + + + Іспанія + + + Шрі-Ланка + + + Судан + + + Суринам + + + Швеція + + + Швейцарія + + + Сирія + + + Тайвань + + + Таджикистан + + + Танзанія + + + Таїланд + + + Тимор-Лешті + + + Того + + + Тонга + + + Тринідад і Тобаго + + + Туніс + + + Туреччина + + + Туркменістан + + + Тувалу + + + Уганда + + + Україна + + + Обʼєднані Арабські Емірати + + + Велика Британія + + + Сполучені Штати + + + Уругвай + + + Узбекистан + + + Вануату + + + Ватикан + + + Венесуела + + + Вʼєтнам + + + Ємен + + + Замбія + + + Зімбабве + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.zh-CN.resx index 2d9aff0a..794b2365 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.zh-CN.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.zh-CN.resx @@ -1,4 +1,4 @@ - + text/microsoft-resx @@ -378,4 +378,593 @@ Goodreads ID - + + + 阿富汗 + + + 阿尔巴尼亚 + + + 阿尔及利亚 + + + 安道尔 + + + 安哥拉 + + + 安提瓜和巴布达 + + + 阿根廷 + + + 亚美尼亚 + + + 澳大利亚 + + + 奥地利 + + + 阿塞拜疆 + + + 巴哈马 + + + 巴林 + + + 孟加拉国 + + + 巴巴多斯 + + + 白俄罗斯 + + + 比利时 + + + 伯利兹 + + + 贝宁 + + + 不丹 + + + 玻利维亚 + + + 波斯尼亚和黑塞哥维那 + + + 博茨瓦纳 + + + 巴西 + + + 文莱 + + + 保加利亚 + + + 布基纳法索 + + + 布隆迪 + + + 佛得角 + + + 柬埔寨 + + + 喀麦隆 + + + 加拿大 + + + 中非共和国 + + + 乍得 + + + 智利 + + + 中国 + + + 哥伦比亚 + + + 科摩罗 + + + 刚果(布) + + + 刚果(金) + + + 哥斯达黎加 + + + 科特迪瓦 + + + 克罗地亚 + + + 古巴 + + + 塞浦路斯 + + + 捷克 + + + 丹麦 + + + 吉布提 + + + 多米尼克 + + + 多米尼加共和国 + + + 厄瓜多尔 + + + 埃及 + + + 萨尔瓦多 + + + 赤道几内亚 + + + 厄立特里亚 + + + 爱沙尼亚 + + + 斯威士兰 + + + 埃塞俄比亚 + + + 斐济 + + + 芬兰 + + + 法国 + + + 加蓬 + + + 冈比亚 + + + 格鲁吉亚 + + + 德国 + + + 加纳 + + + 希腊 + + + 格林纳达 + + + 危地马拉 + + + 几内亚 + + + 几内亚比绍 + + + 圭亚那 + + + 海地 + + + 洪都拉斯 + + + 匈牙利 + + + 冰岛 + + + 印度 + + + 印度尼西亚 + + + 伊朗 + + + 伊拉克 + + + 爱尔兰 + + + 以色列 + + + 意大利 + + + 牙买加 + + + 日本 + + + 约旦 + + + 哈萨克斯坦 + + + 肯尼亚 + + + 基里巴斯 + + + 朝鲜 + + + 韩国 + + + 科威特 + + + 吉尔吉斯斯坦 + + + 老挝 + + + 拉脱维亚 + + + 黎巴嫩 + + + 莱索托 + + + 利比里亚 + + + 利比亚 + + + 列支敦士登 + + + 立陶宛 + + + 卢森堡 + + + 马达加斯加 + + + 马拉维 + + + 马来西亚 + + + 马尔代夫 + + + 马里 + + + 马耳他 + + + 马绍尔群岛 + + + 毛里塔尼亚 + + + 毛里求斯 + + + 墨西哥 + + + 密克罗尼西亚 + + + 摩尔多瓦 + + + 摩纳哥 + + + 蒙古 + + + 黑山 + + + 摩洛哥 + + + 莫桑比克 + + + 缅甸 + + + 纳米比亚 + + + 瑙鲁 + + + 尼泊尔 + + + 荷兰 + + + 新西兰 + + + 尼加拉瓜 + + + 尼日尔 + + + 尼日利亚 + + + 北马其顿 + + + 挪威 + + + 阿曼 + + + 巴基斯坦 + + + 帕劳 + + + 巴勒斯坦领土 + + + 巴拿马 + + + 巴布亚新几内亚 + + + 巴拉圭 + + + 秘鲁 + + + 菲律宾 + + + 波兰 + + + 葡萄牙 + + + 卡塔尔 + + + 罗马尼亚 + + + 俄罗斯 + + + 卢旺达 + + + 圣基茨和尼维斯 + + + 圣卢西亚 + + + 圣文森特和格林纳丁斯 + + + 萨摩亚 + + + 圣马力诺 + + + 圣多美和普林西比 + + + 沙特阿拉伯 + + + 塞内加尔 + + + 塞尔维亚 + + + 塞舌尔 + + + 塞拉利昂 + + + 新加坡 + + + 斯洛伐克 + + + 斯洛文尼亚 + + + 所罗门群岛 + + + 索马里 + + + 南非 + + + 南苏丹 + + + 西班牙 + + + 斯里兰卡 + + + 苏丹 + + + 苏里南 + + + 瑞典 + + + 瑞士 + + + 叙利亚 + + + 台湾 + + + 塔吉克斯坦 + + + 坦桑尼亚 + + + 泰国 + + + 东帝汶 + + + 多哥 + + + 汤加 + + + 特立尼达和多巴哥 + + + 突尼斯 + + + 土耳其 + + + 土库曼斯坦 + + + 图瓦卢 + + + 乌干达 + + + 乌克兰 + + + 阿拉伯联合酋长国 + + + 英国 + + + 美国 + + + 乌拉圭 + + + 乌兹别克斯坦 + + + 瓦努阿图 + + + 梵蒂冈 + + + 委内瑞拉 + + + 越南 + + + 也门 + + + 赞比亚 + + + 津巴布韦 + + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.cshtml b/src/Lumina.Presentation.Web/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.cshtml index b729d1c7..94e3a10c 100644 --- a/src/Lumina.Presentation.Web/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.cshtml +++ b/src/Lumina.Presentation.Web/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.cshtml @@ -16,6 +16,7 @@ @using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary @using Lumina.Presentation.Web.Common.DTO.MediaContributors @using Lumina.Presentation.Web.Common.Enums.BookLibrary +@using Lumina.Presentation.Web.Common.Enums.Common @using Lumina.Presentation.Web.Common.Services @using Microsoft.AspNetCore.Mvc.Localization @using System.Globalization @@ -46,6 +47,18 @@ "Narrator" => _localizer["Narrator"].Value, _ => category ?? string.Empty }; + // The country of release carried by the book, keyed by its ISO code. + var currentReleaseCountry = releaseInfo?.ReleaseCountry?.ToString() ?? string.Empty; + // Resolves the localized label of a release country, shown as "DE (Germany)", keyed by its ISO code. + Func releaseCountryLabel = countryCode => + { + if (string.IsNullOrEmpty(countryCode)) + return "-"; + string localizedName = _localizer[$"Country.{countryCode}"].Value; + if (localizedName == $"Country.{countryCode}") + return countryCode; + return $"{countryCode} ({localizedName})"; + }; } @inject IViewLocalizer _localizer @@ -221,10 +234,23 @@
- : + :
- +
+
+ + +
+
-
+ @foreach (string country in Enum.GetNames()) + { +
@releaseCountryLabel(country)
+ } +
+
@_localizer["ReleaseCountryDescription"]
@@ -591,7 +617,7 @@ OriginalReleaseYear: readNumber('original-release-year-input'), ReReleaseDate: readValue('re-release-date-input') || null, ReReleaseYear: readNumber('re-release-year-input'), - ReleaseCountry: readValue('release-country-input') || null, + ReleaseCountry: readComboboxValue('release-country-combobox') || null, ReleaseVersion: readValue('release-version-input') || null }, Genres: splitList(readValue('genres-input')).map(name => ({ Name: name })), diff --git a/src/Lumina.Presentation.Web/wwwroot/js/site.js b/src/Lumina.Presentation.Web/wwwroot/js/site.js index bc579319..14428d1a 100644 --- a/src/Lumina.Presentation.Web/wwwroot/js/site.js +++ b/src/Lumina.Presentation.Web/wwwroot/js/site.js @@ -1,4 +1,4 @@ -const scrollbarHeight = getScrollbarHeight(); +const scrollbarHeight = getScrollbarHeight(); const scrollbarWidth = getScrollbarWidth(); const progressIndicator = document.getElementById('progress-indicator'); const progressIndicatorValue = document.getElementById('progress-indicator-value'); @@ -758,3 +758,44 @@ document.addEventListener('click', function (e) { }); document.addEventListener('DOMContentLoaded', initializeNavigation); + +(function () { + 'use strict'; + + /** + * Limits the height of every enlightenment dropdown to half of the height of the main content area. + * The computed maximum is exposed as the --enlightenment-dropdown-max-height CSS variable, which the + * .enlightenment-dropdown rule consumes, so that long option lists scroll inside the dropdown instead + * of stretching the central section of the page. + */ + function declareDropdownMaxHeight() { + const main = document.querySelector('main[role="main"]') || document.querySelector('main'); + if (!main) + return; + const maxHeight = Math.round(main.clientHeight * 0.5); + document.documentElement.style.setProperty('--enlightenment-dropdown-max-height', maxHeight + 'px'); + } + + /** + * Keeps the dropdown maximum height in sync with the height of the main content area. + * The value is recomputed whenever the main area is resized, whenever the window is resized, and whenever + * a combobox is opened, so that a dropdown opened near the bottom of the screen is still capped to the + * visible central section. + */ + function watchMainArea() { + const main = document.querySelector('main[role="main"]') || document.querySelector('main'); + if (!main) + return; + const observer = new MutationObserver(declareDropdownMaxHeight); + observer.observe(main, { attributes: true, attributeFilter: ['class', 'style'] }); + window.addEventListener('resize', declareDropdownMaxHeight); + document.addEventListener('click', function (event) { + if (event.target.matches('.enlightenment-toggle-checkbox')) + declareDropdownMaxHeight(); + }); + } + + declareDropdownMaxHeight(); + document.addEventListener('DOMContentLoaded', declareDropdownMaxHeight); + watchMainArea(); +})(); diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/WrittenContentLibrary/BookLibrary/BookEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/WrittenContentLibrary/BookLibrary/BookEntityFixture.cs index 0a4ed757..bb961f1a 100644 --- a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/WrittenContentLibrary/BookLibrary/BookEntityFixture.cs +++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/WrittenContentLibrary/BookLibrary/BookEntityFixture.cs @@ -3,6 +3,7 @@ using Bogus; using Lumina.Application.Common.DataAccess.Entities.Common; using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary; using Lumina.Application.Fixtures.Common.Setup;using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -52,7 +53,7 @@ public class BookEntityFixture .RuleFor(x => x.OriginalReleaseYear, releaseYear) .RuleFor(x => x.ReReleaseDate, _faker.DateOnlyBetween(new DateOnly(reReleaseYear, 1, 1), new DateOnly(reReleaseYear, 12, 31))) .RuleFor(x => x.ReReleaseYear, reReleaseYear) - .RuleFor(x => x.ReleaseCountry, f => f.Random.String2(2)) + .RuleFor(x => x.ReleaseCountry, f => f.PickRandom()) .RuleFor(x => x.ReleaseVersion, f => f.Random.String2(f.Random.Number(1, 50))) .RuleFor(x => x.LanguageCode, f => f.Random.String2(2)) .RuleFor(x => x.LanguageName, f => f.Random.String2(f.Random.Number(1, 50))) diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/Common/ReleaseInfoDtoFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/Common/ReleaseInfoDtoFixture.cs index 656735e2..6d92f339 100644 --- a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/Common/ReleaseInfoDtoFixture.cs +++ b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/Common/ReleaseInfoDtoFixture.cs @@ -1,5 +1,6 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Contracts.DTO.Common; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -35,7 +36,7 @@ public class ReleaseInfoDtoFixture int? originalReleaseYear = null, DateOnly? reReleaseDate = null, int? reReleaseYear = null, - string? releaseCountry = null, + ReleaseCountry? releaseCountry = null, string? releaseVersion = null, bool includeOriginalReleaseDate = true, bool includeOriginalReleaseYear = true, diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookMetadataDtoFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookMetadataDtoFixture.cs index d8cff480..e0861e5d 100644 --- a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookMetadataDtoFixture.cs +++ b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookMetadataDtoFixture.cs @@ -1,10 +1,11 @@ -#region ========================================================================= USING ===================================================================================== +#region ========================================================================= USING ===================================================================================== using Bogus; using Lumina.Contracts.DTO.Common; using Lumina.Contracts.DTO.MediaContributors; using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; using Lumina.Contracts.Fixtures.Core.DTO.Common; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -97,7 +98,7 @@ public class BookMetadataDtoFixture releaseInfo ?? (includeOptionalProperties ? _releaseInfoDtoFixture.Create( originalReleaseDate: new DateOnly(releaseYear, 1, 1), originalReleaseYear: releaseYear, - releaseCountry: _faker.Address.CountryCode()) : null), + releaseCountry: _faker.PickRandom()) : null), genres ?? (includeOptionalProperties ? [_genreDtoFixture.Create()] : null), tags ?? (includeOptionalProperties ? [_tagDtoFixture.Create()] : null), language ?? (includeOptionalProperties ? _languageInfoDtoFixture.Create() : null), diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookSeriesDtoFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookSeriesDtoFixture.cs new file mode 100644 index 00000000..2cc3f99e --- /dev/null +++ b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookSeriesDtoFixture.cs @@ -0,0 +1,38 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class BookSeriesDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new with randomized test data. + /// + /// Optional. The title of the book series. + /// A configured instance. + public BookSeriesDto Create(string? title = null) + { + return new BookSeriesDto(title ?? _faker.Lorem.Sentence(3)); + } + + /// + /// Creates multiple instances with randomized test data. + /// + /// Number of instances to create. + /// List of configured instances. + public List CreateMany(int count = 3) + { + return [.. Enumerable.Range(0, count).Select(_ => Create())]; + } +} diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/WrittenContentMetadataDtoFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/WrittenContentMetadataDtoFixture.cs index 308d9bcd..fd257126 100644 --- a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/WrittenContentMetadataDtoFixture.cs +++ b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/WrittenContentLibrary/WrittenContentMetadataDtoFixture.cs @@ -1,8 +1,9 @@ -#region ========================================================================= USING ===================================================================================== +#region ========================================================================= USING ===================================================================================== using Bogus; using Lumina.Contracts.DTO.Common; using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary; using Lumina.Contracts.Fixtures.Core.DTO.Common; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -22,6 +23,7 @@ public class WrittenContentMetadataDtoFixture private readonly GenreDtoFixture _genreDtoFixture = new(); private readonly TagDtoFixture _tagDtoFixture = new(); private readonly LanguageInfoDtoFixture _languageInfoDtoFixture = new(); + private readonly ReleaseInfoDtoFixture _releaseInfoDtoFixture = new(); /// /// Creates a random valid . @@ -100,13 +102,13 @@ public class WrittenContentMetadataDtoFixture { int originalReleaseYear = _random.Next(1900, 2026); int reReleaseYear = _random.Next(originalReleaseYear, 2026); - return new ReleaseInfoDto( - new DateOnly(originalReleaseYear, 1, 1), - originalReleaseYear, - new DateOnly(reReleaseYear, 1, 1), - reReleaseYear, - _faker.Address.CountryCode(), - _faker.Random.String2(_faker.Random.Number(1, 50))); + return _releaseInfoDtoFixture.Create( + originalReleaseDate: new DateOnly(originalReleaseYear, 1, 1), + originalReleaseYear: originalReleaseYear, + reReleaseDate: new DateOnly(reReleaseYear, 1, 1), + reReleaseYear: reReleaseYear, + releaseCountry: _faker.PickRandom(), + releaseVersion: _faker.Random.String2(_faker.Random.Number(1, 50))); } /// diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Responses/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookResponseFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Responses/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookResponseFixture.cs index d23afb4a..b07e8c9c 100644 --- a/tests/Common/Lumina.Contracts.Fixtures/Core/Responses/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookResponseFixture.cs +++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Responses/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/BookResponseFixture.cs @@ -1,12 +1,12 @@ -#region ========================================================================= USING ===================================================================================== +#region ========================================================================= USING ===================================================================================== using Bogus; -using Lumina.Contracts.DTO.Common; -using Lumina.Contracts.DTO.MediaContributors; using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary; using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; +using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors; +using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.WrittenContentLibrary; +using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; using Lumina.Contracts.Responses.MediaLibrary.WrittenContentLibrary.BookLibrary.Books; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; -using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -22,6 +22,11 @@ namespace Lumina.Contracts.Fixtures.Core.Responses.MediaLibrary.WrittenContentLi public class BookResponseFixture { private readonly Faker _faker = new(); + private readonly WrittenContentMetadataDtoFixture _writtenContentMetadataDtoFixture = new(); + private readonly IsbnDtoFixture _isbnDtoFixture = new(); + private readonly MediaContributorDtoFixture _mediaContributorDtoFixture = new(); + private readonly BookRatingDtoFixture _bookRatingDtoFixture = new(); + private readonly BookSeriesDtoFixture _bookSeriesDtoFixture = new(); /// /// Creates a random valid . @@ -33,6 +38,7 @@ public class BookResponseFixture /// Optional. The format of the book. /// Optional. The metadata enrichment status of the book. /// Optional. The date and time when the book was created. + /// Optional. The file system path of the cover image of the book. /// The created . public BookResponse Create( Guid? id = null, @@ -49,11 +55,11 @@ public class BookResponseFixture id ?? Guid.NewGuid(), libraryId ?? Guid.NewGuid(), path ?? _faker.System.FilePath(), - metadata ?? CreateMetadata(), + metadata ?? _writtenContentMetadataDtoFixture.Create(), format ?? _faker.PickRandom(), _faker.Lorem.Word(), _faker.Random.Int(1, 10), - new BookSeriesDto(_faker.Lorem.Word()), + _bookSeriesDtoFixture.Create(), _faker.Random.AlphaNumeric(10), _faker.Random.AlphaNumeric(5), _faker.Random.AlphaNumeric(8), @@ -63,11 +69,9 @@ public class BookResponseFixture _faker.Random.AlphaNumeric(6), _faker.Random.AlphaNumeric(10), _faker.Random.AlphaNumeric(8), - [new IsbnDto(_faker.Random.Replace("###-#-##-#####-#"), IsbnFormat.Isbn13)], - [new MediaContributorDto( - new MediaContributorNameDto(_faker.Name.FullName(), _faker.Name.FullName()), - new MediaContributorRoleDto(_faker.Commerce.ProductAdjective(), _faker.PickRandom()))], - [new BookRatingDto(_faker.Random.Decimal(1m, 5m), 5m, BookRatingSource.Goodreads, _faker.Random.Int(1, 1000))], + _isbnDtoFixture.CreateMany(1), + _mediaContributorDtoFixture.CreateMany(1), + _bookRatingDtoFixture.CreateMany(1), metadataStatus ?? _faker.PickRandom(), _faker.Date.Recent().ToUniversalTime(), _faker.Company.CompanyName(), @@ -86,20 +90,4 @@ public class BookResponseFixture { return [.. Enumerable.Range(0, count).Select(_ => Create())]; } - - private WrittenContentMetadataDto CreateMetadata() - { - return new WrittenContentMetadataDto( - _faker.Lorem.Sentence(3), - _faker.Lorem.Sentence(3), - _faker.Lorem.Paragraph(), - new ReleaseInfoDto(_faker.Date.PastDateOnly(), _faker.Random.Int(1900, 2024), null, null, _faker.Address.CountryCode(), null), - [new GenreDto(_faker.Lorem.Word())], - [new TagDto(_faker.Lorem.Word())], - new LanguageInfoDto("en", "English", "English"), - null, - _faker.Company.CompanyName(), - _faker.Random.Int(100, 1000) - ); - } } diff --git a/tests/Common/Lumina.Domain.Fixtures/Common/ValueObjects/Metadata/ReleaseInfoFixture.cs b/tests/Common/Lumina.Domain.Fixtures/Common/ValueObjects/Metadata/ReleaseInfoFixture.cs index 978e8d91..1fa1db57 100644 --- a/tests/Common/Lumina.Domain.Fixtures/Common/ValueObjects/Metadata/ReleaseInfoFixture.cs +++ b/tests/Common/Lumina.Domain.Fixtures/Common/ValueObjects/Metadata/ReleaseInfoFixture.cs @@ -2,6 +2,7 @@ using Bogus; using Lumina.Domain.Common.Primitives; using Lumina.Domain.Common.ValueObjects.Metadata; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -34,7 +35,7 @@ public class ReleaseInfoFixture Optional? originalReleaseYear = null, Optional? reReleaseDate = null, Optional? reReleaseYear = null, - Optional? releaseCountry = null, + Optional? releaseCountry = null, Optional? releaseVersion = null) { int generatedYear = _random.Next(1900, 2000); @@ -47,31 +48,25 @@ public class ReleaseInfoFixture resolvedOriginalYear = Optional.Some(generatedYear); } else if (!resolvedOriginalDate.HasValue) - { resolvedOriginalDate = Optional.Some(new DateOnly(resolvedOriginalYear.Value, 1, 1)); - } else if (!resolvedOriginalYear.HasValue) - { resolvedOriginalYear = Optional.Some(resolvedOriginalDate.Value.Year); - } Optional resolvedReReleaseDate = reReleaseDate ?? Optional.None(); Optional resolvedReReleaseYear = reReleaseYear ?? Optional.None(); if (resolvedReReleaseDate.HasValue && !resolvedReReleaseYear.HasValue) - { resolvedReReleaseYear = Optional.Some(resolvedReReleaseDate.Value.Year); - } else if (!resolvedReReleaseDate.HasValue && resolvedReReleaseYear.HasValue) - { resolvedReReleaseDate = Optional.Some(new DateOnly(resolvedReReleaseYear.Value, 1, 1)); - } + + Optional resolvedReleaseCountry = releaseCountry ?? Optional.Some(Enum.GetValues()[_random.Next(Enum.GetValues().Length)]); Result releaseInfoResult = ReleaseInfo.Create( resolvedOriginalDate, resolvedOriginalYear, resolvedReReleaseDate, resolvedReReleaseYear, - releaseCountry ?? Optional.Some(_faker.Address.Country()), + resolvedReleaseCountry, releaseVersion ?? Optional.Some(_faker.Lorem.Word())); if (releaseInfoResult.IsFailure) diff --git a/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/AudioLibraryAggregate/ValueObjects/AudioMetadataFixture.cs b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioMetadataFixture.cs similarity index 97% rename from tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/AudioLibraryAggregate/ValueObjects/AudioMetadataFixture.cs rename to tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioMetadataFixture.cs index d53ab8bc..3c3e41c1 100644 --- a/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/AudioLibraryAggregate/ValueObjects/AudioMetadataFixture.cs +++ b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioMetadataFixture.cs @@ -2,14 +2,14 @@ using Bogus; using Lumina.Domain.Common.Primitives; using Lumina.Domain.Common.ValueObjects.Metadata; -using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLibraryAggregate.ValueObjects; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects; using Lumina.Domain.Fixtures.Common.ValueObjects.Metadata; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; #endregion -namespace Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLibraryAggregate.ValueObjects; +namespace Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects; /// /// Fixture class for the domain value object. diff --git a/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorFixture.cs b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorFixture.cs index cba83b58..56e1ac68 100644 --- a/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorFixture.cs +++ b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorFixture.cs @@ -3,6 +3,7 @@ using Lumina.Domain.Common.Primitives; using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate; using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects; using Lumina.Domain.Fixtures.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects; +using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -24,6 +25,7 @@ public class MediaContributorFixture /// Creates a random valid domain aggregate. /// /// Optional. The Id of the contributor. + /// Optional. The type of the contributor. /// Optional. The name of the contributor. /// Optional. The biography of the contributor. /// Optional. The date of birth of the contributor. @@ -31,6 +33,7 @@ public class MediaContributorFixture /// The created domain aggregate. public MediaContributor Create( MediaContributorId? id = null, + MediaContributorType? type = null, MediaContributorName? name = null, Optional? biography = null, Optional? dateOfBirth = null, @@ -38,6 +41,7 @@ public class MediaContributorFixture { Result result = MediaContributor.Create( id ?? _mediaContributorIdFixture.Create(), + type ?? MediaContributorType.Person, name ?? _mediaContributorNameFixture.Create(), biography ?? Optional.None(), dateOfBirth ?? Optional.None(), diff --git a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/ReleaseInfoDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/ReleaseInfoDtoFixture.cs index f56c2dfc..1a3a0fdc 100644 --- a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/ReleaseInfoDtoFixture.cs +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/ReleaseInfoDtoFixture.cs @@ -1,6 +1,7 @@ -#region ========================================================================= USING ===================================================================================== +#region ========================================================================= USING ===================================================================================== using Bogus; using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -33,7 +34,7 @@ public class ReleaseInfoDtoFixture int? originalReleaseYear = null, DateOnly? reReleaseDate = null, int? reReleaseYear = null, - string? releaseCountry = null, + ReleaseCountry? releaseCountry = null, string? releaseVersion = null) { int resolvedOriginalReleaseYear = originalReleaseYear ?? (originalReleaseDate?.Year ?? _random.Next(1900, 2026)); @@ -47,7 +48,7 @@ public class ReleaseInfoDtoFixture OriginalReleaseYear = resolvedOriginalReleaseYear, ReReleaseDate = resolvedReReleaseDate, ReReleaseYear = resolvedReReleaseYear, - ReleaseCountry = releaseCountry ?? _faker.Address.CountryCode(), + ReleaseCountry = releaseCountry ?? _faker.PickRandom(), ReleaseVersion = releaseVersion ?? _faker.Random.String2(_faker.Random.Number(1, 50)) }; } diff --git a/tests/IntegrationTests/Lumina.Presentation.Api.IntegrationTests/Common/Converters/BookJsonConverter.cs b/tests/IntegrationTests/Lumina.Presentation.Api.IntegrationTests/Common/Converters/BookJsonConverter.cs index 3c9ecec0..28bdf8db 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Api.IntegrationTests/Common/Converters/BookJsonConverter.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Api.IntegrationTests/Common/Converters/BookJsonConverter.cs @@ -1,5 +1,6 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Domain.Common.Primitives; using Lumina.Domain.Common.ValueObjects.Metadata; using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects; @@ -166,12 +167,15 @@ public class BookJsonConverter : JsonConverter string? releaseVersion = element.TryGetProperty("releaseVersion", out JsonElement rvElement) ? rvElement.GetString() : null; + Optional releaseCountryValue = Optional.None(); + if (releaseCountry is not null && Enum.TryParse(releaseCountry, ignoreCase: true, out ReleaseCountry parsedReleaseCountry)) + releaseCountryValue = parsedReleaseCountry; Result releaseInfoResult = ReleaseInfo.Create( Optional.FromNullable(originalReleaseDate), Optional.FromNullable(originalReleaseYear), Optional.FromNullable(reReleaseDate), Optional.FromNullable(reReleaseYear), - Optional.FromNullable(releaseCountry), + releaseCountryValue, Optional.FromNullable(releaseVersion) ); diff --git a/tests/IntegrationTests/Lumina.Presentation.Api.IntegrationTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/AddBook/AddBookEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Api.IntegrationTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/AddBook/AddBookEndpointTests.cs index 26a716e6..17b846ae 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Api.IntegrationTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/AddBook/AddBookEndpointTests.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Api.IntegrationTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/AddBook/AddBookEndpointTests.cs @@ -12,6 +12,7 @@ using Lumina.DataAccess.Core.UoW; using Lumina.Domain.Common.Errors; using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary; using Lumina.Presentation.Api.IntegrationTests.Common.Converters; @@ -114,7 +115,7 @@ public class AddBookEndpointTests : IClassFixture Assert.Equal(bookRequest.Metadata.ReleaseInfo.OriginalReleaseYear, bookResponse.Metadata.ReleaseInfo.OriginalReleaseYear.Value); Assert.Equal(bookRequest.Metadata.ReleaseInfo.ReReleaseDate, bookResponse.Metadata.ReleaseInfo.ReReleaseDate.Value); Assert.Equal(bookRequest.Metadata.ReleaseInfo.ReReleaseYear, bookResponse.Metadata.ReleaseInfo.ReReleaseYear.Value); - Assert.Equal(bookRequest.Metadata.ReleaseInfo.ReleaseCountry, bookResponse.Metadata.ReleaseInfo.ReleaseCountry.Value); + Assert.Equal(bookRequest.Metadata.ReleaseInfo!.ReleaseCountry, bookResponse.Metadata.ReleaseInfo.ReleaseCountry.Value); Assert.Equal(bookRequest.Metadata.ReleaseInfo.ReleaseVersion, bookResponse.Metadata.ReleaseInfo.ReleaseVersion.Value); // language checks @@ -334,19 +335,6 @@ public class AddBookEndpointTests : IClassFixture await AssertCreated(bookRequest); } - [Fact] - public async Task AddBook_WhenCalledWithInvalidValueReleaseCountry_ShouldReturnUnprocessableEntity() - { - // Arrange - AddBookRequest bookRequest = _requestBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(releaseCountry: "test"))); - - // Act - HttpResponseMessage response = await PostBookAsync(bookRequest); - - // Assert - await AssertUnprocessableEntityWithValidationErrors(response, Errors.Metadata.CountryCodeMustBe2CharactersLong.Description); - } - [Fact] public async Task AddBook_WhenCalledWithEmptyReleaseVersion_ShouldAddBook() { diff --git a/tests/UnitTests/Lumina.Application.UnitTests/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandValidatorTests.cs b/tests/UnitTests/Lumina.Application.UnitTests/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandValidatorTests.cs index ed69ce73..9e1631f1 100644 --- a/tests/UnitTests/Lumina.Application.UnitTests/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandValidatorTests.cs +++ b/tests/UnitTests/Lumina.Application.UnitTests/Core/MediaLibrary/WrittenContentLibrary/BookLibrary/Books/Commands/AddBook/AddBookCommandValidatorTests.cs @@ -258,32 +258,6 @@ public class AddBookCommandValidatorTests result.ShouldHaveValidationError(Errors.Metadata.ReReleaseYearMustBeBetween1And9999); } - [Fact] - public void Validate_WhenReleaseCountryIsValid_ShouldNotHaveValidationError() - { - // Arrange - AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(releaseCountry: new Faker().Random.String2(2).ToUpper()))); - - // Act - List result = _validator.TestValidate(bookCommand); - - // Assert - result.ShouldNotHaveValidationError(Errors.Metadata.CountryCodeMustBe2CharactersLong); - } - - [Fact] - public void Validate_WhenReleaseCountryIsInvalid_ShouldHaveValidationError() - { - // Arrange - AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(releaseCountry: new Faker().Random.String2(3)))); - - // Act - List result = _validator.TestValidate(bookCommand); - - // Assert - result.ShouldHaveValidationError(Errors.Metadata.CountryCodeMustBe2CharactersLong); - } - [Fact] public void Validate_WhenReleaseVersionIsValid_ShouldNotHaveValidationError() { diff --git a/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/Common/ReleaseInfoDtoTests.cs b/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/Common/ReleaseInfoDtoTests.cs index f1fc0b09..fee5323f 100644 --- a/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/Common/ReleaseInfoDtoTests.cs +++ b/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/Common/ReleaseInfoDtoTests.cs @@ -1,5 +1,6 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Contracts.DTO.Common; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Diagnostics.CodeAnalysis; using System.Text.Json; @@ -29,7 +30,7 @@ public class ReleaseInfoDtoTests 2005, reReleaseDate, 2015, - "US", + ReleaseCountry.US, "Revised Edition" ); @@ -61,8 +62,8 @@ public class ReleaseInfoDtoTests public void Equality_WhenTwoInstancesHaveSameValues_ShouldBeEqual() { // Arrange - ReleaseInfoDto first = new(new DateOnly(2005, 6, 15), 2005, null, null, "US", null); - ReleaseInfoDto second = new(new DateOnly(2005, 6, 15), 2005, null, null, "US", null); + ReleaseInfoDto first = new(new DateOnly(2005, 6, 15), 2005, null, null, ReleaseCountry.US, null); + ReleaseInfoDto second = new(new DateOnly(2005, 6, 15), 2005, null, null, ReleaseCountry.US, null); // Act bool areEqual = first == second; diff --git a/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookMetadataDtoTests.cs b/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookMetadataDtoTests.cs index 3eb6eed7..b6f29943 100644 --- a/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookMetadataDtoTests.cs +++ b/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/MediaLibrary/WrittenContentLibrary/BookLibrary/BookMetadataDtoTests.cs @@ -4,6 +4,7 @@ using Lumina.Contracts.DTO.MediaContributors; using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -33,7 +34,7 @@ public class BookMetadataDtoTests "Dune", "Dune", "A science fiction novel.", - new ReleaseInfoDto(new DateOnly(1965, 8, 1), 1965, null, null, "US", null), + new ReleaseInfoDto(new DateOnly(1965, 8, 1), 1965, null, null, ReleaseCountry.US, null), [new GenreDto("Science Fiction")], [new TagDto("classic")], new LanguageInfoDto("en", "English", "English"), diff --git a/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/MediaLibrary/WrittenContentLibrary/WrittenContentMetadataDtoTests.cs b/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/MediaLibrary/WrittenContentLibrary/WrittenContentMetadataDtoTests.cs index 34d3ac26..cc58a60c 100644 --- a/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/MediaLibrary/WrittenContentLibrary/WrittenContentMetadataDtoTests.cs +++ b/tests/UnitTests/Lumina.Contracts.UnitTests/DTO/MediaLibrary/WrittenContentLibrary/WrittenContentMetadataDtoTests.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Contracts.DTO.Common; using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -28,7 +29,7 @@ public class WrittenContentMetadataDtoTests "Dune", "Dune", "A science fiction novel.", - new ReleaseInfoDto(new DateOnly(1965, 8, 1), 1965, null, null, "US", null), + new ReleaseInfoDto(new DateOnly(1965, 8, 1), 1965, null, null, ReleaseCountry.US, null), [new GenreDto("Science Fiction")], [new TagDto("classic")], new LanguageInfoDto("en", "English", "English"), diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Common/ValueObjects/Metadata/ReleaseInfoTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Common/ValueObjects/Metadata/ReleaseInfoTests.cs index 613198d5..db31b84c 100644 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Common/ValueObjects/Metadata/ReleaseInfoTests.cs +++ b/tests/UnitTests/Lumina.Domain.UnitTests/Common/ValueObjects/Metadata/ReleaseInfoTests.cs @@ -2,6 +2,7 @@ using DomainErrors = Lumina.Domain.Common.Errors.Errors; using Lumina.Domain.Common.Primitives; using Lumina.Domain.Common.ValueObjects.Metadata; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using System; using System.Diagnostics.CodeAnalysis; #endregion @@ -23,7 +24,7 @@ public class ReleaseInfoTests Optional.Some(2001), Optional.Some(new DateOnly(2010, 6, 1)), Optional.Some(2010), - Optional.Some("US"), + Optional.Some(ReleaseCountry.US), Optional.Some("Director's Cut")); // Assert @@ -32,7 +33,7 @@ public class ReleaseInfoTests Assert.Equal(2001, result.Value.OriginalReleaseYear.Value); Assert.Equal(new DateOnly(2010, 6, 1), result.Value.ReReleaseDate.Value); Assert.Equal(2010, result.Value.ReReleaseYear.Value); - Assert.Equal("US", result.Value.ReleaseCountry.Value); + Assert.Equal(ReleaseCountry.US, result.Value.ReleaseCountry.Value); Assert.Equal("Director's Cut", result.Value.ReleaseVersion.Value); } @@ -45,7 +46,7 @@ public class ReleaseInfoTests Optional.Some(2001), Optional.None(), Optional.None(), - Optional.None(), + Optional.None(), Optional.None()); // Assert @@ -63,7 +64,7 @@ public class ReleaseInfoTests Optional.Some(2002), Optional.None(), Optional.None(), - Optional.None(), + Optional.None(), Optional.None()); // Assert @@ -80,7 +81,7 @@ public class ReleaseInfoTests Optional.None(), Optional.Some(new DateOnly(2010, 6, 1)), Optional.Some(2011), - Optional.None(), + Optional.None(), Optional.None()); // Assert @@ -97,7 +98,7 @@ public class ReleaseInfoTests Optional.Some(2010), Optional.Some(new DateOnly(2001, 9, 14)), Optional.Some(2001), - Optional.None(), + Optional.None(), Optional.None()); // Assert @@ -114,7 +115,7 @@ public class ReleaseInfoTests Optional.Some(2010), Optional.None(), Optional.Some(2001), - Optional.None(), + Optional.None(), Optional.None()); // Assert diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/AudioLibraryBoundedContext/AudioLibraryAggregate/ValueObjects/AudioMetadataTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioMetadataTests.cs similarity index 97% rename from tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/AudioLibraryBoundedContext/AudioLibraryAggregate/ValueObjects/AudioMetadataTests.cs rename to tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioMetadataTests.cs index 0526d841..62a5d10d 100644 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/AudioLibraryBoundedContext/AudioLibraryAggregate/ValueObjects/AudioMetadataTests.cs +++ b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/AudioLibraryBoundedContext/Common/ValueObjects/AudioMetadataTests.cs @@ -1,15 +1,15 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Domain.Common.Primitives; using Lumina.Domain.Common.ValueObjects.Metadata; -using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLibraryAggregate.ValueObjects; +using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects; using Lumina.Domain.Fixtures.Common.ValueObjects.Metadata; -using Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLibraryAggregate.ValueObjects; +using Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; #endregion -namespace Lumina.Domain.UnitTests.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLibraryAggregate.ValueObjects; +namespace Lumina.Domain.UnitTests.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects; /// /// Contains unit tests for the class. diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorTests.cs index 4152109f..fee2fb0e 100644 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorTests.cs +++ b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorTests.cs @@ -4,6 +4,7 @@ using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaCon using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects; using Lumina.Domain.Fixtures.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate; using Lumina.Domain.Fixtures.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects; +using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; using System; using System.Diagnostics.CodeAnalysis; #endregion @@ -31,7 +32,7 @@ public class MediaContributorTests Optional dateOfDeath = Optional.None(); // Act - Result result = MediaContributor.Create(id, name, biography, dateOfBirth, dateOfDeath); + Result result = MediaContributor.Create(id, MediaContributorType.Person, name, biography, dateOfBirth, dateOfDeath); // Assert Assert.False(result.IsFailure); @@ -51,7 +52,7 @@ public class MediaContributorTests MediaContributorName name = _mediaContributorNameFixture.Create(displayName: "Jane Doe", legalName: Optional.None()); // Act - Result result = MediaContributor.Create(_mediaContributorIdFixture.Create(), name, Optional.None(), Optional.None(), Optional.None()); + Result result = MediaContributor.Create(_mediaContributorIdFixture.Create(), MediaContributorType.Person, name, Optional.None(), Optional.None(), Optional.None()); // Assert Assert.False(result.IsFailure); @@ -67,7 +68,7 @@ public class MediaContributorTests MediaContributorName name = _mediaContributorNameFixture.Create(displayName: "Jane Doe", legalName: Optional.None()); // Act - Result result = MediaContributor.Create(name); + Result result = MediaContributor.Create(MediaContributorType.Person, name); // Assert Assert.False(result.IsFailure); diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/VideoLibraryBoundedContext/MovieLibraryAggregate/Services/MovieLibraryServiceTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/VideoLibraryBoundedContext/MovieLibraryAggregate/Services/MovieLibraryServiceTests.cs deleted file mode 100644 index b4b1789f..00000000 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/VideoLibraryBoundedContext/MovieLibraryAggregate/Services/MovieLibraryServiceTests.cs +++ /dev/null @@ -1,24 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services; -using System; -using System.Diagnostics.CodeAnalysis; -#endregion - -namespace Lumina.Domain.UnitTests.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services; - -/// -/// Contains unit tests for the class. -/// -[ExcludeFromCodeCoverage] -public class MovieLibraryServiceTests -{ - [Fact] - public void Movies_WhenAccessed_ShouldThrowNotImplementedException() - { - // Arrange - MovieLibraryService sut = new(); - - // Act & Assert - Assert.Throws(() => sut.Movies); - } -} diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/VideoLibraryBoundedContext/Services/VideoLibraryServiceTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/VideoLibraryBoundedContext/Services/VideoLibraryServiceTests.cs deleted file mode 100644 index b54e9f0f..00000000 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/VideoLibraryBoundedContext/Services/VideoLibraryServiceTests.cs +++ /dev/null @@ -1,31 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services; -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.Services; -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services; -using NSubstitute; -using System.Diagnostics.CodeAnalysis; -#endregion - -namespace Lumina.Domain.UnitTests.Core.BoundedContexts.VideoLibraryBoundedContext.Services; - -/// -/// Contains unit tests for the class. -/// -[ExcludeFromCodeCoverage] -public class VideoLibraryServiceTests -{ - [Fact] - public void Constructor_WhenCalled_ShouldSetInjectedServices() - { - // Arrange - IMovieLibraryService movieLibraryService = Substitute.For(); - ITvShowLibraryService tvShowLibraryService = Substitute.For(); - - // Act - VideoLibraryService sut = new(movieLibraryService, tvShowLibraryService); - - // Assert - Assert.Same(movieLibraryService, sut.MovieLibraryService); - Assert.Same(tvShowLibraryService, sut.TvShowLibraryService); - } -} diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/VideoLibraryBoundedContext/TvShowLibraryAggregate/Services/TvShowLibraryServiceTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/VideoLibraryBoundedContext/TvShowLibraryAggregate/Services/TvShowLibraryServiceTests.cs deleted file mode 100644 index 675fdabb..00000000 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/VideoLibraryBoundedContext/TvShowLibraryAggregate/Services/TvShowLibraryServiceTests.cs +++ /dev/null @@ -1,24 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services; -using System; -using System.Diagnostics.CodeAnalysis; -#endregion - -namespace Lumina.Domain.UnitTests.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services; - -/// -/// Contains unit tests for the class. -/// -[ExcludeFromCodeCoverage] -public class TvShowLibraryServiceTests -{ - [Fact] - public void TvShows_WhenAccessed_ShouldThrowNotImplementedException() - { - // Arrange - TvShowLibraryService sut = new(); - - // Act & Assert - Assert.Throws(() => sut.TvShows); - } -} diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/WrittenContentLibraryBoundedContext/Services/WrittenContentLibraryServiceTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/WrittenContentLibraryBoundedContext/Services/WrittenContentLibraryServiceTests.cs deleted file mode 100644 index 5498c773..00000000 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Core/BoundedContexts/WrittenContentLibraryBoundedContext/Services/WrittenContentLibraryServiceTests.cs +++ /dev/null @@ -1,28 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services; -using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services; -using NSubstitute; -using System.Diagnostics.CodeAnalysis; -#endregion - -namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services; - -/// -/// Contains unit tests for the class. -/// -[ExcludeFromCodeCoverage] -public class WrittenContentLibraryServiceTests -{ - [Fact] - public void Constructor_WhenCalled_ShouldSetInjectedService() - { - // Arrange - IBookLibraryService bookLibraryService = Substitute.For(); - - // Act - WrittenContentLibraryService sut = new(bookLibraryService); - - // Assert - Assert.Same(bookLibraryService, sut.BookLibraryService); - } -} diff --git a/tests/UnitTests/Lumina.Domain.UnitTests/Core/Services/MediaLibraryServiceTests.cs b/tests/UnitTests/Lumina.Domain.UnitTests/Core/Services/MediaLibraryServiceTests.cs deleted file mode 100644 index dbf6d324..00000000 --- a/tests/UnitTests/Lumina.Domain.UnitTests/Core/Services/MediaLibraryServiceTests.cs +++ /dev/null @@ -1,31 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.Services; -using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services; -using Lumina.Domain.Core.Services; -using NSubstitute; -using System.Diagnostics.CodeAnalysis; -#endregion - -namespace Lumina.Domain.UnitTests.Core.Services; - -/// -/// Contains unit tests for the class. -/// -[ExcludeFromCodeCoverage] -public class MediaLibraryServiceTests -{ - [Fact] - public void Constructor_WhenCalled_ShouldSetInjectedServices() - { - // Arrange - IVideoLibraryService videoLibraryService = Substitute.For(); - IWrittenContentLibraryService writtenContentLibraryService = Substitute.For(); - - // Act - MediaLibraryService sut = new(videoLibraryService, writtenContentLibraryService); - - // Assert - Assert.Same(videoLibraryService, sut.VideoLibraryService); - Assert.Same(writtenContentLibraryService, sut.WrittenContentLibraryService); - } -} diff --git a/tests/UnitTests/Lumina.Infrastructure.UnitTests/Core/MediaLibrary/Management/Scanning/Jobs/Common/MetadataAggregatorTests.cs b/tests/UnitTests/Lumina.Infrastructure.UnitTests/Core/MediaLibrary/Management/Scanning/Jobs/Common/MetadataAggregatorTests.cs index 59a554c5..ccca888c 100644 --- a/tests/UnitTests/Lumina.Infrastructure.UnitTests/Core/MediaLibrary/Management/Scanning/Jobs/Common/MetadataAggregatorTests.cs +++ b/tests/UnitTests/Lumina.Infrastructure.UnitTests/Core/MediaLibrary/Management/Scanning/Jobs/Common/MetadataAggregatorTests.cs @@ -4,6 +4,7 @@ using Lumina.Contracts.Fixtures.Core.DTO.Common; using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors; using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Infrastructure.Core.MediaLibrary.Management.Scanning.Jobs.Common; using System; using System.Diagnostics.CodeAnalysis; @@ -137,8 +138,8 @@ public class MetadataAggregatorTests // Arrange BookMetadataDto first = _bookMetadataDtoFixture.Create(title: "Title", coverImagePath: "First Cover", includeOptionalProperties: false); BookMetadataDto second = _bookMetadataDtoFixture.Create(title: "Title", coverImagePath: "First Cover", includeOptionalProperties: false); - first = first with { ReleaseInfo = _releaseInfoDtoFixture.Create(originalReleaseDate: new DateOnly(2001, 1, 1), originalReleaseYear: 2001, releaseCountry: "US") }; - second = second with { ReleaseInfo = _releaseInfoDtoFixture.Create(reReleaseDate: new DateOnly(2010, 5, 5), reReleaseYear: 2010, releaseCountry: "UK", releaseVersion: "2.0") }; + first = first with { ReleaseInfo = _releaseInfoDtoFixture.Create(originalReleaseDate: new DateOnly(2001, 1, 1), originalReleaseYear: 2001, releaseCountry: ReleaseCountry.US) }; + second = second with { ReleaseInfo = _releaseInfoDtoFixture.Create(reReleaseDate: new DateOnly(2010, 5, 5), reReleaseYear: 2010, releaseCountry: ReleaseCountry.GB, releaseVersion: "2.0") }; // Act BookMetadataDto result = MetadataAggregator.Merge(first, second); @@ -148,7 +149,7 @@ public class MetadataAggregatorTests Assert.Equal(2001, result.ReleaseInfo.OriginalReleaseYear); Assert.Equal(new DateOnly(2010, 5, 5), result.ReleaseInfo.ReReleaseDate); Assert.Equal(2010, result.ReleaseInfo.ReReleaseYear); - Assert.Equal("US", result.ReleaseInfo.ReleaseCountry); + Assert.Equal(ReleaseCountry.US, result.ReleaseInfo.ReleaseCountry); Assert.Equal("2.0", result.ReleaseInfo.ReleaseVersion); } diff --git a/tests/UnitTests/Lumina.Plugins.OpenLibrary.UnitTests/Core/Mapping/OpenLibraryMapperTests.cs b/tests/UnitTests/Lumina.Plugins.OpenLibrary.UnitTests/Core/Mapping/OpenLibraryMapperTests.cs index 5228b0f2..4a0bb823 100644 --- a/tests/UnitTests/Lumina.Plugins.OpenLibrary.UnitTests/Core/Mapping/OpenLibraryMapperTests.cs +++ b/tests/UnitTests/Lumina.Plugins.OpenLibrary.UnitTests/Core/Mapping/OpenLibraryMapperTests.cs @@ -6,6 +6,7 @@ using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary; using Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books; using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; using Lumina.Plugins.OpenLibrary.Common.Models.Contracts.Responses; using Lumina.Plugins.OpenLibrary.Core.Mapping; @@ -182,7 +183,7 @@ public class OpenLibraryMapperTests Assert.DoesNotContain(result.Metadata.Genres!, genre => genre.Name == "Space"); Assert.Contains(result.Metadata.Tags!, tag => tag.Name == "Science fiction"); Assert.Contains(result.Metadata.Tags!, tag => tag.Name == "Space"); - Assert.Equal("London", result.Metadata.ReleaseInfo.ReleaseCountry); + Assert.Null(result.Metadata.ReleaseInfo.ReleaseCountry); BookRatingDto rating = Assert.Single(result.Ratings!); Assert.Equal(4.1m, rating.Value); Assert.Equal(5m, rating.MaxValue); @@ -246,7 +247,7 @@ public class OpenLibraryMapperTests Assert.Equal(1987, result.Metadata.ReleaseInfo.OriginalReleaseYear); Assert.Equal(new DateOnly(2010, 5, 1), result.Metadata.ReleaseInfo.ReReleaseDate); Assert.Equal(2010, result.Metadata.ReleaseInfo.ReReleaseYear); - Assert.Equal("New York", result.Metadata.ReleaseInfo.ReleaseCountry); + Assert.Null(result.Metadata.ReleaseInfo.ReleaseCountry); Assert.Equal("First Edition", result.Metadata.ReleaseInfo.ReleaseVersion); GenreDto genre = Assert.Single(result.Metadata.Genres!); Assert.Equal("Fantasy", genre.Name);