using FluentValidation;
using MiningService.API.Application.Commands;

namespace MiningService.API.Application.Validations;

/// <summary>
/// EN: Validator for RemoveCircleMemberCommand.
/// VI: Validator cho RemoveCircleMemberCommand.
/// </summary>
public class RemoveCircleMemberCommandValidator : AbstractValidator<RemoveCircleMemberCommand>
{
    public RemoveCircleMemberCommandValidator()
    {
        RuleFor(x => x.OwnerId)
            .NotEmpty().WithMessage("Owner ID is required / ID chủ sở hữu là bắt buộc");

        RuleFor(x => x.MemberId)
            .NotEmpty().WithMessage("Member ID is required / ID thành viên là bắt buộc");

        RuleFor(x => x)
            .Must(x => x.OwnerId != x.MemberId)
            .WithMessage("Cannot remove yourself from circle / Không thể xóa chính mình khỏi vòng tròn");
    }
}
