Skip to content

Commit

Permalink
Small schema type tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
RileyEv committed Feb 13, 2022
1 parent b3910db commit 9399e85
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/Bank/TrueLayer/DataAPI/Schema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ data Account = Account

data AccountBalance = AccountBalance
{ currency :: String
, available :: Int
, current :: Int
, overdraft :: Maybe Int
, available :: Double
, current :: Double
, overdraft :: Maybe Double
, update_timestamp :: Maybe String
}
deriving (FromJSON, Generic, Show, ToJSON)
Expand Down Expand Up @@ -101,7 +101,7 @@ data DirectDebit = DirectDebit
, name :: String
, status :: String
, previous_payment_timestamp :: Maybe String
, previous_payment_amount :: Maybe Int
, previous_payment_amount :: Maybe Double
, currency :: Maybe String
, meta :: Maybe DirectDebitMeta
}
Expand All @@ -127,7 +127,7 @@ newtype ProviderId = ProviderId String
deriving (FromJSON, Generic, Show, ToJSON)

data RunningBalance = RunningBalance
{ amoung :: Int
{ amoung :: Double
, currency :: String
}
deriving (FromJSON, Generic, Show, ToJSON)
Expand All @@ -139,11 +139,11 @@ data StandingOrder = StandingOrder
, currency :: Maybe String
, meta :: Maybe StandingOrderMeta
, next_payment_date :: Maybe String
, next_payment_amount :: Maybe String
, next_payment_amount :: Maybe Double
, first_payment_date :: Maybe String
, first_payment_amount :: Maybe String
, first_payment_amount :: Maybe Double
, final_payment_date :: Maybe String
, final_payment_amount :: Maybe String
, final_payment_amount :: Maybe Double
, payee :: Maybe String
, reference :: Maybe String
}
Expand All @@ -158,17 +158,16 @@ data StandingOrders = StandingOrders
}
deriving (FromJSON, Generic, Show, ToJSON)


data Transaction = Transaction
{ transaction_id :: TransactionId -- May change ??
, normalised_provider_transaction_id :: Maybe TransactionId -- Won't change :)
, provider_transaction_id :: Maybe TransactionId -- format varies depending on provider :/
, timestamp :: String -- Specialise ??
{ transaction_id :: TransactionId
, normalised_provider_transaction_id :: Maybe TransactionId
, provider_transaction_id :: Maybe TransactionId
, timestamp :: ZonedTime
, description :: String
, amount :: Int -- Is this pennies or pounds?
, currency :: String -- Enum?
, transaction_type :: String -- enum?
, transaction_category :: String -- enum?
, amount :: Double -- pounds
, currency :: String
, transaction_type :: String
, transaction_category :: String
, transaction_classification :: [String]
, merchant_name :: Maybe String
, running_balance :: Maybe RunningBalance
Expand Down

0 comments on commit 9399e85

Please sign in to comment.