using System;
using System.Collections.Generic;
using System.Linq;

namespace RevitEstimate.PlumbingModule
{
    public class DsrPipeInfo
    {
        public string Code { get; set; }
        public double Rate { get; set; }
        public string Desc { get; set; }
    }

    public static class PlumbingDsrCalculator
    {
        private static Dictionary<string, DsrPipeInfo> PipeDatabase = new Dictionary<string, DsrPipeInfo>
        {
            { "CPVC-15 mm", new DsrPipeInfo { Code = "18.7.1", Rate = 275.00, Desc = "Providing and fixing Chlorinated Polyvinyl Chloride (CPVC) pipes... 15 mm nominal bore" } },
            { "CPVC-20 mm", new DsrPipeInfo { Code = "18.7.2", Rate = 335.00, Desc = "Providing and fixing Chlorinated Polyvinyl Chloride (CPVC) pipes... 20 mm nominal bore" } },
            { "CPVC-25 mm", new DsrPipeInfo { Code = "18.7.3", Rate = 401.55, Desc = "Providing and fixing Chlorinated Polyvinyl Chloride (CPVC) pipes... 25 mm nominal bore" } },
            { "CPVC-32 mm", new DsrPipeInfo { Code = "18.7.4", Rate = 518.75, Desc = "Providing and fixing Chlorinated Polyvinyl Chloride (CPVC) pipes... 32 mm nominal bore" } },
            { "CPVC-40 mm", new DsrPipeInfo { Code = "18.7.5", Rate = 702.95, Desc = "Providing and fixing Chlorinated Polyvinyl Chloride (CPVC) pipes... 40 mm nominal bore" } },
            { "CPVC-50 mm", new DsrPipeInfo { Code = "18.7.6", Rate = 950.00, Desc = "Providing and fixing Chlorinated Polyvinyl Chloride (CPVC) pipes... 50 mm nominal bore" } },
            { "GI-15 mm", new DsrPipeInfo { Code = "18.10.1", Rate = 380.00, Desc = "Providing and fixing GI pipes complete with GI fittings 15 mm nominal bore" } },
            { "GI-20 mm", new DsrPipeInfo { Code = "18.10.2", Rate = 437.30, Desc = "Providing and fixing GI pipes complete with GI fittings 20 mm nominal bore" } },
            { "GI-25 mm", new DsrPipeInfo { Code = "18.10.3", Rate = 551.70, Desc = "Providing and fixing GI pipes complete with GI fittings 25 mm nominal bore" } },
            { "GI-32 mm", new DsrPipeInfo { Code = "18.10.4", Rate = 667.00, Desc = "Providing and fixing GI pipes complete with GI fittings 32 mm nominal bore" } },
            { "GI-40 mm", new DsrPipeInfo { Code = "18.10.5", Rate = 811.90, Desc = "Providing and fixing GI pipes complete with GI fittings 40 mm nominal bore" } },
            { "GI-50 mm", new DsrPipeInfo { Code = "18.10.6", Rate = 1048.35, Desc = "Providing and fixing GI pipes complete with GI fittings 50 mm nominal bore" } },
            { "GI-65 mm", new DsrPipeInfo { Code = "A.R.", Rate = 1145.00, Desc = "Providing and fixing GI pipes complete with GI fittings 65 mm nominal bore" } },
            { "GI-80 mm", new DsrPipeInfo { Code = "A.R.", Rate = 1310.00, Desc = "Providing and fixing GI pipes complete with GI fittings 80 mm nominal bore" } }
        };

        private static DsrPipeInfo GetPipeInfo(string material, string dia)
        {
            string key = $"{material}-{dia}";
            if (PipeDatabase.ContainsKey(key)) return PipeDatabase[key];
            else return new DsrPipeInfo { Code = "NSR", Rate = 450.00, Desc = $"Providing {material} pipes ({dia})" };
        }

