using System.Xml.Serialization;

namespace economy.Models.Price.Domestic.Item.Detail
{
    // 검색결과 변수
    [XmlRoot(ElementName = "response")]
    public class Response
    {
        [XmlElement(ElementName = "body")]
        public Body Body { get; set; }
    }

    public class Body
    {
        // 품목코드
        [XmlElement(ElementName = "ic")]
        public string Ic { get; set; }

        // 품목명
        [XmlElement(ElementName = "in")]
        public string In { get; set; }

        [XmlElement(ElementName = "items")]
        public Items Items { get; set; }

        [XmlElement(ElementName = "numOfRows")]
        public int NumberOfRows { get; set; }

        [XmlElement(ElementName = "pageNo")]
        public int PageNo { get; set; }

        [XmlElement(ElementName = "totalCount")]
        public int TotalCount { get; set; }
    }

    public class Items
    {
        [XmlElement(ElementName = "item")]
        public List<Item> ItemList { get; set; }
    }

    public class Item
    {
        public int Num { get; set; }

        // 상품 ID
        [XmlElement(ElementName = "pi")]
        public string Pi { get; set; }

        // 상품명
        [XmlElement(ElementName = "pn")]
        public string Pn { get; set; }

        // 판매가격
        [XmlElement(ElementName = "sp")]
        public int Sp { get; set; }

        // 할인가격
        [XmlElement(ElementName = "dp")]
        public int Dp { get; set; }

        // 혜택가격
        [XmlElement(ElementName = "bp")]
        public int Bp { get; set; }

        // 가격일자
        [XmlElement(ElementName = "sd")]
        public string Sd { get; set; }
    }
}
