using FluentValidation;
using SocialService.API.Application.Commands;

namespace SocialService.API.Application.Validations;

/// <summary>
/// EN: Validator for UnblockUserCommand.
/// VI: Validator cho UnblockUserCommand.
/// </summary>
public class UnblockUserCommandValidator : AbstractValidator<UnblockUserCommand>
{
    public UnblockUserCommandValidator()
    {
        RuleFor(x => x.BlockerId)
            .NotEmpty().WithMessage("Blocker ID is required / ID người block là bắt buộc");

        RuleFor(x => x.BlockedId)
            .NotEmpty().WithMessage("Blocked user ID is required / ID người bị block là bắt buộc");

        RuleFor(x => x)
            .Must(x => x.BlockerId != x.BlockedId)
            .WithMessage("Cannot unblock yourself / Không thể bỏ block chính mình");
    }
}
