Skip to content

Conversation

@MWG-Logan
Copy link
Owner

@MWG-Logan MWG-Logan commented Oct 29, 2025

This pull request introduces several important updates to the project reporting API, most notably adding PDF report generation support and refactoring DTOs into a shared project. Additionally, it updates dependencies and project configuration for .NET 10 and newer package versions.

Key changes:

Feature Additions:

  • Added a new POST endpoint (GenerateProjectCompletionReportPdf) in ProjectCompletionReportFunction.cs to generate a project completion report as a PDF using the QuestPDF library. This endpoint accepts a full report payload and returns a downloadable PDF file.
  • Implemented helper methods for rendering report sections (summary, timeline, budget, AI summary, phases, tickets) into the PDF document.

Project Structure and DTO Refactoring:

  • Removed the DTO classes ProjectCompletionReportRequest and ProjectCompletionReportResponse (and related types) from the API project, and updated code to use shared DTOs from the new Bezalu.ProjectReporting.Shared project. [1] [2] [3]
  • Added a project reference to Bezalu.ProjectReporting.Shared in the API project and created a DTOs folder for organizational purposes.

Dependency and Framework Updates:

  • Upgraded the target framework from .NET 9.0 to .NET 10.0 in the API project file.
  • Updated several NuGet package versions, including Microsoft.Azure.Functions.Worker, Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore, and Newtonsoft.Json. Added the QuestPDF package for PDF generation.

API Improvements:

  • Improved request validation in ProjectCompletionReportFunction.cs using pattern matching for null and value checks.

These changes collectively enhance the API's capabilities, modernize dependencies, and improve maintainability by centralizing DTO definitions.


References:
[1] [2] [3] [4] [5] [6] [7]

dependabot bot and others added 4 commits October 29, 2025 15:34
… to 9.0.10 (#5)

---
updated-dependencies:
- dependency-name: Microsoft.AspNetCore.Components.WebAssembly.DevServer
  dependency-version: 9.0.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…preview2 (#6)

---
updated-dependencies:
- dependency-name: Microsoft.Azure.Functions.Worker
  dependency-version: 2.50.0-preview2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… 2.0.2 to 2.1.0 (#7)

---
updated-dependencies:
- dependency-name: Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Upgrade to .NET 10.0 and modernize project structure

Upgraded the solution to .NET 10.0, introducing a shared project
for DTOs to improve code reuse. Integrated QuestPDF for server-side
PDF generation and Fluent UI for a modernized Blazor WebAssembly
UI. Enabled optimizations for Azure Static Web Apps, including
trimming and AOT compilation. Redesigned the project reporting
UI with improved error handling and loading indicators.

Removed legacy code, updated dependencies (e.g., Newtonsoft.Json
to 13.0.4), and streamlined service worker logic. Enhanced
responsiveness, accessibility, and maintainability across the
solution. Updated launch settings and assets for a polished
developer and user experience.

* Switch to POST for PDF generation; improve downloads

Updated ProjectCompletionReportFunction to use POST, accepting
the full report payload for PDF generation. Integrated QuestPDF
library for robust PDF creation. Simplified error handling and
adjusted logic to work with deserialized report data.

Enhanced Home.razor to use POST and replaced inline PDF view
with a JavaScript-based file download mechanism. Added a new
`fileSave.js` utility for handling downloads. Updated index.html
to include the new script. Improved user experience for PDF
downloads.

* Refactor documentation and improve solution clarity

Updated README to reflect broader solution scope, emphasizing components, API flow, and extensibility. Added detailed documentation files (`architecture.md`, `contract.md`, `deployment.md`, `frontend.md`, `pdf.md`) covering structure, deployment, and implementation.

Enhanced clarity on local development, Azure deployment, and security best practices. Highlighted the use of DTOs, QuestPDF, and Markdig for consistency and efficiency. Improved error handling, performance notes, and future extensibility options.

---------

Co-authored-by: Logan Cook <[email protected]>
@MWG-Logan MWG-Logan marked this pull request as ready for review October 31, 2025 21:17
Copilot AI review requested due to automatic review settings October 31, 2025 21:17
@MWG-Logan MWG-Logan merged commit 1d4a8cd into main Oct 31, 2025
10 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the project reporting solution to use a shared DTO library, integrates FluentUI components for the Blazor front-end, adds server-side PDF generation using QuestPDF, and upgrades to .NET 10. The changes eliminate duplication between front-end and API projects while introducing a new PDF download feature that reuses existing report data.

  • Consolidated DTOs into a shared project referenced by both API and Web
  • Replaced custom HTML/CSS UI with Microsoft FluentUI components
  • Added PDF generation endpoint that accepts pre-fetched report data to avoid re-computation
  • Upgraded from .NET 9 to .NET 10 with preview packages

Reviewed Changes

Copilot reviewed 31 out of 33 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Bezalu.ProjectReporting.Shared/* New shared project containing DTO contracts used by both API and Web
Bezalu.ProjectReporting.Web/Bezalu.ProjectReporting.Web.csproj Updated to .NET 10 with AOT compilation, added FluentUI packages, references shared DTOs
Bezalu.ProjectReporting.API/Bezalu.ProjectReporting.API.csproj Updated to .NET 10, added QuestPDF, references shared DTOs
Bezalu.ProjectReporting.API/Functions/ProjectCompletionReportFunction.cs Added PDF generation function with QuestPDF layout logic
Bezalu.ProjectReporting.Web/Pages/Home.razor Replaced Bootstrap UI with FluentUI components, added PDF download functionality
Bezalu.ProjectReporting.Web/wwwroot/js/fileSave.js New JavaScript helper for browser file downloads
docs/* Added comprehensive documentation for architecture, configuration, contracts, deployment, front-end, and PDF generation
Bezalu.ProjectReporting.{API,Web}/DTOs/* Removed duplicate DTO files in favor of shared project

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants