diff options
Diffstat (limited to 'src/server/Model/Json/Income.hs')
-rw-r--r-- | src/server/Model/Json/Income.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/Model/Json/Income.hs b/src/server/Model/Json/Income.hs index bb1ac97..7e23a84 100644 --- a/src/server/Model/Json/Income.hs +++ b/src/server/Model/Json/Income.hs @@ -2,14 +2,16 @@ module Model.Json.Income ( Income(..) + , fromIncome ) where -import GHC.Generics - import Data.Aeson import Data.Time.Calendar (Day) +import GHC.Generics -import Model.Database (IncomeId, UserId) +import Model.Income (IncomeId) +import Model.User (UserId) +import qualified Model.Income as M data Income = Income { id :: IncomeId @@ -19,3 +21,6 @@ data Income = Income } deriving (Show, Generic) instance ToJSON Income + +fromIncome :: M.Income -> Income +fromIncome income = Income (M.id income) (M.userId income) (M.date income) (M.amount income) |