using OASystem.Domain.Entities.Groups;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OASystem.Domain.Dtos.Groups
{
    /// <summary>
    /// 团组增减款项Dto
    /// </summary>
    public class DecreasePaymentsDto
    {
        public int UserId { get; set; }
        public int CTId { get; set; }
        public int PageIndex { get; set; } = 1;
        public int PageSize { get; set; } = 10;
        
    }
    public class DecreasePaymentsListDto
    {
        public int UserId { get; set; }
        public int DiId { get; set; }
        public int IsPaySign { get; set; } = -1;
    }
    /// <summary>
    /// 团组增减款项操作
    /// </summary>
    public class DecreasePaymentsOpDto
    {
        /// <summary>
        /// 操作状态
        /// 1 添加 
        /// 2 修改 
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 支付方式
        /// </summary>
        public int PayDId { get; set; }
        /// <summary>
        /// 费用标识
        /// </summary>
        public int OrbitalPrivateTransfer { get; set; }

        /// <summary>
        /// 对方开户行
        /// </summary>
        public string OtherBankName { get; set; }
        /// <summary>
        /// 对方银行账号
        /// </summary>
        public string OtherSideNo { get; set; }
        /// <summary>
        /// 对方姓名
        /// </summary>
        public string OtherSideName
        {
            get; set;
        }

        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 团组外键编号
        /// </summary>
        public int DiId { get; set; }

        /// <summary>
        /// 供应商地区
        ///  1 国内(默认) 2 国外
        /// </summary>
        public int SupplierArea { get; set; } = 1;

        /// <summary>
        /// 供应商类型
        /// </summary>
        public int SupplierTypeId { get; set; } = 0;

        /// <summary>
        /// 供应商名称
        /// </summary>
        public string SupplierName { get; set; }

        /// <summary>
        /// 供应商联系人
        /// </summary>
        public string SupplierContact { get; set; }

        /// <summary>
        /// 供应商联系电话
        /// </summary>
        public string SupplierContactNumber { get; set; }

        /// <summary>
        /// 供应商社交账号
        /// </summary>
        public string SupplierSocialAccount { get; set; }

        /// <summary>
        /// 供应商邮箱
        /// </summary>
        public string SupplierEmail { get; set; }

        /// <summary>
        /// 供应商地址
        /// </summary>
        public string SupplierAddress { get; set; }


        /// <summary>
        /// 费用名称
        /// </summary>
        public string PriceName { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        public decimal Price { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public decimal Quantity { get; set; }

        /// <summary>
        /// 费用总计
        /// </summary>
        public decimal FeeTotal { get; set; }

        /// <summary>
        /// 费用币种
        /// </summary>
        public int Currency { get; set; }
        /// <summary>
        /// 附件地址
        /// </summary>
        public string FilePath { get; set; }
        /// <summary>
        /// 创建者Id
        /// </summary>
        public int CreateUserId { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// OTA订单号NO
        /// </summary>
        public string OTAOrderNo { get; set; }

        /// <summary>
        /// 是否为选择的费用
        /// </summary>
        public int IsSelect { get; set; } 
    }
    public class DecreasePaymentsByIdDto
    {
        public int Id { get; set; }
    }

    public class DelFileDto
    {
        public string fileName { get; set; }

        public int Id { get; set; }
    }

    public class AssociateSupplierDto
    {
        public string param { get; set; }
    }

    public class ProductComparer : IEqualityComparer<Grp_DecreasePayments>
    {
        public bool Equals(Grp_DecreasePayments x, Grp_DecreasePayments y)
        {
            if (Object.ReferenceEquals(x,y))
            {
                return true;
            }

            var xStr = 
                x.SupplierAddress +
                x.SupplierArea +
                x.SupplierContact +
                x.SupplierContactNumber +
                x.SupplierEmail +
                x.SupplierName +
                x.SupplierSocialAccount +
                x.SupplierTypeId;

            var yStr =
                y.SupplierAddress +
                y.SupplierArea +
                y.SupplierContact +
                y.SupplierContactNumber +
                y.SupplierEmail +
                y.SupplierName +
                y.SupplierSocialAccount +
                y.SupplierTypeId;

            if (xStr == yStr)
            {
                return true;
            }

            return false;
        }

        public int GetHashCode([DisallowNull] Grp_DecreasePayments product)
        {
            return 0;
        }
    }
}