Repository navigation
PM-6783: add goods-sold offering filters and booking costs - #221
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goods Sold Customer-Wise currently exposes member payments only and ignores offering selections. This change returns
customerBookingCosts(member payments plus recorded challenge fees) alongsidecustomerPayments, and applies repeatedofferingTypeselections before aggregation. It supplies the matching API contract for platform-ui #2650.Offerings resolve by exact billing-account ID through the linked Salesforce Opportunity. The lookup validates IDs, batches 200 accounts, caches for one minute, preserves unknowns, and rejects incomplete/conflicting data. Existing date bounds, customer scope, latest payment versions, exclusions, rankings and distinct member counts are retained. Missing fees stay unknown; negative/zero fees are preserved. Salesforce outages preserve unfiltered amounts with a notice, while filtered requests fail explicitly.
Validation: 174 targeted tests verified across Sales/dashboard suites, including real PostgreSQL integration; build, TypeScript and changed-file ESLint passed. Read-only development database verification matched all 52 existing aggregate rows and confirmed empty selections return no amounts. The lookup query and compiled client were verified against the Salesforce sandbox.
Deploy this API before the UI. No migration or new configuration variables are required. The current Reports development OAuth configuration returns
invalid_client_id; sandbox verification used the existing billing-account credentials, and deployed credentials were not changed. Working existing Salesforce OAuth configuration and read access to billing accounts/linked Opportunities are needed for offering filters.Jira: https://topcoder.atlassian.net/browse/PM-6783