using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GreenTree.Nachtragsmanagement.Services.Configuration
{
    public interface IConfigurationReference
    {
        /// <summary>
        /// Id
        /// </summary>
        Guid Id { get; }

        /// <summary>
        /// Internal name
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Display name
        /// </summary>
        string DisplayName { get; }

        /// <summary>
        /// Determines if mutiple values are selectable
        /// </summary>
        bool IsMultipleSelection { get; }

        /// <summary>
        /// Get available values
        /// </summary>
        ConfigurationReferenceElement[] GetAvailableValues();

        /// <summary>
        /// Transforms mutiple selected values into a single line value
        /// </summary>
        /// <param name="values">Selected values.</param>
        string TransformValueCollectionToValue(string[] values);

        /// <summary>
        /// Transforms the single line value into a mutiple selected values
        /// </summary>
        /// <param name="value">Single line value.</param>
        string[] TransformValueToValueCollection(string value);

        /// <summary>
        /// Converts the string converted value into strongly typed value
        /// </summary>
        /// <param name="values">The selected value.</param>
        T GetValue<T>(string value);

        /// <summary>
        /// Converts the string converted values into strongly typed values
        /// </summary>
        /// <param name="values">The selected values.</param>
        T GetValues<T>(string[] values);
    }
}
