Skip to content
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

feat(recon): get Hyperswitch Order Management data through reporting system for recon #7029

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

tsdk02
Copy link
Contributor

@tsdk02 tsdk02 commented Jan 12, 2025

Type of Change

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

Description

  • This PR provides support to fetch Hyperswitch Orders data through the reporting system for recon
  • Added support to invoke a new Lambda function that will generate the report and push to an S3 bucket.
  • The s3_path is generated, and sent to Recon backend, which will poll the s3_path to get the Hyperswitch data when it is available.

Additional Changes

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

Motivation and Context

To enable fetching of Hyperswitch data through the reporting system for recon

How did you test it?

Hit the curl:

curl --location 'http://localhost:8080/analytics/v1/merchant/report/order_management' \
--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/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: test_admin' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNmNkZTA0NzYtMTFlMi00NGE5LTlkMjUtOTA5M2QzNDQwZjhlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzM1MDQxMjkzIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczNjg2ODY5Mywib3JnX2lkIjoib3JnX2pwanI5TkFEWlhqSENNYTU5MmF3IiwicHJvZmlsZV9pZCI6InByb19QRHUydVA3aWNuM2lXY0I3V0VVSSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.cMU1hd2q3e5yb5g48FQazzjrIuR78p1mX25bZjiEo80' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data-raw '{
    "timeRange": {
        "startTime": "2025-01-08T13:56:15.243333Z",
        "endTime": "2025-01-09T13:56:15.277Z"
    },
    "emails": [
        "[email protected]"
    ]
}'

You should be able to see a LambdaResponse struct as response, with invocation_status_code, and an s3_path of the following format:

s3_path: "org_jpjr9NADZXjHCMa592aw/merchant_1735041293/order_management/2025-01-08T13:56:15_2025-01-09T13:56:15_1736710717_report.csv"

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

@tsdk02 tsdk02 added C-feature Category: Feature request or enhancement A-Analytics Recon Area: Reconciliation service labels Jan 12, 2025
@tsdk02 tsdk02 self-assigned this Jan 12, 2025
@tsdk02 tsdk02 requested a review from a team as a code owner January 12, 2025 18:25
Copy link

semanticdiff-com bot commented Jan 12, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/analytics.rs  6% smaller
  crates/analytics/src/lambda_utils.rs  0% smaller
  crates/analytics/src/lib.rs  0% smaller
  crates/api_models/src/analytics.rs  0% smaller
  crates/api_models/src/events.rs  0% smaller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Analytics C-feature Category: Feature request or enhancement Recon Area: Reconciliation service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(recon): get Hyperswitch Order Management data through reporting system for recon
1 participant