#region ========================================================================= USING ===================================================================================== using Lumina.Domain.Common.Primitives; #endregion namespace Lumina.Domain.Common.Errors; /// /// Written content error types. /// public static partial class Errors { /// /// Defines the errors that report failures raised while working with books and book series. /// public static class WrittenContent { /// /// Gets the error that reports that a book with the same identifier or file path already exists in the library. /// public static Error BookAlreadyExists => Error.Conflict(description: nameof(BookAlreadyExists)); /// /// Gets the error that reports that an ISBN value cannot be empty. /// public static Error IsbnValueCannotBeEmpty => Error.Validation(description: nameof(IsbnValueCannotBeEmpty)); /// /// Gets the error that reports that the collection of ISBNs for a book cannot be . /// public static Error IsbnListCannotBeNull => Error.Validation(description: nameof(IsbnListCannotBeNull)); /// /// Gets the error that reports that an ISBN-10 value does not have a valid ISBN-10 format. /// public static Error InvalidIsbn10Format => Error.Validation(description: nameof(InvalidIsbn10Format)); /// /// Gets the error that reports that an ISBN-13 value does not have a valid ISBN-13 format. /// public static Error InvalidIsbn13Format => Error.Validation(description: nameof(InvalidIsbn13Format)); /// /// Gets the error that reports that an ISBN format is not a recognized ISBN-10 or ISBN-13 value. /// public static Error UnknownIsbnFormat => Error.Unexpected(description: nameof(UnknownIsbnFormat)); /// /// Gets the error that reports that the book cannot be added to the series because the series already contains it. /// public static Error TheBookIsAlreadyInTheSeries => Error.Forbidden(description: nameof(TheBookIsAlreadyInTheSeries)); /// /// Gets the error that reports that the book cannot be removed from the series because the series does not contain it. /// public static Error TheBookIsNotInTheSeries => Error.Forbidden(description: nameof(TheBookIsNotInTheSeries)); /// /// Gets the error that reports that an ASIN must be exactly 10 characters long. /// public static Error AsinMustBe10CharactersLong => Error.Validation(description: nameof(AsinMustBe10CharactersLong)); /// /// Gets the error that reports that a Goodreads identifier is not made of digits. /// public static Error GoodreadsIdMustBeNumeric => Error.Validation(description: nameof(GoodreadsIdMustBeNumeric)); /// /// Gets the error that reports that an LCCN does not have a valid Library of Congress Control Number format. /// public static Error InvalidLccnFormat => Error.Validation(description: nameof(InvalidLccnFormat)); /// /// Gets the error that reports that an OCLC number does not have a valid OCLC format. /// public static Error InvalidOclcFormat => Error.Validation(description: nameof(InvalidOclcFormat)); /// /// Gets the error that reports that an Open Library identifier does not have a valid format. /// public static Error InvalidOpenLibraryId => Error.Validation(description: nameof(InvalidOpenLibraryId)); /// /// Gets the error that reports that a LibraryThing identifier exceeds the maximum length of 50 characters. /// public static Error LibraryThingIdMustBeMaximum50CharactersLong => Error.Validation(description: nameof(LibraryThingIdMustBeMaximum50CharactersLong)); /// /// Gets the error that reports that a Google Books identifier must be exactly 12 characters long. /// public static Error GoogleBooksIdMustBe12CharactersLong => Error.Validation(description: nameof(GoogleBooksIdMustBe12CharactersLong)); /// /// Gets the error that reports that a Google Books identifier contains characters other than letters, digits, underscores and hyphens. /// public static Error InvalidGoogleBooksIdFormat => Error.Validation(description: nameof(InvalidGoogleBooksIdFormat)); /// /// Gets the error that reports that a Barnes and Noble identifier must be exactly 10 characters long. /// public static Error BarnesAndNoblesIdMustBe10CharactersLong => Error.Validation(description: nameof(BarnesAndNoblesIdMustBe10CharactersLong)); /// /// Gets the error that reports that a Barnes and Noble identifier is not made of digits. /// public static Error InvalidBarnesAndNoblesIdFormat => Error.Validation(description: nameof(InvalidBarnesAndNoblesIdFormat)); /// /// Gets the error that reports that an Apple Books identifier does not have the expected id prefix followed by digits. /// public static Error InvalidAppleBooksIdFormat => Error.Validation(description: nameof(InvalidAppleBooksIdFormat)); /// /// Gets the error that reports that the publisher of a book exceeds the maximum length of 100 characters. /// public static Error PublisherMustBeMaximum100CharactersLong => Error.Validation(description: nameof(PublisherMustBeMaximum100CharactersLong)); /// /// Gets the error that reports that the page count of a book must be greater than zero. /// public static Error PageCountMustBeGreaterThanZero => Error.Validation(description: nameof(PageCountMustBeGreaterThanZero)); /// /// Gets the error that reports that a book format is not a recognized value. /// public static Error UnknownBookFormat => Error.Validation(description: nameof(UnknownBookFormat)); /// /// Gets the error that reports that the edition of a book exceeds the maximum length of 50 characters. /// public static Error EditionMustBeMaximum50CharactersLong => Error.Validation(description: nameof(EditionMustBeMaximum50CharactersLong)); /// /// Gets the error that reports that the volume number of a book must be greater than zero. /// public static Error VolumeNumberMustBeGreaterThanZero => Error.Validation(description: nameof(VolumeNumberMustBeGreaterThanZero)); /// /// Gets the error that reports that the book library cannot be . /// public static Error BookLibraryCannotBeNull => Error.Validation(description: nameof(BookLibraryCannotBeNull)); /// /// Gets the error that reports that the file path of a book cannot be empty. /// public static Error BookPathCannotBeEmpty => Error.Validation(description: nameof(BookPathCannotBeEmpty)); /// /// Gets the error that reports that the file path of a book exceeds the maximum length of 2048 characters. /// public static Error BookPathMustBeMaximum2048CharactersLong => Error.Validation(description: nameof(BookPathMustBeMaximum2048CharactersLong)); /// /// Gets the error that reports that a book file path does not reside within any of the content locations of the library. /// public static Error BookPathMustBeWithinLibraryContentLocations => Error.Validation(description: nameof(BookPathMustBeWithinLibraryContentLocations)); /// /// Gets the error that reports that a book identifier cannot be empty. /// public static Error BookIdCannotBeEmpty => Error.Validation(description: nameof(BookIdCannotBeEmpty)); /// /// Gets the error that reports that the cover image of a book cannot be . /// public static Error BookCoverCannotBeNull => Error.Validation(description: nameof(BookCoverCannotBeNull)); /// /// Gets the error that reports that the requested book does not exist. /// public static Error BookNotFound => Error.NotFound(description: nameof(BookNotFound)); } }