From 850a1f0ee1601bc8272dc7480be6772c133efd21 Mon Sep 17 00:00:00 2001 From: Lokesh Jain Date: Mon, 15 Jan 2024 16:20:42 +0530 Subject: [PATCH] refactor: unused routing Types and utils --- .../HyperSwitch/Routing/RoutingTypes.res | 8 ------ .../HyperSwitch/Routing/RoutingUtils.res | 25 ------------------- 2 files changed, 33 deletions(-) diff --git a/src/screens/HyperSwitch/Routing/RoutingTypes.res b/src/screens/HyperSwitch/Routing/RoutingTypes.res index f3ada070f..4b0a522fa 100644 --- a/src/screens/HyperSwitch/Routing/RoutingTypes.res +++ b/src/screens/HyperSwitch/Routing/RoutingTypes.res @@ -57,14 +57,6 @@ type volumeDistribution = { split: int, } -type condition = { - field: string, - metadata?: Js.Json.t, - operator: operator, - value: val, - logicalOperator: logicalOperator, -} - type routingOutputType = {override_3ds: string} type historyData = { diff --git a/src/screens/HyperSwitch/Routing/RoutingUtils.res b/src/screens/HyperSwitch/Routing/RoutingUtils.res index 349d0714b..2eebd682c 100644 --- a/src/screens/HyperSwitch/Routing/RoutingUtils.res +++ b/src/screens/HyperSwitch/Routing/RoutingUtils.res @@ -454,21 +454,6 @@ let valueTypeMapper = dict => { value } -let conditionTypeMapper = (conditionArr: array) => { - let conditionArray = [] - conditionArr->Array.forEach(value => { - let val = value->getDictFromJsonObject - let tempval = { - field: val->getString("field", ""), - metadata: val->getDictfromDict("metadata")->Js.Json.object_, - operator: val->getString("operator", "")->operatorMapper, - value: val->valueTypeMapper, - logicalOperator: val->getString("logical.operator", "")->logicalOperatorMapper, - } - conditionArray->Array.push(tempval) - }) - conditionArray -} let threeDsTypeMapper = dict => { let getRoutingOutputval = dict->getString("override_3ds", "three_ds") let val = { @@ -594,16 +579,6 @@ let validateConditionsFor3ds = dict => { }) } -let filterEmptyValues = (arr: array) => { - arr->Array.filter(item => { - switch item.value { - | StringArray(arr) => arr->Array.length > 0 - | String(str) => str->String.length > 0 - | Int(int) => int > 0 - } - }) -} - let getRecordsObject = json => { switch Js.Json.classify(json) { | JSONObject(jsonDict) => jsonDict->getArrayFromDict("records", [])