Files
Musify/backend/Musify.Api/Validators/Albums/UpdateAlbumRequestValidator.cs
T
Admin 22ed923a04 feat(api): expose the album endpoints
Eight routes under /albums covering the listing, the detail, the tracklist and
the owner-only writes, wired to the same validation filter and ErrorOr mapping
the playlists use.
2026-07-20 20:13:40 +02:00

22 lines
592 B
C#

using FluentValidation;
using Musify.Api.DataTransferObjects.Albums;
namespace Musify.Api.Validators.Albums;
public sealed class UpdateAlbumRequestValidator : AbstractValidator<UpdateAlbumRequest>
{
public UpdateAlbumRequestValidator()
{
RuleFor(x => x.NewTitle)
.NotEmpty()
.MaximumLength(200);
RuleFor(x => x.NewDescription)
.MaximumLength(256);
RuleFor(x => x.NewReleaseYear)
.InclusiveBetween(AlbumReleaseYear.Earliest, AlbumReleaseYear.Latest)
.When(x => x.NewReleaseYear.HasValue);
}
}