Add track coauthors with invitations, acceptance and coauthor-aware track responses
Owners invite existing users to coauthor a track; invitees accept or reject, and either side can remove a coauthor. Only accepted coauthors appear in track responses and in the coauthor's public track list. The owner also receives the full invitation list with statuses on the user tracks response.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using FluentValidation;
|
||||
using Musify.Api.DataTransferObjects.Tracks;
|
||||
|
||||
namespace Musify.Api.Validators.Tracks
|
||||
{
|
||||
public sealed class InviteCoauthorsRequestValidator : AbstractValidator<InviteCoauthorsRequest>
|
||||
{
|
||||
public const int MaxUsersPerRequest = 20;
|
||||
|
||||
public InviteCoauthorsRequestValidator()
|
||||
{
|
||||
RuleFor(x => x.UserIds)
|
||||
.NotEmpty()
|
||||
.Must(ids => ids.Count <= MaxUsersPerRequest)
|
||||
.WithMessage($"At most {MaxUsersPerRequest} users can be invited at once.");
|
||||
|
||||
RuleForEach(x => x.UserIds)
|
||||
.GreaterThan(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user