using System; using System.Collections.Generic; using System.Linq; namespace ODCWeb.Models.ViewModels { public class ProjectSummaryyViewModel { public ODCProject Project { get; set; } public List Floors { get; set; } public List Actions { get; set; } public List Tasks { get; set; } // Statistics public int TotalFloors { get; set; } public int TotalActions { get; set; } public int TotalTasks { get; set; } // Financial Summary public double TotalMaterialCost { get; set; } public double TotalLaborCost { get; set; } public double TotalProjectedBudget { get; set; } // Modified Budget public double TotalModifiedLaborCost { get; set; } public double TotalModifiedMaterialCost { get; set; } public double TotalModifiedBudget { get; set; } // Actual Costs public double TotalActualLaborCost { get; set; } public double TotalActualMaterialCost { get; set; } public double TotalBudgetLeft { get; set; } public double TotalProfitLoss { get; set; } // Completion Statistics public double AverageCompletion { get; set; } public int CompletedTasks { get; set; } public int InProgressTasks { get; set; } public int NotStartedTasks { get; set; } // Date Information public DateOnly? EarliestStartDate { get; set; } public DateOnly? LatestEndDate { get; set; } // Calculated Properties public int TotalProjectDuration { get { if (EarliestStartDate.HasValue && LatestEndDate.HasValue) { return LatestEndDate.Value.DayNumber - EarliestStartDate.Value.DayNumber; } return 0; } } public double CompletionPercentage => AverageCompletion; public string ProjectStatus { get { if (AverageCompletion >= 100) return "Completed"; if (AverageCompletion > 0) return "In Progress"; return "Not Started"; } } public double BudgetVariance => TotalModifiedBudget - TotalProjectedBudget; public double ActualVariance => TotalActualLaborCost + TotalActualMaterialCost - TotalModifiedBudget; } }