Skip to content

Commit

Permalink
fix: refunds reports end point change (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarnaikjuspay authored Dec 20, 2023

Unverified

The committer email address is not verified.
1 parent c88dcd2 commit ffc819e
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/screens/HyperSwitch/Analytics/Analytics.res
Original file line number Diff line number Diff line change
@@ -511,6 +511,7 @@ let make = (
~moduleName: string,
~weeklyTableMetricsCols=?,
~distributionArray=None,
~generateReportType: option<APIUtilsTypes.entityName>=?,
) => {
let {generateReport} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let analyticsType = moduleName->getAnalyticsType
@@ -708,7 +709,10 @@ let make = (
<div className="flex items-center justify-between">
<PageUtils.PageHeading title=pageTitle subTitle=pageSubTitle />
<UIUtils.RenderIf condition={generateReport}>
<GenerateReport entityName={PAYMENT_REPORT} />
{switch generateReportType {
| Some(entityName) => <GenerateReport entityName />
| None => React.null
}}
</UIUtils.RenderIf>
</div>
<div className="mt-2 -ml-1"> topFilterUi </div>
9 changes: 8 additions & 1 deletion src/screens/HyperSwitch/Analytics/DownloadReportModal.res
Original file line number Diff line number Diff line change
@@ -80,8 +80,15 @@ let make = (~reportModal, ~setReportModal, ~entityName) => {
},
}->Identity.genericTypeToJson

let category = switch entityName {
| PAYMENT_REPORT => "Payment"
| REFUND_REPORT => "Refund"
| DISPUTE_REPORT => "Dispute"
| _ => ""
}

<Modal
modalHeading="Generate Reports"
modalHeading={`Generate ${category} Reports`}
showModal=reportModal
modalHeadingDescriptionElement={<div
className="text-md font-medium leading-7 opacity-50 mt-1 w-full">
Original file line number Diff line number Diff line change
@@ -88,6 +88,7 @@ let make = () => {
initialFixedFilters=initialFixedFilterFields
weeklyTableMetricsCols
distributionArray={[distribution]->Some}
generateReportType={PAYMENT_REPORT}
/>
</PageLoaderWrapper>
}
Original file line number Diff line number Diff line change
@@ -90,6 +90,7 @@ let make = () => {
endTimeFilterKey={endTimeFilterKey}
initialFilters={initialFilterFields}
initialFixedFilters={initialFixedFilterFields}
generateReportType={REFUND_REPORT}
/>
</PageLoaderWrapper>
}

0 comments on commit ffc819e

Please sign in to comment.