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

namespace AVS
{
    public class SKULog
    {
        public string FNSKU { get; set; }
        public string SKU { get; set; }
        public string Title { get; set; }
        public int ItemsPerBox { get; set; }
        public double NetWeightKg { get; set; }
        public string Colour { get; set; }
        public string Size { get; set; }
        public string ModelNo { get; set; }
        public DateTime RECORD_DATE { get; set; }
        public string SYS_IP { get; set; }
        public string USER_ID { get; set; }
        public string MARKET_PLACE { get; set; }

        public class TableColumn
        {
            public string Name { get; set; }
            public string DataType { get; set; }
        }

        public class SKULogTable
        {
            public static List<TableColumn> GetColumns()
            {
                return new List<TableColumn>
        {
            new TableColumn { Name = "Id", DataType = "INTEGER PRIMARY KEY AUTOINCREMENT" },
            new TableColumn { Name = "FNSKU", DataType = "TEXT" },
            new TableColumn { Name = "SKU", DataType = "TEXT" },
            new TableColumn { Name = "Title", DataType = "TEXT" },
            new TableColumn { Name = "ItemsPerBox", DataType = "INTEGER" },
            new TableColumn { Name = "NetWeightKg", DataType = "REAL" },
            new TableColumn { Name = "Colour", DataType = "TEXT" },
            new TableColumn { Name = "Size", DataType = "TEXT" },
            new TableColumn { Name = "ModelNo", DataType = "TEXT" },
            new TableColumn { Name = "RECORD_DATE", DataType = "DATETIME" },
            new TableColumn { Name = "SYS_IP", DataType = "TEXT" },
            new TableColumn { Name = "USER_ID", DataType = "TEXT" },
            new TableColumn { Name = "MARKET_PLACE", DataType = "TEXT" },
        };
            }
        }
        public static string GetColumnsDefinition(List<TableColumn> columns)
        {
            // Convert the list of columns into a string for the CREATE TABLE command
            return string.Join(", ", columns.Select(c => $"{c.Name} {c.DataType}"));
        }


    }
}
