namespace Baya.Domain.Entities.Booking;

/// <summary>
/// The closed code set for <c>required_caregiver_gender</c>. Same-gender bodily care is decisive in the
/// Iranian context, so this is a first-class filter matched against the nurse's gender at request time —
/// never a soft preference and never silently defaulted. <see cref="Any"/> matches either nurse gender.
/// </summary>
public static class CaregiverGender
{
    public const string Male = "male";
    public const string Female = "female";
    public const string Any = "any";

    public static bool IsValid(string value)
        => value is Male or Female or Any;

    /// <summary>
    /// True when a nurse of <paramref name="nurseGender"/> satisfies the required caregiver gender.
    /// <see cref="Any"/> always matches; <see cref="Male"/>/<see cref="Female"/> require an exact match.
    /// </summary>
    public static bool Matches(string required, string nurseGender)
        => required == Any || string.Equals(required, nurseGender, System.StringComparison.OrdinalIgnoreCase);
}
