diff options
Diffstat (limited to 'server/src/Validation/Payment.hs')
-rw-r--r-- | server/src/Validation/Payment.hs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/server/src/Validation/Payment.hs b/server/src/Validation/Payment.hs deleted file mode 100644 index 20e370e..0000000 --- a/server/src/Validation/Payment.hs +++ /dev/null @@ -1,33 +0,0 @@ -module Validation.Payment - ( createPayment - , editPayment - ) where - -import Data.Text (Text) -import Data.Validation (Validation) -import qualified Data.Validation as V - -import Common.Model (CategoryId, CreatePaymentForm (..), - EditPaymentForm (..)) -import qualified Common.Validation.Payment as PaymentValidation -import Model.CreatePayment (CreatePayment (..)) -import Model.EditPayment (EditPayment (..)) - -createPayment :: [CategoryId] -> CreatePaymentForm -> Validation Text CreatePayment -createPayment categories form = - CreatePayment - <$> PaymentValidation.name (_createPaymentForm_name form) - <*> PaymentValidation.cost (_createPaymentForm_cost form) - <*> PaymentValidation.date (_createPaymentForm_date form) - <*> PaymentValidation.category categories (_createPaymentForm_category form) - <*> V.Success (_createPaymentForm_frequency form) - -editPayment :: [CategoryId] -> EditPaymentForm -> Validation Text EditPayment -editPayment categories form = - EditPayment - <$> V.Success (_editPaymentForm_id form) - <*> PaymentValidation.name (_editPaymentForm_name form) - <*> PaymentValidation.cost (_editPaymentForm_cost form) - <*> PaymentValidation.date (_editPaymentForm_date form) - <*> PaymentValidation.category categories (_editPaymentForm_category form) - <*> V.Success (_editPaymentForm_frequency form) |