From ffc819ef39c33f7a58e560cd3d1a1e7184ef4eba Mon Sep 17 00:00:00 2001 From: Sagar naik Date: Wed, 20 Dec 2023 17:26:25 +0530 Subject: [PATCH] fix: refunds reports end point change (#119) --- src/screens/HyperSwitch/Analytics/Analytics.res | 6 +++++- .../HyperSwitch/Analytics/DownloadReportModal.res | 9 ++++++++- .../Analytics/PaymentsAnalytics/PaymentAnalytics.res | 1 + .../Analytics/RefundsAnalytics/RefundsAnalytics.res | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/screens/HyperSwitch/Analytics/Analytics.res b/src/screens/HyperSwitch/Analytics/Analytics.res index e4ee6760e..38189d745 100644 --- a/src/screens/HyperSwitch/Analytics/Analytics.res +++ b/src/screens/HyperSwitch/Analytics/Analytics.res @@ -511,6 +511,7 @@ let make = ( ~moduleName: string, ~weeklyTableMetricsCols=?, ~distributionArray=None, + ~generateReportType: option=?, ) => { let {generateReport} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom let analyticsType = moduleName->getAnalyticsType @@ -708,7 +709,10 @@ let make = (
- + {switch generateReportType { + | Some(entityName) => + | None => React.null + }}
topFilterUi
diff --git a/src/screens/HyperSwitch/Analytics/DownloadReportModal.res b/src/screens/HyperSwitch/Analytics/DownloadReportModal.res index a793e92df..3e964003b 100644 --- a/src/screens/HyperSwitch/Analytics/DownloadReportModal.res +++ b/src/screens/HyperSwitch/Analytics/DownloadReportModal.res @@ -80,8 +80,15 @@ let make = (~reportModal, ~setReportModal, ~entityName) => { }, }->Identity.genericTypeToJson + let category = switch entityName { + | PAYMENT_REPORT => "Payment" + | REFUND_REPORT => "Refund" + | DISPUTE_REPORT => "Dispute" + | _ => "" + } + diff --git a/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalytics.res b/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalytics.res index 027b55053..ba0c1efdd 100644 --- a/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalytics.res +++ b/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalytics.res @@ -88,6 +88,7 @@ let make = () => { initialFixedFilters=initialFixedFilterFields weeklyTableMetricsCols distributionArray={[distribution]->Some} + generateReportType={PAYMENT_REPORT} /> } diff --git a/src/screens/HyperSwitch/Analytics/RefundsAnalytics/RefundsAnalytics.res b/src/screens/HyperSwitch/Analytics/RefundsAnalytics/RefundsAnalytics.res index 575f5558e..1b0c73089 100644 --- a/src/screens/HyperSwitch/Analytics/RefundsAnalytics/RefundsAnalytics.res +++ b/src/screens/HyperSwitch/Analytics/RefundsAnalytics/RefundsAnalytics.res @@ -90,6 +90,7 @@ let make = () => { endTimeFilterKey={endTimeFilterKey} initialFilters={initialFilterFields} initialFixedFilters={initialFixedFilterFields} + generateReportType={REFUND_REPORT} /> }