aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/Model
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/Common/Model')
-rw-r--r--common/src/Common/Model/CreateIncome.hs14
-rw-r--r--common/src/Common/Model/CreateIncomeForm.hs15
-rw-r--r--common/src/Common/Model/EditIncomeForm.hs18
3 files changed, 33 insertions, 14 deletions
diff --git a/common/src/Common/Model/CreateIncome.hs b/common/src/Common/Model/CreateIncome.hs
deleted file mode 100644
index 644a51c..0000000
--- a/common/src/Common/Model/CreateIncome.hs
+++ /dev/null
@@ -1,14 +0,0 @@
-module Common.Model.CreateIncome
- ( CreateIncome(..)
- ) where
-
-import Data.Aeson (FromJSON)
-import Data.Time.Calendar (Day)
-import GHC.Generics (Generic)
-
-data CreateIncome = CreateIncome
- { _createIncome_date :: Day
- , _createIncome_amount :: Int
- } deriving (Show, Generic)
-
-instance FromJSON CreateIncome
diff --git a/common/src/Common/Model/CreateIncomeForm.hs b/common/src/Common/Model/CreateIncomeForm.hs
new file mode 100644
index 0000000..e83bf0a
--- /dev/null
+++ b/common/src/Common/Model/CreateIncomeForm.hs
@@ -0,0 +1,15 @@
+module Common.Model.CreateIncomeForm
+ ( CreateIncomeForm(..)
+ ) where
+
+import Data.Aeson (FromJSON, ToJSON)
+import Data.Text (Text)
+import GHC.Generics (Generic)
+
+data CreateIncomeForm = CreateIncomeForm
+ { _createIncomeForm_amount :: Text
+ , _createIncomeForm_date :: Text
+ } deriving (Show, Generic)
+
+instance FromJSON CreateIncomeForm
+instance ToJSON CreateIncomeForm
diff --git a/common/src/Common/Model/EditIncomeForm.hs b/common/src/Common/Model/EditIncomeForm.hs
new file mode 100644
index 0000000..ff975fc
--- /dev/null
+++ b/common/src/Common/Model/EditIncomeForm.hs
@@ -0,0 +1,18 @@
+module Common.Model.EditIncomeForm
+ ( EditIncomeForm(..)
+ ) where
+
+import Data.Aeson (FromJSON, ToJSON)
+import Data.Text (Text)
+import GHC.Generics (Generic)
+
+import Common.Model.Income (IncomeId)
+
+data EditIncomeForm = EditIncomeForm
+ { _editIncomeForm_id :: IncomeId
+ , _editIncomeForm_amount :: Text
+ , _editIncomeForm_date :: Text
+ } deriving (Show, Generic)
+
+instance FromJSON EditIncomeForm
+instance ToJSON EditIncomeForm