using FluentValidation;
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Text;

namespace Performance.DtoModels
{
    public class ComputerRequest
    {
        /// <summary>
        /// 绩效数据id
        /// </summary>
        public int ComputeId { get; set; }

        /// <summary>
        /// 实发绩效
        /// </summary>
        public decimal? RealGiveFee { get; set; }

        /// <summary>
        /// 绩效id
        /// </summary>
        public int AllotId { get; set; }

        /// <summary>
        /// 绩效基数核算参考对象
        /// </summary>
        public int Type { get; set; }

    }
    public class ComputerRequestValidator : AbstractValidator<ComputerRequest>
    {
        public ComputerRequestValidator()
        {
            RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
            RuleSet("Select", () =>
            {
                RuleFor(x => x.Type).NotNull().NotEmpty();
            });

            RuleSet("UpdateReal", () =>
            {
                RuleFor(x => x.ComputeId).NotNull().GreaterThan(0);
                RuleFor(x => x.RealGiveFee).NotNull();
            });
        }
    }

    public class ComputerAliasRequest
    {
        public int HospitalId { get; set; }
        public string Route { get; set; }
        public string[] Heads { get; set; }
    }

    public class ComputerAliasUpdate
    {
        public int HospitalId { get; set; }
        public string Route { get; set; }
        public List<ComputerAliasHead> computerAliasHead { get; set; }
    }
    public class ComputerAliasHead
    {
        public string Head { get; set; }
        public int HeadId { get; set; }
    }

    public class BeginEndTime
    {
        public string BeginTime { get; set; }  // 2021-01
        public string EndTime { get; set; } // 2021-08
        public int HospitalId { get; set; }
        public List<TitleValue> Search { get; set; }
        public string SortBy { get; set; }
        public int CurrentPage { get; set; } = 0;
        public int PageSize { get; set; } = 0;
    }

    public class HospitalGrantSummary : BeginEndTime
    {
        public List<string> GroupBy { get; set; }
        public List<string> SumBy { get; set; }
    }

    public class HospitalGrantSummaryDown : HospitalGrantSummary
    {
        public string[] heads { get; set; }
    }

    public class QueryComputeByDateGetPage : GetPage
    {
        public List<dynamic> Data { get; set; }
        public Dictionary<string, decimal> TotalData { get; set; }

    }

    public class GetPage
    {
        public int CurrentPage { get; set; }
        public int TotalPages { get; set; }
        public int PageSize { get; set; }
        public int TotalCount { get; set; }
    }

}

