module Settlr.Storage ( Group(..) , Member(..) , Money(..) , Currency(..) , GroupMetadata(..) , getMetadata , createGroup , deleteGroup , Expense(..) , getExpenses , getSaldo , addExpense ) where import Data.Text (Text) import Data.Map (Map) -- Identifier of a group. newtype Group = Group Text -- Identifier of a group member. newtype Member = Member Text -- An amount of money in a particular currency (usually, the smallest unit for the currency). newtype Money = Money Int data Currency = CurrencyEUR | CurrencyUSD data GroupMetadata = GroupMetadata { grpName :: !Text , grpMembers :: ![Member] , grpCurrency :: !Currency } getMetadata :: Group -> IO GroupMetadata getMetadata = undefined createGroup :: GroupMetadata -> IO Group createGroup = undefined deleteGroup :: Group -> IO () deleteGroup = undefined data Expense = Expense { expCreditor :: !Member , expDebtors :: !(Map Member Money) } getExpenses :: Group -> IO [Expense] getExpenses = undefined getSaldo :: Group -> Member -> IO Money getSaldo = undefined addExpense :: Group -> Expense -> IO () addExpense = undefined