From d9492e763a4ee8a621ef54484440284024146760 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Tue, 10 Mar 2026 13:15:28 +0000 Subject: [PATCH 1/2] Make date range dynamic in query; improve test assertions Updated ReportingManager to use request-supplied start and end dates for grand total amount queries instead of hardcoded values. Enhanced TransactionsEndpointTests by asserting that PercentageOfTotal is non-zero, ensuring more robust test coverage. --- EstateReportingAPI.BusinessLogic/ReportingManager.cs | 2 +- .../TransactionsEndpointTests.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/EstateReportingAPI.BusinessLogic/ReportingManager.cs b/EstateReportingAPI.BusinessLogic/ReportingManager.cs index 0ff7b0e..0cfcca3 100644 --- a/EstateReportingAPI.BusinessLogic/ReportingManager.cs +++ b/EstateReportingAPI.BusinessLogic/ReportingManager.cs @@ -1157,7 +1157,7 @@ public async Task> GetProductPerformanceRepor using ResolvedDbContext? resolvedContext = this.Resolver.Resolve(EstateManagementDatabaseName, request.EstateId.ToString()); await using EstateManagementContext context = resolvedContext.Context; - var grandTotalAmountQuery = (from t in context.Transactions where t.TransactionType == "Sale" && t.TransactionDate >= new DateTime(2025, 12, 21) && t.TransactionDate <= new DateTime(2025, 12, 25) select t.TransactionAmount); + var grandTotalAmountQuery = (from t in context.Transactions where t.TransactionType == "Sale" && t.TransactionDate >= request.StartDate && t.TransactionDate <= request.EndDate select t.TransactionAmount); var grandTotalAmountResult = await ExecuteQuerySafeSum(grandTotalAmountQuery, cancellationToken); if (grandTotalAmountResult.IsFailed) return ResultHelpers.CreateFailure(grandTotalAmountResult); diff --git a/EstateReportingAPI.IntegrationTests/TransactionsEndpointTests.cs b/EstateReportingAPI.IntegrationTests/TransactionsEndpointTests.cs index 914a1a9..b2848ae 100644 --- a/EstateReportingAPI.IntegrationTests/TransactionsEndpointTests.cs +++ b/EstateReportingAPI.IntegrationTests/TransactionsEndpointTests.cs @@ -938,6 +938,7 @@ public async Task TransactionsEndpoint_ProductPerformanceReport_SummaryDataRetur productPerformanceResponseDetail.ShouldNotBeNull(); productPerformanceResponseDetail.TransactionCount.ShouldBe(transactions.Count(t => t.ContractProductId == product.productId)); productPerformanceResponseDetail.TransactionValue.ShouldBe(transactions.Where(t => t.ContractProductId == product.productId).Sum(t => t.TransactionAmount)); + productPerformanceResponseDetail.PercentageOfTotal.ShouldNotBe(0); } } From 758d98ab596bc242baa9188d79a895758deb8f0a Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Tue, 10 Mar 2026 13:16:27 +0000 Subject: [PATCH 2/2] Delete .github/workflows/prlinked.yml --- .github/workflows/prlinked.yml | 47 ---------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 .github/workflows/prlinked.yml diff --git a/.github/workflows/prlinked.yml b/.github/workflows/prlinked.yml deleted file mode 100644 index 84037c8..0000000 --- a/.github/workflows/prlinked.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Move Linked Issues - -on: - pull_request: - types: - - opened - - synchronize - - reopened - -jobs: - get-date: - runs-on: ubuntu-latest - outputs: - project_name_prefix: ${{ steps.format_date.outputs.formatted_date }} - steps: - - name: Get PR creation date - id: format_date - run: | - # Extract the month and year from the PR creation date - PR_DATE="${{ github.event.pull_request.created_at }}" - FORMATTED_DATE=$(date -d "$PR_DATE" "+%B %Y") # Format to Month Year - - # Debugging: print out the formatted date - echo "Formatted Date: ${FORMATTED_DATE} Sprint" - - # Set output using the Environment File method - echo "formatted_date=${FORMATTED_DATE} Sprint" >> $GITHUB_OUTPUT # Set the output for later jobs - - debug-date: - needs: get-date - runs-on: ubuntu-latest - steps: - - name: Debug the outputs - run: | - echo "PR Number: ${{ github.event.pull_request.number }}" - echo "Project Column Name: Review" - echo "Project Name Prefix (from get-date job output): ${{ needs.get-date.outputs.project_name_prefix }}" # Access the output correctly - - move-issues: - needs: get-date - uses: TransactionProcessing/org-ci-workflows/.github/workflows/move-linked-issue.yml@main - with: - pr_number: ${{ github.event.pull_request.number }} - project_column_name: "Review" - project_name_prefix: ${{ needs.get-date.outputs.project_name_prefix }} # Access the output from get-date job - secrets: - gh_token: ${{ secrets.GH_TOKEN }}