Skip to content

Conversation

@Anubhav-Ghosh1
Copy link
Member

Type of Change

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

Description

Added Fee Estimation Module

This feature introduces a Fee Estimation module that enables merchants to use their transaction data to estimate interchange and scheme fee breakdowns.

The module consists of two key components:

1. Overview Module

Provides aggregated insights for a selected date range, including:

  • Total cost incurred breakdown across interchange and scheme fees.

  • Geolocation-based breakdown displaying fee distribution across regions.

  • Fee breakdown table showing each fee type and its contribution to total cost.

    • Clicking on a fee entry opens a side modal with detailed information such as:

      • Regional breakdown
      • Total transactions where the fee was applied
      • Associated processor, cost, and contribution percentage

2. Transaction View Module

Displays transaction-level insights in a tabular format.

  • Selecting a transaction reveals detailed insights including:

    • Processor
    • Card type, brand, variant, and regionality
    • Transaction value and total fees
    • A detailed fee breakdown by interchange and scheme components

Motivation and Context

This feature enables users to gain detailed insights into the fee breakdown, helping them understand how interchange and scheme fees contribute to their overall transaction costs.

How did you test it?

Screen.Recording.2025-10-30.at.4.32.25.PM.mov

Manually tested the following scenarios:

  1. Provided empty data to mock scenario when data is not available.
  2. Pagination works correctly with 10 rows per page

Where to test it?

Since the transaction data used for this module isn’t available in the Integ environment, two separate flows are implemented for testing:

  1. Integ & Local: Use mock data to simulate API responses and enable feature validation.
  2. Sandbox & Production: Use the actual API to fetch live transaction data.
  • INTEG
  • SANDBOX
  • PROD

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

@Anubhav-Ghosh1 Anubhav-Ghosh1 self-assigned this Oct 30, 2025
@Anubhav-Ghosh1 Anubhav-Ghosh1 requested a review from a team as a code owner October 30, 2025 11:10
@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 30, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  public/hyperswitch/icons/solid.svg  0% smaller
  src/APIUtils/APIUtils.res Unsupported file format
  src/APIUtils/APIUtilsTypes.res Unsupported file format
  src/Orchestration/OrchestrationApp.res Unsupported file format
  src/Recoils/TableAtoms.res Unsupported file format
  src/components/Graphs/BarGraph/BarGraphTypes.res Unsupported file format
  src/components/Graphs/BarGraph/BarGraphUtils.res Unsupported file format
  src/container/AnalyticsContainer.res Unsupported file format
  src/entryPoints/FeatureFlagUtils.res Unsupported file format
  src/entryPoints/SidebarValues.res Unsupported file format
  src/screens/Analytics/FeeEstimation/FeeEstimation.res Unsupported file format
  src/screens/Analytics/FeeEstimation/FeeEstimationComponents/FeeEstimationOverview.res Unsupported file format
  src/screens/Analytics/FeeEstimation/FeeEstimationComponents/FeeEstimationTransactionView.res Unsupported file format
  src/screens/Analytics/FeeEstimation/FeeEstimationEntity.res Unsupported file format
  src/screens/Analytics/FeeEstimation/FeeEstimationHelper.res Unsupported file format
  src/screens/Analytics/FeeEstimation/FeeEstimationTypes.res Unsupported file format
  src/screens/Analytics/FeeEstimation/FeeEstimationUtils.res Unsupported file format
  src/screens/NewAnalytics/Insights/InsightsRefundsAnalytics/InsightsRefundsAnalyticsEntity.res Unsupported file format
  src/screens/NewAnalytics/Insights/PaymentAnalytics/InsightsPaymentAnalyticsEntity.res Unsupported file format
  src/screens/NewAnalytics/Insights/SmartRetryAnalytics/InsightsSmartRetryAnalyticsEntity.res Unsupported file format
  tailwind.config.js  0% smaller

@gitanjli525
Copy link
Contributor

In FeeEstimationHelper, import the LogicUtils file once at the top instead of using repeatedly.
Since BarGraphTypes is already imported at the top, you can remove the duplicate imports as well.

@gitanjli525
Copy link
Contributor

@Anubhav-Ghosh1 can you please add a feature flag for this section ?

@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@juspay juspay deleted a comment from nishchay-17 Nov 3, 2025
@Anubhav-Ghosh1 Anubhav-Ghosh1 force-pushed the feat/fee-estimation-module branch from 393c1b1 to bf02248 Compare November 6, 2025 13:55
gitanjli525
gitanjli525 previously approved these changes Nov 7, 2025
@Anubhav-Ghosh1 Anubhav-Ghosh1 linked an issue Nov 10, 2025 that may be closed by this pull request
2 tasks
Comment on lines +30 to +35
"payload": {
"offset": pageDetail.offset,
"limit": pageDetail.resultsPerPage,
"startDate": monthFilters["startDate"],
"endDate": monthFilters["endDate"],
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Please construct an array and convert array to dict

Comment on lines +92 to +97
"payload": {
"offset": pageDetail.offset,
"limit": pageDetail.resultsPerPage,
"startDate": monthFilters["startDate"],
"endDate": monthFilters["endDate"],
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, make a util function that does, and use it everywhere

Comment on lines +261 to +269
let tabs: array<Tabs.tab> = [
{
title: "Overview",
renderContent: () => <OverviewContainer monthFilters />,
},
{
title: "Transactions View",
renderContent: () => <TransactionViewContainer monthFilters />,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be memoized

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.

[FEAT]: Fee Estimation Module (Analytics)

5 participants