using Core.Abstractions.DomainObjects;
using Core.Abstractions.Models;
using Core.Enumerations;
using Extensions;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using WeatherForecast.Models.Requests.L10n;

namespace WeatherForecast.Models.Abstractions {

  /// <summary>
  /// 
  /// </summary>
  /// <typeparam name="T"></typeparam>
  public abstract class PostItemRequestModelBase<T> : RequestModelBase<T> {

    /// <summary>
    /// 
    /// </summary>
    public List<PostItemL10nModel>? L10n { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public List<MediaAttachmentRequestModel>? MediaAttachments { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public List<Guid>? Categories { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public List<string>? Tags { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public bool? FamilyFriendly { get; set; }

    /// <summary>
    /// Base MemberNotNullWhen workaround
    /// </summary>
    /// <param name="hasErrors"></param>
    /// <returns></returns>
    [MemberNotNullWhen(false, new[] { nameof(L10n) })]
    private protected bool HasValidationErrorsBase(bool hasErrors) => hasErrors;
  }
}
