From 0922723a85b97d51081484f4fa6a407b6451d0f7 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Tue, 25 Apr 2023 10:42:16 +0000 Subject: [PATCH] chore(avs): reactivate avs development dummy --- src/Utils/Avs.hs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Utils/Avs.hs b/src/Utils/Avs.hs index abe528279..7dfe7148c 100644 --- a/src/Utils/Avs.hs +++ b/src/Utils/Avs.hs @@ -13,10 +13,10 @@ import qualified Data.Text as Text import Servant import Servant.Client --- #ifdef DEVELOPMENT --- #else +#ifdef DEVELOPMENT +#else import Servant.Client.Core (requestPath) --- #endif +#endif import Model.Types.Avs @@ -68,15 +68,15 @@ avsQueryAllLicences = AvsQueryGetLicences $ AvsObjPersonId avsPersonIdZero mkAvsQuery :: BaseUrl -> BasicAuthData -> ClientEnv -> AvsQuery --- #ifdef DEVELOPMENT --- mkAvsQuery _ _ _ = AvsQuery --- { avsQueryPerson = \_ -> return . Right $ AvsResponsePerson mempty --- , avsQueryStatus = \_ -> return . Right $ AvsResponseStatus mempty --- , avsQueryContact = \_ -> return . Right $ AvsResponseContact $ Set.singleton $ AvsDataContact (AvsPersonId 1234567) (AvsPersonInfo "123123123" "Heribert" "Sumpfmeier" (-1) Nothing Nothing Nothing Nothing) (AvsFirmInfo "Lange Firma" 7 "Kurz" Nothing Nothing Nothing Nothing Nothing Nothing) --- , avsQuerySetLicences = \_ -> return . Right $ AvsResponseSetLicences mempty --- , avsQueryGetAllLicences = return . Right $ AvsResponseGetLicences mempty --- } --- #else +#ifdef DEVELOPMENT +mkAvsQuery _ _ _ = AvsQuery + { avsQueryPerson = \_ -> return . Right $ AvsResponsePerson mempty + , avsQueryStatus = \_ -> return . Right $ AvsResponseStatus mempty + , avsQueryContact = \_ -> return . Right $ AvsResponseContact $ Set.singleton $ AvsDataContact (AvsPersonId 1234567) (AvsPersonInfo "123123123" "Heribert" "Sumpfmeier" (-1) Nothing Nothing Nothing Nothing) (AvsFirmInfo "Lange Firma" 7 "Kurz" Nothing Nothing Nothing Nothing Nothing Nothing) + , avsQuerySetLicences = \_ -> return . Right $ AvsResponseSetLicences mempty + , avsQueryGetAllLicences = return . Right $ AvsResponseGetLicences mempty + } +#else mkAvsQuery baseUrl basicAuth cliEnv = AvsQuery { avsQueryPerson = \q -> liftIO $ catch404toEmpty <$> runClientM (rawQueryPerson q) cliEnv , avsQueryStatus = \q -> liftIO $ runClientM (splitQuery rawQueryStatus q) cliEnv @@ -107,7 +107,7 @@ mkAvsQuery baseUrl basicAuth cliEnv = AvsQuery return $ view _Unwrapped' (res1 ^. _Wrapped' <> res2 ^. _Wrapped') where s = view _Wrapped' q --- #endif +#endif ----------------------- -- Utility Functions --