using System;

namespace InABox.Core
{
    
    public interface IBaseDigitalFormInstance : IEntity
    {
        DigitalFormLink Form { get; }
        DateTime FormStarted { get; set; }
        TimeSpan FormOpen { get; set; }
        DateTime FormCompleted { get; set; }
        DateTime FormProcessed { get; set; }
        DateTime FormCancelled { get; set; }
    }
    
    public interface ICoreDigitalFormInstance : IBaseDigitalFormInstance
    {
        [Obsolete("Replaced with Form", true)]
        QAFormLink QAForm { get; }
        
        [Obsolete("Replaced with FormData", true)]
        string QAData { get; set; }
        
        String Number { get; set; }
        
        String Description { get; set; }

        string FormData { get; set; }

        string? BlobData { get; set; }

        [Obsolete("Replaced with FormCompleted", true)]
        DateTime QACompleted { get; set; }
        
        [Obsolete("Replaced with FormCompletedBy", true)]
        UserLink QACompletedBy { get; }

        UserLink FormCompletedBy { get; }

        Location Location { get; }
        
        IDigitalFormDataModel CreateDataModel(DigitalFormVariable[] variables, Entity? parent = null);

        IEntityLink Parent { get; }

        Guid ParentID();

        Type ParentType();
    }

    public interface IDigitalFormInstance : ICoreDigitalFormInstance
    {
    }

    public interface IDigitalFormInstance<TEntityLink> : IDigitalFormInstance where TEntityLink : IEntityLink
    {
        new TEntityLink Parent { get; }

        IEntityLink ICoreDigitalFormInstance.Parent
        {
            get => Parent;
        }
    }
}