using Model.Models.VitrosModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LISWebAPI.Persistence
{
    public static class SeedApplicationData
    {
        public static async Task SeedDataAsync(ApplicationDbContext dbContext)
        {
            if (dbContext.Machines.Any() == false)
            {
                //ALB
                //ALKP
                //ALTV
                //AST
                //Bc
                //Bu
                //Ca
                //CREA
                //CRP
                //GLU
                //LDH
                //TBIL
                //UREA
                //URIC
                List<Component> componentsInVitros = new List<Component>()
                {
                    new Component()
                    {
                        DisplayName="ALB",
                        TestName ="Albumin",
                        IsActive =true
                    },
                    new Component()
                    {
                        DisplayName="ALKP",
                        TestName ="Alkaline Phosphatase",
                        IsActive =true
                    },
                    new Component()
                    {
                        DisplayName="ALTV",
                        TestName ="Alanine Aminotransferase",
                        IsActive =true
                    },
                       new Component()
                    {
                        DisplayName="AST",
                        TestName ="Aspartate Aminotransferase",
                        IsActive =true
                    },
                     new Component()
                    {
                        DisplayName="Bc",
                        TestName ="Bilirubin, Conjugated",
                        IsActive =true
                    },
                    new Component()
                    {
                        DisplayName="Bu",
                        TestName ="Bilirubin, Unconjugated",
                        IsActive =true
                    },
                     new Component()
                    {
                        DisplayName="Ca",
                        TestName ="Calcium",
                        IsActive =true
                    },
                      new Component()
                    {
                        DisplayName="CREA",
                        TestName ="Creatinine",
                        IsActive =true
                    },
                       new Component()
                    {
                        DisplayName="CRP",
                        TestName ="C Reactive Protein",
                        IsActive =true
                    },
                        new Component()
                    {
                        DisplayName="GLU",
                        TestName ="Glucose",
                        IsActive =true
                    },
                         new Component()
                    {
                        DisplayName="LDH",
                        TestName ="Lactate Dehydrogenase",
                        IsActive =true
                    },
                          new Component()
                    {
                        DisplayName="TBIL",
                        TestName ="Total Bilirubin",
                        IsActive =true
                    },
                           new Component()
                    {
                        DisplayName="UREA",
                        TestName ="Urea Nitrogen",
                        IsActive =true
                    },
                            new Component()
                    {
                        DisplayName="URIC",
                        TestName ="Uric Acid",
                        IsActive =true
                    },

                };
                List<Machine> machinesInLab = new List<Machine>()
                {
                    new Machine()
                    
                    {
                        MachinedName= "Vitros250",
                        MachinedCode = "V250",
                        Manufacture = "",
                        Components = componentsInVitros,
                        IsActive = true
                    }


                };
                dbContext.Machines.AddRange(machinesInLab);

                await dbContext.SaveChangesAsync();

            }
        }
    }
}
