Skip to content

Commit

Permalink
fix: added attempts count column in payment list table (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
Riddhiagrawal001 authored Jul 18, 2024
1 parent f693f41 commit 8ab36fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/screens/Order/OrderEntity.res
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ let allColumns = [
Status,
Metadata,
MerchantOrderReferenceId,
AttemptCount,
]

let getHeading = (colType: colType) => {
Expand Down Expand Up @@ -536,6 +537,8 @@ let getHeading = (colType: colType) => {
~showSort=false,
(),
)
| AttemptCount =>
Table.makeHeaderInfo(~key="attempt_count", ~title="Attempt count", ~showSort=false, ())
}
}

Expand Down Expand Up @@ -901,6 +904,7 @@ let getCell = (order, colType: colType): Table.cell => {
Text(dict->getString("card_network", ""))
}
| MerchantOrderReferenceId => Text(order.merchant_order_reference_id)
| AttemptCount => Text(order.attempt_count->Int.toString)
}
}

Expand Down Expand Up @@ -1053,6 +1057,7 @@ let itemToObjMapper = dict => {
disputes: dict->getArrayFromDict("disputes", [])->JSON.Encode.array->DisputesEntity.getDisputes,
attempts: dict->getArrayFromDict("attempts", [])->JSON.Encode.array->getAttempts,
merchant_order_reference_id: dict->getString("merchant_order_reference_id", ""),
attempt_count: dict->getInt("attempt_count", 0),
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/screens/Order/OrderTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ type order = {
disputes: array<DisputeTypes.disputes>,
attempts: array<attempts>,
merchant_order_reference_id: string,
attempt_count: int,
}

type refundsColType =
Expand Down Expand Up @@ -207,6 +208,7 @@ type colType =
| Metadata
| CardNetwork
| MerchantOrderReferenceId
| AttemptCount

type summaryColType =
| Created
Expand Down

0 comments on commit 8ab36fa

Please sign in to comment.