Skip to content

feat(payouts): add payout report generation endpoints and configuration#10073

Merged
likhinbopanna merged 3 commits intomainfrom
Report_generation_payout
Nov 10, 2025
Merged

feat(payouts): add payout report generation endpoints and configuration#10073
likhinbopanna merged 3 commits intomainfrom
Report_generation_payout

Conversation

@VenuMadhav2541
Copy link
Contributor

@VenuMadhav2541 VenuMadhav2541 commented Oct 31, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR introduces payout report generation functionality as part of the Payouts module.
It includes backend and Lambda logic to generate and fetch payout reports, along with configuration updates in env_specific.toml.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

This change enables users to generate and download payout reports directly from the system.
It improves visibility into payout data and supports better reconciliation processes.

How did you test it?

  • Verified payout report generation end-to-end in the sandbox environment.
  • Validated backend API responses and report file creation.
  • Ensured no regressions in existing payout functionality.
curl --location 'http://localhost:9000/api/analytics/v1/merchant/report/payouts' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/dashboard/refunds' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-origin' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36' \
--header 'X-Merchant-Id: merchant_1757947392' \
--header 'X-Profile-Id: pro_Q4eUMp5JpOMZOCeUQ9go' \
--header 'api-key: dev_eDaxki5KCplDxFw2sEecVPexoibZM0gPXPJZYMk9LdUXKg7VPKuko465SSL7vCR4' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiY2EzZGM3MjMtNmRiNS00NDMxLTkyMGMtZmQyMTk1ZDFjMWNkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzU3OTQ3MzkyIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc2MjA2OTU1MSwib3JnX2lkIjoib3JnX3BlbHNCdE1MNU5RWG82cG5QZFlUIiwicHJvZmlsZV9pZCI6InByb19RNGVVTXA1SnBPTVpPQ2VVUTlnbyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.9AqojYnoaeikpdY25YkVnIYo34Jwr5a7FPtTTsIn-Ps' \
--header 'sec-ch-ua: "Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiY2EzZGM3MjMtNmRiNS00NDMxLTkyMGMtZmQyMTk1ZDFjMWNkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzU3OTQ3MzkyIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc2MjA2OTU1MSwib3JnX2lkIjoib3JnX3BlbHNCdE1MNU5RWG82cG5QZFlUIiwicHJvZmlsZV9pZCI6InByb19RNGVVTXA1SnBPTVpPQ2VVUTlnbyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.9AqojYnoaeikpdY25YkVnIYo34Jwr5a7FPtTTsIn-Ps; security_authentication=Fe26.2**1c09fd471e086cfdd020b1afeff9be9cc16d66e8e09a1d8777f5382614fb99c4*ClC9pzCbXDpsYn8HHjetow*wNHx7yglFofavoU2VZdkK9gBvrkoHncr5WRapNqxPGNwu9TIdUCHtKw8XNMeqAtbxVFAQu_H5KQIZ00vWy1cPuUVSLvdUAiqIGTfpmk2LN9qrirDCjaqGnt7Av9Fw3rB4spxi_jGoXezytLCVZj-GbuN1PcuuIloVmYFXIBaCobv-PfKTr0jRUsgUa4Vh9GLT7JCWjeb_Etq3nfBO0pDhUq8fZfmWlTyBwI0a74UFM0I_Z58TeFqxe_EVo0X1WsD**b970a9eb2a032d9cf1b90ccf3380d3af947898f1c030a8b64e315cd6f64db051*ErmZGVhAd6ORpW-tth4lleb5b_5Xa6K40IIPKA1Xr2Y' \
--data-raw '{
    "timeRange": {
        "startTime": "2025-09-30T18:30:00Z",
        "endTime": "2025-10-31T12:31:12Z"
    },
    "emails": [
        "venu.b@juspay.in"
    ]
}'
  • Response:
    Should be able to receive the payout report through email of the logged-in user as well as any additional email recipients mentioned in the request.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I manually tested the feature in the sandbox environment

@VenuMadhav2541 VenuMadhav2541 self-assigned this Oct 31, 2025
@VenuMadhav2541 VenuMadhav2541 requested review from a team as code owners October 31, 2025 06:03
@VenuMadhav2541 VenuMadhav2541 added the C-feature Category: Feature request or enhancement label Oct 31, 2025
@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 31, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/analytics.rs  2% smaller
  config/deployments/env_specific.toml Unsupported file format
  crates/analytics/src/lib.rs  0% smaller

@VenuMadhav2541 VenuMadhav2541 linked an issue Oct 31, 2025 that may be closed by this pull request
2 tasks
@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7b70d24). Learn more about missing BASE report.

Files with missing lines Patch % Lines
crates/analytics/src/opensearch.rs 14.28% 6 Missing ⚠️
crates/router/src/consts/opensearch.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10073   +/-   ##
=======================================
  Coverage        ?    3.91%           
=======================================
  Files           ?     1223           
  Lines           ?   301721           
  Branches        ?        0           
=======================================
  Hits            ?    11804           
  Misses          ?   289917           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@VenuMadhav2541 VenuMadhav2541 changed the title feat(Payouts): add payout report generation endpoints and configuration feat(payouts): add payout report generation endpoints and configuration Oct 31, 2025
dispute_function = "report_download_config_dispute_function" # Config to download dispute report
payment_function = "report_download_config_payment_function" # Config to download payment report
refund_function = "report_download_config_refund_function" # Config to download refund report
payout_function = "report_download_config_payout_function" # Config to download payout report
Copy link
Contributor

Choose a reason for hiding this comment

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

Please take care of indentation while adding comments in this file

tsdk02
tsdk02 previously approved these changes Oct 31, 2025
Copy link
Contributor

@tsdk02 tsdk02 left a comment

Choose a reason for hiding this comment

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

LGTM

@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit 4174929 Nov 10, 2025
48 of 52 checks passed
@likhinbopanna likhinbopanna deleted the Report_generation_payout branch November 10, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-feature Category: Feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Payout Report Generation Functionality

4 participants