using System.Collections.Generic;

namespace RevitEstimate.PlumbingModule
{
    public class FixtureConfig
    {
        public string FixtureName { get; set; }
        public double HeightFromFFL { get; set; }
    }

    public class RoomFixtureData
    {
        public string LevelName { get; set; }
        public int FlatNumber { get; set; }
        public string FlatHeader => $"Flat - {FlatNumber} ({LevelName})";

        public bool IsFlatEnabled { get; set; } = true;
        public string RoomTag { get; set; }
        public string RoomName { get; set; }
        public string ZoneType { get; set; }
        public int SortOrder { get; set; }
        public bool IsRoomActive { get; set; }

        public double FloorElevation { get; set; }
        public double RoomPerimeter { get; set; }
        public double RoomArea { get; set; }
        public double TankElevation { get; set; }
        public double LintelElevation => FloorElevation + 2.1;
        public double RoomCenterX { get; set; }
        public double RoomCenterY { get; set; }

        public int WashBasinQty { get; set; }
        public int HealthFaucetQty { get; set; }
        public int GeyserQty { get; set; }
        public int KitchenSinkQty { get; set; }
        public int ShowerQty { get; set; }
        public int WaterClosetQty { get; set; }
        public int WashingMachineQty { get; set; }
        public int UrinalQty { get; set; }
        public int WaterPurifierQty { get; set; }
        public int WaterCoolerQty { get; set; }

        public int AutoAngleCockQty => (IsFlatEnabled && IsRoomActive) ? (WashBasinQty * 2) + (GeyserQty * 2) + (HealthFaucetQty * 1) + (WaterClosetQty * 1) : 0;
        public int AutoLongBodyQty => (IsFlatEnabled && IsRoomActive) ? (KitchenSinkQty * 1) + (ShowerQty * 1) : 0;
        public int AutoBibCockQty => (IsFlatEnabled && IsRoomActive) ? (WashingMachineQty * 1) : 0;
        public int AutoBottleTrapQty => (IsFlatEnabled && IsRoomActive) ? WashBasinQty : 0;
    }

    public class DsrEstimateItem
    {
        public string CategoryGroup { get; set; }
        public string SrNo { get; set; }
        public string DsrCode { get; set; }
        public string Description { get; set; }
        public string Unit { get; set; }
        public double Qty { get; set; }
        public double Rate { get; set; }
        public double Amount => Qty * Rate;
        public string Remark { get; set; }
    }

    public class BimElementQuantity
    {
        public string Category { get; set; }
        public string FamilyName { get; set; }
        public string TypeName { get; set; }
        public string SystemType { get; set; }
        public double Quantity { get; set; }
        public string Unit { get; set; }
        public string Level { get; set; }
    }

    public class PipeSelectionConfig
    {
        public string WS_DistMat { get; set; }
        public string WS_DistDia { get; set; }
        public string WS_BranchMat { get; set; }
        public string WS_BranchDia { get; set; }
        public string WS_MainMat { get; set; }
        public string WS_MainDia { get; set; }

        public string San_DistMat { get; set; }
        public string San_DistDia { get; set; }
        public string San_BranchMat { get; set; }
        public string San_BranchDia { get; set; }
        public string San_MainMat { get; set; }
        public string San_MainDia { get; set; }

        public string WW_DistMat { get; set; }
        public string WW_DistDia { get; set; }
        public string WW_BranchMat { get; set; }
        public string WW_BranchDia { get; set; }
        public string WW_MainMat { get; set; }
        public string WW_MainDia { get; set; }

        public string RW_DistMat { get; set; }
        public string RW_DistDia { get; set; }
        public string RW_BranchMat { get; set; }
        public string RW_BranchDia { get; set; }
        public string RW_MainMat { get; set; }
        public string RW_MainDia { get; set; }
    }
}