#nullable enable

using FoodsharingSiegen.Contracts.Entity;
using FoodsharingSiegen.Contracts.Enums;
using FoodsharingSiegen.Contracts.Model;

namespace FoodsharingSiegen.Shared.Helper
{
    public static class TermHelper
    {
        #region Public Method Translate

        /// <summary>
        ///     Translates an <see cref="InteractionType" /> instance into a corresponding string representation,
        ///     using the provided application settings if necessary.
        /// </summary>
        /// <param name="type">The interaction type to translate.</param>
        /// <param name="appSettings">The application settings used for custom translations.</param>
        /// <returns>A string representation of the specified interaction type.</returns>
        public static string Translate(this InteractionType type, AppSettings appSettings)
        {
            return type switch
            {
                InteractionType.EinAb => "Einführung",
                InteractionType.Welcome => "Begrüßung",
                InteractionType.IdCheck => "Perso-Check",
                InteractionType.PrintPass => "FS-Ausweis",
                InteractionType.Verify => "Verifizierung",
                InteractionType.Complete => "Fertig",
                InteractionType.StepInBriefing => appSettings.Terms.StepInName ?? "StepIn",
                InteractionType.ReleasedForVerification => "Freigabe Freischalten",
                _ => type.ToString()
            };
        }

        #endregion
    }
}