Skip to content

Commit

Permalink
fix: refunds reports end point change
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarnaikjuspay committed Dec 20, 2023
1 parent 74f327c commit 79a1d13
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down Expand Up @@ -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>
Expand Down
9 changes: 8 additions & 1 deletion src/screens/HyperSwitch/Analytics/DownloadReportModal.res
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -90,6 +90,7 @@ let make = () => {
endTimeFilterKey={endTimeFilterKey}
initialFilters={initialFilterFields}
initialFixedFilters={initialFixedFilterFields}
generateReportType={REFUND_REPORT}
/>
</PageLoaderWrapper>
}

0 comments on commit 79a1d13

Please sign in to comment.