using BarBusinessLogic.OfficePackage.HelperEnums;
using BarBusinessLogic.OfficePackage.HelperModels;

namespace BarBusinessLogic.OfficePackage
{
    public abstract class AbstractSaveToWord
    {
        public void CreateDoc(WordInfo Info)
        {
            CreateWord(Info);

            CreateParagraph(new WordParagraph
            {
                Texts = new List<(string, WordTextProperties)> { (Info.Title, new WordTextProperties { Bold = true, Size = "24", }) },
                TextProperties = new WordTextProperties
                {
                    Size = "24",
                    JustificationType = WordJustificationType.Center
                }
            });

            foreach (var Cocktails in Info.Cocktails)
            {
                CreateParagraph(new WordParagraph
                {
                    Texts = new List<(string, WordTextProperties)> {
                        (Cocktails.CocktailName, new WordTextProperties { Size = "24", Bold = true}),
                        ("\t"+Cocktails.Price.ToString(), new WordTextProperties{Size = "24"})

                    },
                    TextProperties = new WordTextProperties
                    {
                        Size = "24",
                        JustificationType = WordJustificationType.Both
                    }
                });
            }

            SaveWord(Info);
        }
        
        protected abstract void CreateWord(WordInfo Info);
        
        protected abstract void CreateParagraph(WordParagraph Paragraph);
        
        protected abstract void SaveWord(WordInfo Info);
    }
}
