chore(avs): reactivate avs development dummy

This commit is contained in:
Steffen Jost 2023-04-25 10:42:16 +00:00
parent 32b1074dca
commit 0922723a85

View File

@ -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 --