using LinqToDB.Mapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MasaBlazorApp3.Pojo
{
    [Table("in_out_invoice")]
    public class InOutInvoice
    {
        /// <summary>
        /// 主键（序号）       
        /// </summary>
        [Column("id", IsPrimaryKey = true, IsIdentity =true)]
        public int Id { get; set; }

        [Column("in_pharmacy_id")]
        public string InPharmacyId { get; set; }

        [Column("out_pharmacy_id")]
        public string OutPharmacyId { get; set; }

        /// <summary>
        /// 库存管理单位（入库单位代码） 
        /// </summary>
        [Column("storage")]
        public string storage { get; set; }

         /// <summary>
         /// 单据号
         /// </summary>
        [Column("invoice_no")]
        public string InvoiceNo { get; set; }

        [Column("invoice_date")]
        public string InvoiceDate { get; set; }

        /// <summary>
        /// 药品id
        /// </summary>
        [Column("drug_id")]
        public string DrugId { get; set; }



        [Association(ThisKey = nameof(DrugId), OtherKey = nameof(DrugInfo.DrugId))]
        public DrugInfo Drug { get; set; } = new();

        /// <summary>
        /// 药品规格
        /// </summary>
        [Column("drug_spec")]
        public string DrugSpec { get; set; }

        /// <summary>
        /// 计算单位
        /// </summary>
        [Column("units")]
        public string Units { get; set; }

        /// <summary>
        /// 厂商标识
        /// </summary>
        [Column("firm_id")]
        public string FirmId { get; set; }

        /// <summary>
        /// 包装规格（反映药品含量及包装信息，如0.25g*30）   
        /// </summary>
        [Column("package_spec")]
        public string PackageSpec { get; set; }
        
        /// <summary>
        /// 数量（以包装单位所计的数量）      
        /// </summary>
        [Column("quantity")]
        public int quantity { get; set; }
        
        /// <summary>
        /// 计量单位，可使用任一级管理上方便的包装
        /// </summary>
        [Column("package_units")]
        public string PackageUnits { get; set; }
        
        /// <summary>
        /// 药品批次
        /// </summary>
        [Column("drug_manu_no")]
        public string DrugManuNo { get; set; }
       
        /// <summary>
        /// 创建时间（入库日期）
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }
        
        /// <summary>
        /// 2调拨出库1.调拨入库 0.调拨
        /// </summary>
        [Column("type")]
        public int Type { get; set; }
        
        /// <summary>
        /// 类型描述
        /// </summary>
        [Column("type_describe")]
        public string TypeDescribe { get; set; }
        
        /// <summary>
        /// 供货方
        /// </summary>
        [Column("supplier")]
        public string Supplier { get; set; }
        
        /// <summary>
        /// 操作人
        /// </summary>
        [Column("operator")]
        public string Operator { get; set; }
        
        /// <summary>
        /// 存放库房
        /// </summary>
        [Column("sub_storage")]
        public string SubStorage { get; set; }
        
        /// <summary>
        /// 备注
        /// </summary>
        [Column("memos")]
        public string Memos { get; set; }

        [Column("status")]
        public int Status { get; set; }

        [Column("drug_eff_date")]
        public string EffDate { get; set; }


        [Column("cancel_flag")]
        public int CancelFlag { get; set; }

    }
}
