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(analytics): refactor and introduce analytics APIs to accommodate OrgLevel, MerchantLevel and ProfileLevel authentication #5784

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

lsampras
Copy link
Contributor

@lsampras lsampras commented Sep 3, 2024

Type of Change

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

Description

Cherry picked the commit for #5729

Additional Changes

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

Motivation and Context

How did you test it?

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

… OrgLevel, MerchantLevel and ProfileLevel authentication (#5729)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sampras Lopes <[email protected]>
@lsampras lsampras requested review from a team as code owners September 3, 2024 11:36
Copy link

semanticdiff-com bot commented Sep 3, 2024

Review changes with SemanticDiff.

Analyzed 58 of 62 files.

Overall, the semantic diff is 17% smaller than the GitHub diff.

1 files do not contain logic changes.

File Information
Filename Status
Cargo.lock Unsupported file format
✔️ crates/router/src/analytics.rs 4.37% smaller
✔️ crates/router/src/types/domain/user.rs Analyzed
✔️ crates/router/src/core/verification/utils.rs 10.92% smaller
✔️ crates/hyperswitch_domain_models/src/merchant_account.rs Analyzed
✔️ crates/common_utils/src/types.rs Analyzed
crates/common_utils/src/types/authentication.rs Unsupported file format
✔️ crates/api_models/src/analytics.rs 56.02% smaller
✔️ crates/api_models/src/analytics/payment_intents.rs Analyzed
✔️ crates/api_models/src/analytics/payments.rs Analyzed
✔️ crates/api_models/src/analytics/refunds.rs Analyzed
✔️ crates/analytics/src/clickhouse.rs Analyzed
crates/analytics/src/enums.rs Unsupported file format
✔️ crates/analytics/src/errors.rs Analyzed
✔️ crates/analytics/src/lib.rs 33.63% smaller
✔️ crates/analytics/src/query.rs 7.47% smaller
✔️ crates/analytics/src/sqlx.rs 12.47% smaller
✔️ crates/analytics/src/refunds/core.rs 4.82% smaller
✔️ crates/analytics/src/refunds/filters.rs 29.63% smaller
✔️ crates/analytics/src/refunds/metrics.rs 84.54% smaller
✔️ crates/analytics/src/refunds/types.rs Analyzed
✔️ crates/analytics/src/refunds/metrics/refund_count.rs 28.0% smaller
✔️ crates/analytics/src/refunds/metrics/refund_processed_amount.rs 28.0% smaller
✔️ crates/analytics/src/refunds/metrics/refund_success_count.rs 28.0% smaller
✔️ crates/analytics/src/refunds/metrics/refund_success_rate.rs 28.0% smaller
✔️ crates/analytics/src/payments/core.rs Analyzed
✔️ crates/analytics/src/payments/distribution.rs Analyzed
✔️ crates/analytics/src/payments/filters.rs 5.51% smaller
✔️ crates/analytics/src/payments/metrics.rs 89.14% smaller
✔️ crates/analytics/src/payments/types.rs Analyzed
✔️ crates/analytics/src/payments/metrics/avg_ticket_size.rs 28.0% smaller
✔️ crates/analytics/src/payments/metrics/connector_success_rate.rs 28.0% smaller
✔️ crates/analytics/src/payments/metrics/payment_count.rs 28.0% smaller
✔️ crates/analytics/src/payments/metrics/payment_processed_amount.rs 28.0% smaller
✔️ crates/analytics/src/payments/metrics/payment_success_count.rs 28.0% smaller
✔️ crates/analytics/src/payments/metrics/retries_count.rs 28.0% smaller
✔️ crates/analytics/src/payments/metrics/success_rate.rs 28.0% smaller
✔️ crates/analytics/src/payments/distribution/payment_error_message.rs 28.0% smaller
✔️ crates/analytics/src/payment_intents/core.rs 2.29% smaller
✔️ crates/analytics/src/payment_intents/filters.rs Analyzed
✔️ crates/analytics/src/payment_intents/metrics.rs 84.54% smaller
✔️ crates/analytics/src/payment_intents/types.rs Analyzed
✔️ crates/analytics/src/payment_intents/metrics/payment_intent_count.rs 28.0% smaller
✔️ crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs 28.0% smaller
✔️ crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs 28.0% smaller
✔️ crates/analytics/src/payment_intents/metrics/total_smart_retries.rs 28.0% smaller
✔️ crates/analytics/src/outgoing_webhook_event/events.rs No logic changes found
✔️ crates/analytics/src/disputes/core.rs 5.41% smaller
✔️ crates/analytics/src/disputes/filters.rs 34.34% smaller
✔️ crates/analytics/src/disputes/metrics.rs 83.91% smaller
✔️ crates/analytics/src/disputes/metrics/dispute_status_metric.rs 32.33% smaller
✔️ crates/analytics/src/disputes/metrics/total_amount_disputed.rs 32.33% smaller
✔️ crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs 32.33% smaller
✔️ crates/analytics/src/api_event/core.rs 35.38% smaller
✔️ crates/analytics/src/api_event/filters.rs 33.86% smaller
✔️ crates/analytics/src/api_event/metrics.rs 83.91% smaller
✔️ crates/analytics/src/api_event/metrics/api_count.rs 32.33% smaller
✔️ crates/analytics/src/api_event/metrics/latency.rs 32.33% smaller
✔️ crates/analytics/src/api_event/metrics/status_code_count.rs 32.33% smaller
config/dashboard.toml Unsupported file format
✔️ api-reference-v2/openapi_spec.json 0.82% smaller
✔️ api-reference/openapi_spec.json 0.37% smaller

@lsampras lsampras self-assigned this Sep 3, 2024
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Sep 3, 2024
@lsampras lsampras changed the title fix(profile_id): Add profile id filter for profile admins #5729 feat(analytics): refactor and introduce analytics APIs to accommodate OrgLevel, MerchantLevel and ProfileLevel authentication Sep 3, 2024
Copy link
Contributor

@ThisIsMani ThisIsMani left a comment

Choose a reason for hiding this comment

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

Dashboard specific changes looks fine.

Copy link
Member

Choose a reason for hiding this comment

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

Why were so many of our dependencies updated only in the lockfile though?

@SanchithHegde SanchithHegde merged commit a6c9ed2 into hotfix-2024.08.30.0 Sep 4, 2024
16 of 20 checks passed
@SanchithHegde SanchithHegde deleted the add_profile_id_check-hf branch September 4, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Analytics M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
5 participants