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

namespace AVS
{
    class MODELLog
    {
        //public string CONTAINER_NO { get; set; }
        public string MODEL_NO { get; set; }
        public string QR { get; set; }
        public decimal LIVE_WEIGHT { get; set; }
        public string SYS_IP { get; set; }
        public DateTime RECORD_DATE { get; set; }
        public string USER_ID { get; set; }
        public string PC_NAME { get; set; }

        public string MARKET_PLACE { get; set; }


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

        public class MODELLogTable
        {
            public static List<TableColumn> GetColumns()
            {
                return new List<TableColumn>
        {
            new TableColumn { Name = "Id", DataType = "INTEGER PRIMARY KEY AUTOINCREMENT" },
            //new TableColumn { Name = "CONTAINER_NO", DataType = "TEXT" },
            new TableColumn { Name = "QR", DataType = "TEXT" },
            new TableColumn { Name = "MODEL_NO", DataType = "TEXT" },
            new TableColumn { Name = "LIVE_WEIGHT", DataType = "REAL" },
            new TableColumn { Name = "SYS_IP", DataType = "TEXT" },
            new TableColumn { Name = "RECORD_DATE", DataType = "DATETIME" },
            new TableColumn { Name = "USER_ID", DataType = "TEXT" },
            new TableColumn { Name = "PC_NAME", 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}"));
        }

    }
}
