Skip to content

Commit

Permalink
feat: Show Orders Enhancements & sidebar value changes (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored Dec 15, 2023
1 parent 1ddbe68 commit a1631f3
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 88 deletions.
22 changes: 6 additions & 16 deletions src/entryPoints/hyperswitch/SidebarValues.res
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,9 @@ let proFeatures = isProFeaturesEnabled =>

let fraudAndRisk = isfraudAndRiskEnabled =>
isfraudAndRiskEnabled
? LinkWithTag({
? Link({
name: "Fraud & Risk",
icon: "shield-alt",
iconTag: "sidebar-lock",
iconStyles: "w-15 h-15",
iconSize: 15,
link: `/fraud-risk-management`,
access: isfraudAndRiskEnabled ? ReadWrite : NoAccess,
searchOptions: [],
Expand All @@ -274,13 +271,10 @@ let fraudAndRisk = isfraudAndRiskEnabled =>

let payoutConnectors = isPayoutConnectorsEnabled =>
isPayoutConnectorsEnabled
? LinkWithTag({
? Link({
name: "Payout Processors",
link: `/payoutconnectors`,
icon: "connectors",
iconTag: "sidebar-lock",
iconStyles: "w-15 h-15",
iconSize: 15,
access: ReadWrite,
searchOptions: HSwitchUtils.getSearchOptionsForProcessors(
~processorList=ConnectorUtils.payoutConnectorList,
Expand All @@ -291,12 +285,9 @@ let payoutConnectors = isPayoutConnectorsEnabled =>

let reconTag = (recon, isReconEnabled) =>
recon
? LinkWithTag({
? Link({
name: "Reconcilation",
icon: isReconEnabled ? "recon" : "recon-lock",
iconTag: "sidebar-lock",
iconStyles: "w-15 h-15",
iconSize: 15,
link: `/recon`,
access: ReadWrite,
})
Expand Down Expand Up @@ -326,16 +317,15 @@ let getHyperSwitchAppSidebars = (
default->analytics,
default->connectors,
default->workflow,
frm->fraudAndRisk,
payOut->payoutConnectors,
recon->reconTag(isReconEnabled),
default->developers(userRole, systemMetrics),
settings(
~isUserManagementEnabled=userManagement,
~isBusinessProfileEnabled=businessProfile,
~isSampleDataEnabled=sampleData,
),
[frm, payOut, recon]->Js.Array2.includes(true)->proFeatures,
frm->fraudAndRisk,
payOut->payoutConnectors,
recon->reconTag(isReconEnabled),
]
sidebar
}
22 changes: 17 additions & 5 deletions src/screens/HyperSwitch/Order/OrderEntity.res
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,14 @@ let getHeadingForSummary = summaryColType => {
Table.makeHeaderInfo(~key="last_updated", ~title="Last Updated", ~showSort=true, ())
| PaymentId => Table.makeHeaderInfo(~key="payment_id", ~title="Payment ID", ~showSort=true, ())
| Currency => Table.makeHeaderInfo(~key="currency", ~title="Currency", ~showSort=true, ())
| ErrorCode => Table.makeHeaderInfo(~key="error_code", ~title="Error Code", ~showSort=true, ())
| AmountReceived =>
Table.makeHeaderInfo(
~key="amount_received",
~title="Amount Received",
~description="Amount captured by the payment processor for this payment.",
~showSort=true,
(),
)
| ClientSecret =>
Table.makeHeaderInfo(~key="client_secret", ~title="Client Secret", ~showSort=true, ())
| ConnectorTransactionID =>
Expand Down Expand Up @@ -612,8 +619,7 @@ let getHeadingForOtherDetails = otherDetailsColType => {
| Billing => Table.makeHeaderInfo(~key="billing", ~title="Billing Address", ~showSort=true, ())
| AmountCapturable =>
Table.makeHeaderInfo(~key="amount_capturable", ~title="AmountCapturable", ~showSort=true, ())
| AmountReceived =>
Table.makeHeaderInfo(~key="amount_received", ~title="Amount Received", ~showSort=true, ())
| ErrorCode => Table.makeHeaderInfo(~key="error_code", ~title="Error Code", ~showSort=true, ())
| MandateData =>
Table.makeHeaderInfo(~key="mandate_data", ~title="Mandate Data", ~showSort=true, ())
| FRMName => Table.makeHeaderInfo(~key="frm_name", ~title="FRM Tag", ~showSort=true, ())
Expand All @@ -635,7 +641,13 @@ let getCellForSummary = (order, summaryColType): Table.cell => {
| LastUpdated => Date(order.last_updated)
| PaymentId => CustomCell(<CopyTextCustomComp displayValue=order.payment_id />, "")
| Currency => Text(order.currency)
| ErrorCode => Text(order.error_code)
| AmountReceived =>
CustomCell(
<CurrencyCell
amount={(order.amount_received /. 100.0)->Belt.Float.toString} currency={order.currency}
/>,
"",
)
| ClientSecret => Text(order.client_secret)
| OrderQuantity => Text(order.order_quantity)
| ProductName => Text(order.product_name)
Expand Down Expand Up @@ -690,7 +702,7 @@ let getCellForOtherDetails = (order, aboutPaymentColType): Table.cell => {
| Shipping => Text(order.shipping)
| Billing => Text(order.billing)
| AmountCapturable => Currency(order.amount_capturable /. 100.0, order.currency)
| AmountReceived => Currency(order.amount_received /. 100.0, order.currency)
| ErrorCode => Text(order.error_code)
| MandateData => Text(order.mandate_data)
| FRMName => Text(order.frm_message.frm_name)
| FRMTransactionType => Text(order.frm_message.frm_transaction_type)
Expand Down
4 changes: 2 additions & 2 deletions src/screens/HyperSwitch/Order/OrderTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ type summaryColType =
| LastUpdated
| PaymentId
| Currency
| ErrorCode
| AmountReceived
| ClientSecret
| OrderQuantity
| ProductName
Expand All @@ -206,7 +206,7 @@ type aboutPaymentColType =
type otherDetailsColType =
| MandateData
| AmountCapturable
| AmountReceived
| ErrorCode
| Shipping
| Billing
| Email
Expand Down
Loading

0 comments on commit a1631f3

Please sign in to comment.