Skip to content

feat: update total opportunity stats, include twu values #493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alex-struk
Copy link
Collaborator

This PR closes issue: [issue #DMM-494]

Includes tests? [N]
Updated docs? [N]

Proposed changes:

  • Updated TOTAL_AWARDED_COUNT_OFFSET and TOTAL_AWARDED_VALUE_OFFSET to align with spreadsheet values
  • Updated metrics to include information from completed Team With Us opportunities (count and award values)

Additional notes:

  • DMM-494 ticket stated to update TOTAL_AWARDED_VALUE_OFFSET to 1376500, however spreadsheet had 13736500. Implemented the latter value (13736500) as it appears to be more correct since it's derived directly from the spreadsheet calculation.

Copy link

@alex-struk alex-struk requested a review from Copilot March 26, 2025 20:35
Copy link

@Copilot 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 updates the total opportunity statistics functionality by incorporating completed Team With Us opportunity data and aligning offset values with the latest spreadsheet calculations.

  • Added TWU query and aggregation logic in the metrics module.
  • Updated offset constants in the configuration file.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/back-end/lib/db/metrics.ts Added TWU opportunity query and integrated its results into metrics.
src/back-end/config.ts Adjusted offset constants to match spreadsheet-sourced values.
Comments suppressed due to low confidence (1)

src/back-end/lib/db/metrics.ts:42

  • Consider guarding the reduce call with a check to ensure that twuResult is defined (e.g., using a ternary or conditional) to prevent a potential runtime error if the query returns null or undefined.
totals.totalAwarded += twuResult.reduce(

@alex-struk alex-struk requested a review from IanFonzie March 26, 2025 20:38
Copy link
Collaborator

@IanFonzie IanFonzie left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@alex-struk alex-struk merged commit b93dad4 into development Mar 31, 2025
9 of 10 checks passed
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