Skip to content

feat(global_search): add payouts configuration and update related structures in OpenSearch#10081

Merged
likhinbopanna merged 1 commit intomainfrom
global_search_payouts
Nov 10, 2025
Merged

feat(global_search): add payouts configuration and update related structures in OpenSearch#10081
likhinbopanna merged 1 commit intomainfrom
global_search_payouts

Conversation

@VenuMadhav2541
Copy link
Contributor

Type of Change

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

Description

  • This PR introduces OpenSearch configuration for Payouts to extend the global search capability across the platform.
  • The changes ensure that payout-related events and records are properly indexed in OpenSearch, enabling efficient search and retrieval within the global search framework.

Updates include:

  • Added payout index configuration to the OpenSearch setup.
  • Updated related OpenSearch mappings and environment variables.
  • Integrated payout index support into the existing global search query structure.
  • Ensured backward compatibility with existing indexes and search functionality.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables
  • Updated OpenSearch configuration files to include payout index references.
  • Modified environment variables to point to the new payout index setup.
  • Adjusted lambda and backend integration logic to align with payout index creation and synchronization.

Motivation and Context

Previously, global search did not support querying payout-related data, limiting visibility and monitoring capabilities.
This enhancement allows payout data to be indexed and searched in the same way as other payment entities, improving observability and user experience.

  • By adding dedicated payout OpenSearch configuration, we can now:
  • Enable faster and unified search across all payouts.
  • Support analytics and reporting pipelines with better query capabilities.
  • Lay groundwork for future enhancements like payout filtering and cross-entity search.

How did you test it?

curl 'http://localhost:9000/api/analytics/v1/search' \
  -H 'Accept: */*' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -b 'login_token=****** \
  -H 'Origin: http://localhost:9000' \
  -H 'Referer: http://localhost:9000/dashboard/refunds' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H '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' \
  -H 'X-Merchant-Id: merchant_123' \
  -H 'X-Profile-Id: pro_*****' \
  -H 'api-key: hyperswitch' \
  -H 'authorization: Bearer ******\
  -H 'sec-ch-ua: "Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --data-raw '{"query":"EUR"}'
  • Response:
[
    {
        "count": 0,
        "index": "payment_attempts",
        "hits": [],
        "status": "Success"
    },
    {
        "count": 0,
        "index": "payment_intents",
        "hits": [],
        "status": "Success"
    },
    {
        "count": 0,
        "index": "refunds",
        "hits": [],
        "status": "Success"
    },
    {
        "count": 0,
        "index": "disputes",
        "hits": [],
        "status": "Failure"
    },
    {
        "count": 1,
        "index": "payouts",
        "hits": [
            {
                "@timestamp": "2025-10-31T10:51:04Z",
                "address_id": "add_89nbWhahUrjUncgt0AKM",
                "amount": 10,
                "attempt_count": 1,
                "auto_fulfill": false,
                "business_country": null,
                "business_label": null,
                "connector": null,
                "connector_payout_id": null,
                "created_at": 1761907864,
                "customer_id": "payout_customer",
                "description": "Its my first payout request",
                "destination_currency": "EUR",
                "entity_type": "NaturalPerson",
                "error_code": null,
                "error_message": null,
                "headers": {},
                "is_eligible": null,
                "last_modified_at": 1761907864,
                "merchant_connector_id": null,
                "merchant_id": "merchant_123",
                "metadata": {
                    "ref": "123"
                },
                "organization_id": "org_123",
                "payout_attempt_id": "payout_123",
                "payout_id": "payout_123",
                "payout_method_id": null,
                "payout_type": null,
                "priority": null,
                "profile_id": "pro_123",
                "recurring": true,
                "return_url": null,
                "source_currency": "EUR",
                "source_type": "kafka",
                "status": "requires_payout_method_data",
                "tenant_id": "public",
                "timestamp": "2025-10-31T10:51:04Z"
            }
        ],
        "status": "Success"
    },
    {
        "count": 0,
        "index": "sessionizer_payment_attempts",
        "hits": [],
        "status": "Failure"
    },
    {
        "count": 0,
        "index": "sessionizer_payment_intents",
        "hits": [],
        "status": "Failure"
    },
    {
        "count": 0,
        "index": "sessionizer_refunds",
        "hits": [],
        "status": "Failure"
    },
    {
        "count": 0,
        "index": "sessionizer_disputes",
        "hits": [],
        "status": "Failure"
    }
]

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@VenuMadhav2541 VenuMadhav2541 requested review from a team as code owners November 1, 2025 05:28
@semanticdiff-com
Copy link

semanticdiff-com bot commented Nov 1, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  config/config.example.toml Unsupported file format
  config/deployments/env_specific.toml Unsupported file format
  config/development.toml Unsupported file format
  config/docker_compose.toml Unsupported file format
  config/vector.yaml  0% smaller
  crates/analytics/src/opensearch.rs  0% smaller
  crates/api_models/src/analytics/search.rs  0% smaller
  crates/router/src/consts/opensearch.rs  0% smaller

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

❌ Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@c433f5e). 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   #10081   +/-   ##
=======================================
  Coverage        ?    3.91%           
=======================================
  Files           ?     1223           
  Lines           ?   301725           
  Branches        ?        0           
=======================================
  Hits            ?    11804           
  Misses          ?   289921           
  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 self-assigned this Nov 3, 2025
@VenuMadhav2541 VenuMadhav2541 added the C-feature Category: Feature request or enhancement label Nov 3, 2025
@VenuMadhav2541 VenuMadhav2541 changed the title feat(global_search: add payouts configuration and update related structures in OpenSearch feat(global_search:add payouts configuration and update related structures in OpenSearch Nov 3, 2025
@VenuMadhav2541 VenuMadhav2541 changed the title feat(global_search:add payouts configuration and update related structures in OpenSearch feat(global_search): add payouts configuration and update related structures in OpenSearch Nov 3, 2025
@VenuMadhav2541 VenuMadhav2541 linked an issue Nov 3, 2025 that may be closed by this pull request
2 tasks
Copy link
Contributor

@su-shivanshmathur su-shivanshmathur left a comment

Choose a reason for hiding this comment

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

Looks good

@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit 5fb8b46 Nov 10, 2025
35 of 43 checks passed
@likhinbopanna likhinbopanna deleted the global_search_payouts branch November 10, 2025 08:26
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 Global Search configuration for Payouts in OpenSearch

4 participants