Skip to content

PM-6343: Add Salesforce sales reporting for Sales and WIN - #158

Merged
jmgasper merged 2 commits into
developfrom
PM-6343
Sep 16, 2026
Merged

jmgasper merged 2 commits into
developfrom
PM-6343

Conversation

@jmgasper

@jmgasper jmgasper commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Implements PM-6343 by reading Salesforce’s saved “Bookings By Stage” report dynamically for the Sales UI and WIN. No Salesforce records or report definitions are modified, and no report data is stored in the database.

  • Adds GET /v6/reports/sales for Administrator/Talent Manager users and GET /v6/reports/win/sales exclusively for M2M tokens with reports:sales.
  • Preserves report metadata, Stage groupings, currency values and text equivalents of image formulas; supports global search, column filtering, typed sorting and pagination.
  • Adds a 60-second in-memory cache, coalesced refresh, bounded retries and token renewal, sanitized errors and explicit upstream completeness metadata.
  • Documents credentials, scope grants, API contract and operational limits in SALES.md.

Validation: pnpm lint, pnpm build, and all 24 Sales tests pass. A read-only live Salesforce check returned all 124 records and 15 columns; Stage filtering and amount sorting passed. The full existing suite has 20 SFDC failures, reproduced unchanged on base develop (cb9c0f7); the failing suites are sfdc-reports.dto.spec.ts and sfdc-reports.service.spec.ts.

Deployment: inject Salesforce credentials from secure server configuration and grant the new reports:sales scope to the WIN machine client. Companion UI: topcoder-platform/platform-ui#2303

Dev validation: deployed image reports-api-v6:382 returns all 124 records and 15 columns. Live API checks passed for Admin/Talent Manager access, rejection of ordinary users, dedicated WIN machine scope, rejection of reports:all alone and human WIN access, pagination, Stage filtering, amount sorting and invalid-query handling. Salesforce credentials are injected through dev SSM SecureString parameters. The Sales preview is https://sales.topcoder-dev.com.

Comment thread src/reports/sales/sales-reports.service.ts Fixed
@jmgasper
jmgasper merged commit dd1d7f5 into develop Sep 16, 2026
6 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