Skip to content

Commit

Permalink
refactor: cleanup routing typs
Browse files Browse the repository at this point in the history
  • Loading branch information
jainlokesh318 committed Jan 15, 2024
1 parent 430e365 commit 354452d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/screens/HyperSwitch/Routing/RoutingTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ type routingType = SINGLE | PRIORITY | VOLUME_SPLIT | ADVANCED | COST | DEFAULTF
type formState = CreateConfig | EditConfig | ViewConfig
type status = ACTIVE | APPROVED | PENDING | REJECTED
type pageState = Preview | Create | Edit
type variantType = Number | Enum_variant | Metadata_value | String_value | UnknownVariant(string)
type logicalOperator = AND | OR | UnknownLogicalOperator(string)
type val = StringArray(array<string>) | String(string) | Int(int)

type historyColType =
| Name
Expand Down Expand Up @@ -32,10 +35,6 @@ type operator =
| NOT_EQUAL_TO
| UnknownOperator(string)

type variantType = Number | Enum_variant | Metadata_value | String_value | UnknownVariant(string)
type logicalOperator = AND | OR | UnknownLogicalOperator(string)
type val = StringArray(array<string>) | String(string) | Int(int)

type modalValue = {conType: string, conText: React.element}
type routingValueType = {heading: string, subHeading: string}
type modalObj = (routingType, string) => modalValue
Expand All @@ -46,11 +45,13 @@ type wasmModule = {
getAllConnectors: unit => array<string>,
getVariantValues: string => array<string>,
}

type gateway = {
distribution: int,
disableFallback: bool,
gateway_name: string,
}

type volumeDistribution = {
connector: string,
split: int,
Expand All @@ -63,12 +64,15 @@ type condition = {
value: val,
logicalOperator: logicalOperator,
}

type routingOutputType = {override_3ds: string}

type rule = {
gateways: array<gateway>,
conditions: array<condition>,
routingOutput?: routingOutputType,
}

type ruleInfoType = {
rules: array<rule>,
default_gateways: array<string>,
Expand All @@ -85,6 +89,7 @@ type historyData = {
}

type value = {"type": Js.Json.t, "value": Js.Json.t}

type payloadCondition = {
lhs: string,
comparison: string,
Expand Down

0 comments on commit 354452d

Please sign in to comment.