using Baya.Domain.Common;

namespace Baya.Domain.Entities.Catalog;

/// <summary>
/// An admin-managed configurable <b>pricing dimension</b> (e.g. نوع شیفت / shift type, تعداد بیمار /
/// patient count). This is the EAV skeleton that lets a new dimension ship as rows, not a schema change.
/// <para>
/// <see cref="ServiceCategoryId"/> == <c>null</c> is a <b>meaningful "cross-category"</b> group: the
/// dimension applies to <i>every</i> category (e.g. shift type applies everywhere), not missing data.
/// The applicable set for a category is therefore its own groups <b>plus</b> every NULL-category group —
/// the required-group check and the duplicate guard must both honour that.
/// </para>
/// </summary>
public class ServiceOptionGroup : BaseEntity<long>
{
    /// <summary>NULL = cross-category (applies to every category). A real coverage choice, not unset.</summary>
    public long? ServiceCategoryId { get; set; }
    public ServiceCategory ServiceCategory { get; set; }

    public string NameFa { get; set; }
    public string NameEn { get; set; }

    /// <summary>Whether a variant in an applicable category must answer this dimension exactly once.</summary>
    public bool IsRequired { get; set; }

    public int SortOrder { get; set; }
    public bool IsActive { get; set; }

    public DateTimeOffset? DeletedAt { get; set; }

    public ICollection<ServiceOptionValue> Values { get; set; }
}
