productsDomainTerms :: P.ProductID -> App [APIDomainTerm]
productsDomainTerms prodID = do
  dbConfig    <- reader getDBConfig
  domainTerms <- liftIO $ runReaderT (runPool (DT.findByProductId (toKey prodID))) (getPool dbConfig)
  return $ map toDomainTerm domainTerms
    where
      toDomainTerm dbDomainTerm = do
        let dbTerm   = DT.toDomainTerm dbDomainTerm
        let dbTermID = DT.toDomainTermID dbDomainTerm
        APIDomainTerm { domainTermID = Just dbTermID
                      , productID    = Just $ domainTermProductId dbTerm
                      , title        = domainTermTitle dbTerm
                      , description  = domainTermDescription dbTerm
                      }
productsDomainTerms :: P.ProductID -> App [APIDomainTerm]
productsDomainTerms prodID = do
  dbConfig    <- reader getDBConfig
  domainTerms <- liftIO $ runReaderT (runPool (DT.findByProductId (toKey prodID))) (getPool dbConfig)
  return $ map toDomainTerm domainTerms
    where
      toDomainTerm dbDomainTerm = do
        let dbTerm   = DT.toDomainTerm dbDomainTerm
        let dbTermID = DT.toDomainTermID dbDomainTerm
        APIDomainTerm { domainTermID = Just dbTermID
                      , productID    = Just $ domainTermProductId dbTerm
                      , title        = domainTermTitle dbTerm
                      , description  = domainTermDescription dbTerm
                      }
productsDomainTerms prodID = do
  dbConfig    <- reader getDBConfig
  domainTerms <- liftIO $ runReaderT (runPool (DT.findByProductId (toKey prodID))) (getPool dbConfig)
  return $ map toDomainTerm domainTerms
    where
      toDomainTerm dbDomainTerm = do
        let dbTerm   = DT.toDomainTerm dbDomainTerm
        let dbTermID = DT.toDomainTermID dbDomainTerm
        APIDomainTerm { domainTermID = Just dbTermID
                      , productID    = Just $ domainTermProductId dbTerm
                      , title        = domainTermTitle dbTerm
                      , description  = domainTermDescription dbTerm
                      }