// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
//    using Apifox;
//
//    var request = Request.FromJson(jsonString);
namespace MegaRobo.C00225155.Entities.FromWeb
{
    using System;
    using System.Collections.Generic;

    using System.Globalization;
    using Newtonsoft.Json;
    using Newtonsoft.Json.Converters;

    /// <summary>
    /// 根据BS那最新的要求改的同步序列的数据结构 260116
    /// </summary>
    public class SampleSeqRequestEx
    {
        [JsonProperty("config")]
        public ConfigEx Config { get; set; }

        /// <summary>
        /// 样本序列,管子信息
        /// </summary>
        [JsonProperty("sampleSeqs")]
        public List<SampleSeq> SampleSeqs { get; set; }

        public SampleSeqRequestEx FromJson(string json) => JsonConvert.DeserializeObject<SampleSeqRequestEx>(json);
        public string ToJson() => JsonConvert.SerializeObject(this);
    }

    public class ConfigEx 
    {
        [JsonProperty("boxInfo")]
        public List<BoxInfoEx> BoxInfo { get; set; }
    }

    public class BoxInfoEx
    {
        /// <summary>
        /// 载具类型，_40mL原液工装 = 1,_12mL样品工装 = 2,_5mL样品工装 = 3,_2mL外瓶工装 = 4,_滤芯瓶工装 = 5,_16mL粉末瓶工装=6
        /// ,_125mL粉末瓶工装=7 ,_50uLTip头工装= 8,_300uLTip头工装=9 ,_1000uLTip头工装=10
        /// </summary>
        [JsonProperty("fixtureType")]
        public int FixtureType { get; set; }  //BoxTypeEnum

        /// <summary>
        /// 载具所在的位置，1~7
        /// </summary>
        [JsonProperty("posInUpload")]
        public int PosInUpload { get; set; }

        /// <summary>
        /// 载具二维码
        /// </summary>
        [JsonProperty("carrierQrCode")]
        public string SnCode { get; set; }
    }

    /// <summary>
    /// Request
    /// </summary>
    public class SampleSeqRequest
    {
        [JsonProperty("config")]
        public Config Config { get; set; }

        /// <summary>
        /// 样本序列,管子信息
        /// </summary>
        [JsonProperty("sampleSeqs")]
        public List<SampleSeq> SampleSeqs { get; set; }

        public SampleSeqRequest FromJson(string json) => JsonConvert.DeserializeObject<SampleSeqRequest>(json);
        public string ToJson() => JsonConvert.SerializeObject(this);
    }

    public class Config
    {
        [JsonProperty("boxInfo")]
        public List<SampleSeqConfig> BoxInfo { get; set; }
    }

    public class SampleSeqConfig
    {
        /// <summary>
        /// 载具类型，_40mL原液工装 = 1,_12mL样品工装 = 2,_5mL样品工装 = 3,_2mL外瓶工装 = 4,_滤芯瓶工装 = 5,_16mL粉末瓶工装=6
        /// ,_125mL粉末瓶工装=7 ,_50uLTip头工装= 8,_300uLTip头工装=9 ,_1000uLTip头工装=10
        /// </summary>
        [JsonProperty("fixtureType")]
        public int FixtureType { get; set; }  //BoxTypeEnum

        /// <summary>
        /// 载具所在的位置，1~7
        /// </summary>
        [JsonProperty("posInUpload")]
        public int PosInUpload { get; set; }

        /// <summary>
        /// 剩余tip数目，fixtureType=8、9、10时需要传入剩余tip数目
        /// </summary>
        [JsonProperty("remainCount")]
        public int RemainCount { get; set; }

        /// <summary>
        /// 载具二维码
        /// </summary>
        [JsonProperty("snCode")]
        public string SnCode { get; set; }
    }

    public class SampleSeq
    {
        /// <summary>
        /// 区域deviceKey，A1
        /// </summary>
        [JsonProperty("area")]
        public string Area { get; set; }

        /// <summary>
        /// 载具1~7
        /// </summary>
        [JsonProperty("carrier")]
        public string Carrier { get; set; }

        /// <summary>
        /// 样品名称，作为5/12ml原液瓶或者粉末需要传入其名称，对于样品瓶需要传入样品名称
        /// </summary>
        [JsonProperty("code")]
        public string Code { get; set; }

        /// <summary>
        /// 位置 孔号
        /// </summary>
        [JsonProperty("pos")]
        public string Pos { get; set; }

        [JsonProperty("sampleConfig")]
        public SampleConfig SampleConfig { get; set; }

        /// <summary>
        /// 序列id，对于样品瓶，每个都不一样，其他类型的无所谓
        /// </summary>
        [JsonProperty("sampleSeqId")]
        public long SampleSeqId { get; set; }

        /// <summary>
        /// 样本类型，_5mL = 1,_12mL = 2,其它 = 0
        /// </summary>
        [JsonProperty("sampleType")]
        public string SampleType { get; set; }
    }

    public class SampleConfig
    {
        /// <summary>
        /// 样品瓶工单信息，对于5/12ml样品瓶，必填，写入加粉加液信息
        /// </summary>
        [JsonProperty("materialDoseFunctionFlow")]
        public List<SampleFunction> MaterialDoseFunctionFlow { get; set; }
    }

    public class SampleFunction
    {
        /// <summary>
        /// 添加类型，0液1固
        /// </summary>
        [JsonProperty("functionFlowType")]
        public int FunctionFlowType { get; set; }

        /// <summary>
        /// 添加量，液体单位是μl,固体单位是mg
        /// </summary>
        [JsonProperty("targetVolumn")]
        public double TargetVolumn { get; set; }

        /// <summary>
        /// 添加物名称，添加的液体或者固体名称
        /// </summary>
        [JsonProperty("userMaterialName")]
        public string UserMaterialName { get; set; }
    }
}
