using DocumentFormat.OpenXml.Office.CoverPageProps;
using KssSmaPlaLib.DtoMapping.Attributes;
using KssSmaPlaLib.Exchange.Interfaces;
using KssSmaPlaLib.IO.File;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExcelToCsvToDb.DTO
{
    /// <summary>
    /// WE生産計画詳細テーブルDTO
    /// </summary>
    public class WeOrderDto : ICsvExportableUxer
    {
        public DateTime CreateRecordDate { get; set; } = DateTime.Now;
        public int LineId { get; set; } = -1;
        public string LineName { get; set; } = string.Empty;
        [ExcelColumnLetter("D")]
        public string BasicPartsNo { get; set; } = string.Empty;
        public DateTime WorkDate { get; set; } = DateTime.Now;
        public int AfAmount { get; set; } = -1;
        public int WeAmount { get; set; } = -1;
        public int KdWeAmount { get; set; } = -1;
        public int? ProductionLur { get; set; } = -1;
        [ExcelColumnLetter("C")]
        public string ModelCd { get; set; } = string.Empty;
        [ExcelColumnLetter("E")]
        public string Derivation { get; set; } = string.Empty;
        [ExcelColumnLetter("F")]
        public int TactTime { get; set; } = -1;

        public string CsvHeader => CsvUxer.Join(
            "create_record_date",
            "line_id",
            "line_name",
            "basic_parts_no",
            "work_date",
            "af_amount",
            "we_amount",
            "kd_we_amount",
            "production_lur",
            "model_cd",
            "derivation",
            "tact_time");

        public string ToCsvLine() => CsvUxer.Join(
            CreateRecordDate,
            LineId,
            LineName,
            BasicPartsNo,
            WorkDate,
            AfAmount,
            WeAmount,
            KdWeAmount,
            ProductionLur,
            ModelCd,
            Derivation,
            TactTime);
    }
}