        public static List<DsrEstimateItem> GenerateEstimate(List<RoomFixtureData> activeRooms, PipeSelectionConfig pipes)
        {
            var dsrItems = new List<DsrEstimateItem>();

            int wcs = activeRooms.Sum(r => r.WaterClosetQty);
            int hf = activeRooms.Sum(r => r.HealthFaucetQty);
            int ks = activeRooms.Sum(r => r.KitchenSinkQty);
            int shwr = activeRooms.Sum(r => r.ShowerQty);
            int angleCocks = activeRooms.Sum(r => r.AutoAngleCockQty);
            int longBody = activeRooms.Sum(r => r.AutoLongBodyQty);
            int bibCock = activeRooms.Sum(r => r.AutoBibCockQty);

            int smallBasins = activeRooms.Where(r => r.RoomName.ToLower().Contains("powder")).Sum(r => r.WashBasinQty);
            int totalBasins = activeRooms.Sum(r => r.WashBasinQty);
            int bigBasins = totalBasins - smallBasins;
            int activeFlatCount = activeRooms.Select(r => r.FlatNumber).Distinct().Count();

            // GROUP 1: FIXTURES (Remains unchanged)
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "1", DsrCode = "17.1.1", Description = "Indian type W.C. pan...", Unit = "Each", Qty = 0, Rate = 6767.40, Remark = "Disabled (Wall Mounted used)" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "2", DsrCode = "17.2.1", Description = "Pedestal type water closet...", Unit = "Each", Qty = 0, Rate = 6515.55, Remark = "Disabled (Wall Mounted used)" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "3", DsrCode = "17.78", Description = "Wall mounting type water closet 780x370x690 mm...", Unit = "Each", Qty = wcs, Rate = 14999.15, Remark = "Total WCs" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "4", DsrCode = "17.34", Description = "Providing & fixing toilet paper holder", Unit = "Each", Qty = 0, Rate = 0.00, Remark = "Heading Only" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "5", DsrCode = "17.34.1", Description = "C.P. brass (Toilet Paper Holder)", Unit = "Each", Qty = wcs, Rate = 803.70, Remark = "1 per WC" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "6", DsrCode = "17.16A", Description = "C.P. / S.S. Jet with flexible tube...", Unit = "Each", Qty = wcs, Rate = 349.15, Remark = "1 per WC" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "7", DsrCode = "NSR", Description = "Jaquar Make Hand Shower (Health Faucet)...", Unit = "Each", Qty = hf, Rate = 0.00, Remark = "Total Health Faucets" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "8", DsrCode = "17.7.2", Description = "Wash basin... Size 630x450 mm", Unit = "Each", Qty = bigBasins, Rate = 2226.35, Remark = "Basins minus Powder Room" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "9", DsrCode = "17.7A", Description = "Wash basin... Size 550x400 mm", Unit = "Each", Qty = smallBasins, Rate = 3960.55, Remark = "Only in Powder Rooms" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "10", DsrCode = "17.22A", Description = "CP Brass 32mm size Bottle Trap", Unit = "Each", Qty = totalBasins, Rate = 1034.80, Remark = "1 per Basin" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "11", DsrCode = "17.71", Description = "PTMT liquid soap container", Unit = "Each", Qty = totalBasins, Rate = 168.35, Remark = "1 per Basin" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "12", DsrCode = "17.72", Description = "PTMT towel ring", Unit = "Each", Qty = totalBasins, Rate = 231.95, Remark = "1 per Basin" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "13", DsrCode = "17.31", Description = "600x450 mm beveled edge mirror", Unit = "Each", Qty = totalBasins, Rate = 1607.95, Remark = "1 per Basin" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "14", DsrCode = "18.53.1", Description = "C.P. brass angle valve 15 mm", Unit = "Each", Qty = angleCocks, Rate = 574.30, Remark = "Auto calculated" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "15", DsrCode = "18.21.2.2", Description = "PVC connection pipe : 45 cm", Unit = "Each", Qty = 0, Rate = 0.00, Remark = "Standard length used instead" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "16", DsrCode = "18.21.2.1", Description = "PVC connection pipe : 15 mm", Unit = "Each", Qty = angleCocks, Rate = 97.75, Remark = "Same as Angle Valves" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "17", DsrCode = "18.22.1", Description = "C.P. brass shower rose : 100 mm dia", Unit = "Each", Qty = shwr, Rate = 193.95, Remark = "1 per Shower" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "18", DsrCode = "18.52.1", Description = "C.P. brass stop cock (concealed)", Unit = "Each", Qty = shwr, Rate = 670.45, Remark = "1 per Shower" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "19", DsrCode = "(a)", Description = "Single lever telephonic wall mixer", Unit = "Each", Qty = shwr, Rate = 6940.75, Remark = "1 per Shower" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "20", DsrCode = "17.73.2", Description = "PTMT towel rail 600 mm", Unit = "Each", Qty = shwr, Rate = 708.95, Remark = "1 per Shower Area" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "21", DsrCode = "18.65", Description = "PTMT soap Dish Holder", Unit = "Each", Qty = shwr, Rate = 111.45, Remark = "1 per Shower Area" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "22", DsrCode = "17.10.1.3", Description = "Stainless Steel kitchen sink 510x1040 mm", Unit = "Each", Qty = ks, Rate = 7159.00, Remark = "Total Kitchen Sinks" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "23", DsrCode = "17.28.2", Description = "PVC waste pipe for sink", Unit = "Each", Qty = ks, Rate = 119.55, Remark = "1 per Kitchen Sink" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "24", DsrCode = "18.49.1", Description = "C.P. brass bib cock 15mm", Unit = "Each", Qty = bibCock, Rate = 506.80, Remark = "Total Bib Cocks" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "25", DsrCode = "18.51.1", Description = "C.P. brass long body bib cock 15mm", Unit = "Each", Qty = longBody, Rate = 798.95, Remark = "Kitchen & Shower taps" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "1. Fixtures", SrNo = "26", DsrCode = "17.80", Description = "C.P. Brass extension nipple", Unit = "Each", Qty = angleCocks, Rate = 74.80, Remark = "Same as Angle Valves" });

