// EN: FluentValidation validator for CancelAppointmentCommand.
// VI: FluentValidation validator cho CancelAppointmentCommand.

using BookingService.API.Application.Commands;
using FluentValidation;

namespace BookingService.API.Application.Validations;

/// <summary>
/// EN: Validator for CancelAppointmentCommand.
/// VI: Validator cho CancelAppointmentCommand.
/// </summary>
public class CancelAppointmentCommandValidator : AbstractValidator<CancelAppointmentCommand>
{
    public CancelAppointmentCommandValidator()
    {
        RuleFor(x => x.AppointmentId)
            .NotEmpty()
            .WithMessage("Appointment ID is required / ID cuộc hẹn là bắt buộc");

        RuleFor(x => x.Reason)
            .NotEmpty()
            .WithMessage("Cancellation reason is required / Lý do hủy là bắt buộc")
            .MaximumLength(500)
            .WithMessage("Reason cannot exceed 500 characters / Lý do không được vượt quá 500 ký tự");
    }
}