            // GROUP 2: WATER SUPPLY (LOGICAL HORIZONTAL UPDATE)
            double totalMainLength = 0; double totalBranchLength = 0; double totalDistLength = 0;
            foreach (var room in activeRooms)
            {
                double riserLength = Math.Abs(room.TankElevation - room.LintelElevation);
                totalMainLength += riserLength > 0 ? riserLength : 3.0; // Main vertical drops

                // Reasonable Horizontal Branch from duct/shaft to bathroom entry
                totalBranchLength += 2.5;

                // Realistic distribution inside the room (approx 40% of perimeter for wet rooms, 20% for kitchens/powder)
                double baseDistLength = room.ZoneType == "Wet Room" ? (room.RoomPerimeter * 0.40) : (room.RoomPerimeter * 0.20);

                double drops = 0;
                drops += room.WashBasinQty * (2.1 - 0.60);
                drops += room.HealthFaucetQty * (2.1 - 0.38);
                drops += room.ShowerQty * (2.1 - 2.00);
                drops += room.KitchenSinkQty * (2.1 - 0.90);
                totalDistLength += (baseDistLength + drops);
            }
            var distPipe = GetPipeInfo(pipes.WS_DistMat, pipes.WS_DistDia);
            var branchPipe = GetPipeInfo(pipes.WS_BranchMat, pipes.WS_BranchDia);
            var mainPipe = GetPipeInfo(pipes.WS_MainMat, pipes.WS_MainDia);

            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "2. Water Supply", SrNo = "27", DsrCode = "18.48", Description = "Polyethylene water storage tank", Unit = "Each", Qty = activeFlatCount, Rate = 11000.00, Remark = "1 Tank per Active Flat" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "2. Water Supply", SrNo = "28", DsrCode = distPipe.Code, Description = distPipe.Desc, Unit = "Metre", Qty = totalDistLength, Rate = distPipe.Rate, Remark = "Logical perimeter & fixture drops" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "2. Water Supply", SrNo = "29", DsrCode = branchPipe.Code, Description = branchPipe.Desc, Unit = "Metre", Qty = totalBranchLength, Rate = branchPipe.Rate, Remark = "Duct to Room Branch (2.5m/room)" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "2. Water Supply", SrNo = "30", DsrCode = mainPipe.Code, Description = mainPipe.Desc, Unit = "Metre", Qty = totalMainLength, Rate = mainPipe.Rate, Remark = "Tank Elev to Room Lintel" });

            // =========================================================
            // GROUP 3: SANITARY (LOGICAL HORIZONTAL UPDATE)
            // =========================================================
            double totalSanMainLength = 0; double totalSanBranchLength = 0;
            if (activeRooms.Count > 0)
            {
                var wcRooms = activeRooms.Where(r => r.WaterClosetQty > 0).ToList();
                double plinthElev = activeRooms.Min(r => r.FloorElevation);

                foreach (var room in wcRooms)
                {
                    // Vertical Stack
                    double vert = Math.Abs(room.FloorElevation - plinthElev);
                    totalSanMainLength += (vert < 1.0 ? 1.0 : vert) * room.WaterClosetQty;

                    // Logical Horizontal: 2.0m from WC to adjacent shaft + 2.0m as share for ground collection to manhole
                    totalSanBranchLength += (2.0 * room.WaterClosetQty) + 2.0;
                }
            }
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "3. Sanitary", SrNo = "31", DsrCode = "17.35.1", Description = $"Sanitary Main Vertical Soil Pipe {pipes.San_MainMat} ({pipes.San_MainDia})", Unit = "Metre", Qty = totalSanMainLength, Rate = 950.00, Remark = $"{wcs} Stacks: WC Level to Plinth Level" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "3. Sanitary", SrNo = "32", DsrCode = "17.35.2", Description = $"Sanitary Horizontal Branch {pipes.San_BranchMat} ({pipes.San_BranchDia})", Unit = "Metre", Qty = totalSanBranchLength, Rate = 720.00, Remark = "WC to Shaft + Ground Manhole share" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "3. Sanitary", SrNo = "33", DsrCode = "17.43.1.2", Description = $"Providing and fixing {pipes.San_MainMat} plain bend/door bend", Unit = "Each", Qty = wcs * 2, Rate = 350.00, Remark = "2 Bends per WC" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "3. Sanitary", SrNo = "34", DsrCode = "17.44.1.2", Description = $"Providing and fixing {pipes.San_MainMat} door tee/single tee", Unit = "Each", Qty = wcs, Rate = 420.00, Remark = "1 Tee per WC" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "3. Sanitary", SrNo = "35", DsrCode = "NSR", Description = "PVC Vent Cowl / Terminal Guard for top of Soil Pipe", Unit = "Each", Qty = wcs, Rate = 150.00, Remark = "Top of each WC Stack" });

            // =========================================================
            // GROUP 4: WASTE WATER (LOGICAL HORIZONTAL UPDATE)
            // =========================================================
            double totalWWMainLength = 0; double totalWWBranchLength = 0;
            int wetRoomCount = 0; int semiWetRoomCount = 0;
            if (activeRooms.Count > 0)
            {
                var wetRooms = activeRooms.Where(r => r.ZoneType == "Wet Room").ToList();
                var semiWetRooms = activeRooms.Where(r => r.ZoneType == "Semi-Wet / Open").ToList();
                wetRoomCount = wetRooms.Count; semiWetRoomCount = semiWetRooms.Count;
                double plinthElev = activeRooms.Min(r => r.FloorElevation);

                foreach (var room in wetRooms)
                {
                    double vert = Math.Abs(room.FloorElevation - plinthElev);
                    totalWWMainLength += vert < 1.0 ? 1.0 : vert;

                    // Fixed reasonable distance from Floor Trap to adjacent Shaft
                    totalWWBranchLength += 2.5;
                }

                foreach (var swRoom in semiWetRooms)
                {
                    if (wetRooms.Count > 0)
                    {
                        double minDist = double.MaxValue;
                        foreach (var wRoom in wetRooms)
                        {
                            // CRITICAL FIX: Only measure distance to a wet room on the SAME FLOOR
                            if (Math.Abs(swRoom.FloorElevation - wRoom.FloorElevation) < 0.1)
                            {
                                double dist = Math.Sqrt(Math.Pow(swRoom.RoomCenterX - wRoom.RoomCenterX, 2) + Math.Pow(swRoom.RoomCenterY - wRoom.RoomCenterY, 2));
                                if (dist < minDist) minDist = dist;
                            }
                        }
                        if (minDist == double.MaxValue) minDist = 3.0; // Fallback if no wet room on same floor
                        totalWWBranchLength += (minDist * 1.2); // 20% extra for pipe routing bends
                    }
                    else
                    {
                        totalWWBranchLength += 3.0;
                    }
                }
            }
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "4. Waste Water", SrNo = "36", DsrCode = "17.60", Description = "Providing and fixing Floor Trap (Jali Trap) with C.P. grating", Unit = "Each", Qty = wetRoomCount + semiWetRoomCount, Rate = 650.00, Remark = "1 per Wet & Semi-Wet Room" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "4. Waste Water", SrNo = "37", DsrCode = "17.35.1", Description = $"Waste Water Vertical Pipe {pipes.WW_MainMat} ({pipes.WW_MainDia})", Unit = "Metre", Qty = totalWWMainLength, Rate = 950.00, Remark = "Wet Room to Plinth Drop" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "4. Waste Water", SrNo = "38", DsrCode = "17.35.2", Description = $"Waste Water Horizontal Branch {pipes.WW_BranchMat} ({pipes.WW_BranchDia})", Unit = "Metre", Qty = totalWWBranchLength, Rate = 720.00, Remark = "Floor Trap to Shaft / Kitchen to Bath" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "4. Waste Water", SrNo = "39", DsrCode = "17.43.1.2", Description = $"Providing and fixing {pipes.WW_MainMat} plain bend/door bend", Unit = "Each", Qty = wetRoomCount * 2, Rate = 350.00, Remark = "2 Bends per Waste Stack" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "4. Waste Water", SrNo = "40", DsrCode = "17.44.1.2", Description = $"Providing and fixing {pipes.WW_MainMat} door tee/single tee", Unit = "Each", Qty = wetRoomCount, Rate = 420.00, Remark = "1 Tee per Waste Stack" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "4. Waste Water", SrNo = "41", DsrCode = "NSR", Description = "PVC Vent Cowl / Terminal Guard for top of Waste Pipe", Unit = "Each", Qty = wetRoomCount, Rate = 150.00, Remark = "Top of each Waste Stack" });

            // GROUP 5: RAIN WATER (Remains unchanged)
            double totalRwMainLength = 0; double totalRwBranchLength = 0;
            int mumtyPipesCount = 1; int mainPipesCount = 6;

            if (activeRooms.Count > 0)
            {
                var levelGroups = activeRooms.GroupBy(r => new { r.LevelName, r.FloorElevation }).OrderByDescending(g => g.Key.FloorElevation).ToList();

                if (levelGroups.Count > 0)
                {
                    double plinthElev = levelGroups.Last().Key.FloorElevation;
                    var topGroup = levelGroups.First();
                    double topLevelArea = topGroup.Sum(r => r.RoomArea);
                    if (topLevelArea <= 0) topLevelArea = 41.0;
                    mumtyPipesCount = (int)Math.Ceiling(topLevelArea / 100.0);
                    if (mumtyPipesCount < 1) mumtyPipesCount = 1;

                    double mainRoofArea = 541.0;
                    double topSlabElev = topGroup.Key.FloorElevation;
                    double belowSlabElev = topSlabElev;

                    if (levelGroups.Count > 1)
                    {
                        var belowGroup = levelGroups[1];
                        mainRoofArea = belowGroup.Sum(r => r.RoomArea);
                        if (mainRoofArea <= 0) mainRoofArea = 541.0;
                        belowSlabElev = belowGroup.Key.FloorElevation;
                    }

                    mainPipesCount = (int)Math.Ceiling(mainRoofArea / 100.0);
                    if (mainPipesCount < 1) mainPipesCount = 1;

                    double branchHeight = Math.Abs(topSlabElev - belowSlabElev);
                    if (branchHeight < 1.0) branchHeight = 2.50;
                    totalRwBranchLength = mumtyPipesCount * branchHeight;

                    double mainHeight = Math.Abs(belowSlabElev - plinthElev);
                    if (mainHeight < 1.0) mainHeight = 3.00;
                    totalRwMainLength = mainPipesCount * mainHeight;
                }
            }

            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "5. Rain Water", SrNo = "42", DsrCode = "17.36.1", Description = $"Rain Water Main Vertical Pipe {pipes.RW_MainMat} ({pipes.RW_MainDia})", Unit = "Metre", Qty = totalRwMainLength, Rate = 1050.00, Remark = $"{mainPipesCount} Pipes (Top Slab to Plinth)" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "5. Rain Water", SrNo = "43", DsrCode = "17.36.2", Description = $"Rain Water Branch Pipe {pipes.RW_BranchMat} ({pipes.RW_BranchDia})", Unit = "Metre", Qty = totalRwBranchLength, Rate = 850.00, Remark = $"{mumtyPipesCount} Pipe (Mumty to Top Slab)" });
            dsrItems.Add(new DsrEstimateItem { CategoryGroup = "5. Rain Water", SrNo = "44", DsrCode = "NSR", Description = "Rain water outlet cowls / heads", Unit = "Each", Qty = (mumtyPipesCount + mainPipesCount) * 2, Rate = 450.00, Remark = "For Mumty & Roof Slabs" });

            return dsrItems;
        }
    }
}