From de48c6f37d2179454c8edf5373e19b3fb84d232b Mon Sep 17 00:00:00 2001 From: Doga Oztuzun Date: Fri, 29 Oct 2021 11:07:43 +0300 Subject: [PATCH 1/5] Getting trades endpoint for the admin has been implemented --- .../src/admin/admin-trade.controller.ts | 26 ++++++++++++ .../src/admin/admin-trade.module.ts | 10 +++++ .../trade/exchange-irec/src/admin/index.ts | 2 + .../trade/exchange-irec/src/app.module.ts | 4 +- packages/trade/exchange-irec/src/index.ts | 1 + .../pods/trade/base-admin-trade.controller.ts | 42 +++++++++++++++++++ .../trade/exchange/src/pods/trade/index.ts | 1 + .../exchange/src/pods/trade/trade.service.ts | 2 +- 8 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 packages/trade/exchange-irec/src/admin/admin-trade.controller.ts create mode 100644 packages/trade/exchange-irec/src/admin/admin-trade.module.ts create mode 100644 packages/trade/exchange-irec/src/admin/index.ts create mode 100644 packages/trade/exchange/src/pods/trade/base-admin-trade.controller.ts diff --git a/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts b/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts new file mode 100644 index 0000000000..306c9e4ff9 --- /dev/null +++ b/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts @@ -0,0 +1,26 @@ +import { BaseAdminTradeController } from '@energyweb/exchange'; +import { + UserDecorator, + ActiveUserGuard, + NullOrUndefinedResultInterceptor +} from '@energyweb/origin-backend-utils'; +import { + Controller, + Get, + HttpStatus, + UseGuards, + UseInterceptors, + UsePipes, + ValidationPipe +} from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; +import { ApiBearerAuth, ApiResponse, ApiTags } from '@nestjs/swagger'; +import { ProductDTO, ProductFilterDTO } from '../product'; + + +@ApiTags('admin') +@ApiBearerAuth('access-token') +@Controller('admin') +@UseInterceptors(NullOrUndefinedResultInterceptor) +@UsePipes(ValidationPipe) +export class AdminTradeController extends BaseAdminTradeController { } diff --git a/packages/trade/exchange-irec/src/admin/admin-trade.module.ts b/packages/trade/exchange-irec/src/admin/admin-trade.module.ts new file mode 100644 index 0000000000..83d01bab2f --- /dev/null +++ b/packages/trade/exchange-irec/src/admin/admin-trade.module.ts @@ -0,0 +1,10 @@ +import { TradeModule as BaseTradeModule } from '@energyweb/exchange'; +import { Module } from '@nestjs/common'; + +import { AdminTradeController } from './admin-trade.controller'; + +@Module({ + imports: [BaseTradeModule], + controllers: [AdminTradeController] +}) +export class AdminTradeModule {} diff --git a/packages/trade/exchange-irec/src/admin/index.ts b/packages/trade/exchange-irec/src/admin/index.ts new file mode 100644 index 0000000000..1735a19569 --- /dev/null +++ b/packages/trade/exchange-irec/src/admin/index.ts @@ -0,0 +1,2 @@ +export * from './admin-trade.controller'; +export * from './admin-trade.module'; \ No newline at end of file diff --git a/packages/trade/exchange-irec/src/app.module.ts b/packages/trade/exchange-irec/src/app.module.ts index 24c4c33864..e0b56d63d5 100644 --- a/packages/trade/exchange-irec/src/app.module.ts +++ b/packages/trade/exchange-irec/src/app.module.ts @@ -9,6 +9,7 @@ import { ProductModule } from './product'; import { RunnerModule } from './runner'; import { TradeModule } from './trade'; import { ExportModule } from './export'; +import { AdminTradeModule } from './admin'; @Module({ imports: [ @@ -19,7 +20,8 @@ import { ExportModule } from './export'; RunnerModule, DemandModule, TradeModule, - ExportModule + ExportModule, + AdminTradeModule ], providers: [IntUnitsOfEnergy] }) diff --git a/packages/trade/exchange-irec/src/index.ts b/packages/trade/exchange-irec/src/index.ts index c94eaae728..d6b5624691 100644 --- a/packages/trade/exchange-irec/src/index.ts +++ b/packages/trade/exchange-irec/src/index.ts @@ -7,6 +7,7 @@ export * from './product'; export * from './runner'; export * from './trade'; export * from './utils'; +export * from './admin'; export { entities as IssuerIRECEntities } from '@energyweb/issuer-irec-api'; diff --git a/packages/trade/exchange/src/pods/trade/base-admin-trade.controller.ts b/packages/trade/exchange/src/pods/trade/base-admin-trade.controller.ts new file mode 100644 index 0000000000..8996f9269a --- /dev/null +++ b/packages/trade/exchange/src/pods/trade/base-admin-trade.controller.ts @@ -0,0 +1,42 @@ +import { + ActiveUserGuard, + NullOrUndefinedResultInterceptor +} from '@energyweb/origin-backend-utils'; +import { + Controller, + Get, + HttpStatus, + UseGuards, + UseInterceptors, + UsePipes, + ValidationPipe +} from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; +import { ApiBearerAuth, ApiResponse, ApiTags } from '@nestjs/swagger'; + +import { TradeDTO } from './trade.dto'; +import { TradeService } from './trade.service'; + +@ApiTags('admin') +@ApiBearerAuth('access-token') +@Controller('admin') +@UseInterceptors(NullOrUndefinedResultInterceptor) +@UsePipes(ValidationPipe) +export class BaseAdminTradeController { + constructor(private readonly tradeService: TradeService) {} + + @UseGuards(AuthGuard(), ActiveUserGuard) + @Get('trades') + @ApiResponse({ status: HttpStatus.OK, type: [TradeDTO], description: 'Get all trades for Admin' }) + public async getAll(): Promise[]> { + const trades = await this.tradeService.getAll(); + + return trades.map((trade) => + TradeDTO.fromTrade( + trade, + trade.ask.assetId, + trade.ask.product + ) + ); + } +} diff --git a/packages/trade/exchange/src/pods/trade/index.ts b/packages/trade/exchange/src/pods/trade/index.ts index 619be4d6bb..3e198dc8a3 100644 --- a/packages/trade/exchange/src/pods/trade/index.ts +++ b/packages/trade/exchange/src/pods/trade/index.ts @@ -1,4 +1,5 @@ export * from './base-trade.controller'; +export * from './base-admin-trade.controller'; export * from './trade-accounting.module'; export * from './trade-accounting.service'; export * from './trade-executed-event.handler'; diff --git a/packages/trade/exchange/src/pods/trade/trade.service.ts b/packages/trade/exchange/src/pods/trade/trade.service.ts index 25b666e4eb..e69ec7ebd8 100644 --- a/packages/trade/exchange/src/pods/trade/trade.service.ts +++ b/packages/trade/exchange/src/pods/trade/trade.service.ts @@ -107,7 +107,7 @@ export class TradeService implements OnModuleInit { }); } - private async getAll() { + public async getAll() { return this.buildGetAllQuery().orderBy('trade.created', 'DESC').getMany(); } From b5bef636d6821309c008d84478d2fcae4ea970b4 Mon Sep 17 00:00:00 2001 From: Doga Oztuzun Date: Fri, 29 Oct 2021 11:09:24 +0300 Subject: [PATCH 2/5] unused imported dependencies have been removed --- .../exchange-irec/src/admin/admin-trade.controller.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts b/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts index 306c9e4ff9..7370cfda34 100644 --- a/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts +++ b/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts @@ -1,19 +1,11 @@ import { BaseAdminTradeController } from '@energyweb/exchange'; -import { - UserDecorator, - ActiveUserGuard, - NullOrUndefinedResultInterceptor -} from '@energyweb/origin-backend-utils'; +import { NullOrUndefinedResultInterceptor } from '@energyweb/origin-backend-utils'; import { Controller, - Get, - HttpStatus, - UseGuards, UseInterceptors, UsePipes, ValidationPipe } from '@nestjs/common'; -import { AuthGuard } from '@nestjs/passport'; import { ApiBearerAuth, ApiResponse, ApiTags } from '@nestjs/swagger'; import { ProductDTO, ProductFilterDTO } from '../product'; From 85fb810de192d7c13e0d06909ef1070e626a9992 Mon Sep 17 00:00:00 2001 From: Doga Oztuzun Date: Fri, 29 Oct 2021 11:29:52 +0300 Subject: [PATCH 3/5] Trades view has been implemented under menu item of Admin --- .../AppContainer/AppContainer.effects.tsx | 1 + .../exchange/data/src/fetching/adminTrades.ts | 14 +++ .../libs/exchange/data/src/fetching/index.ts | 1 + .../ui/localization/src/languages/en.json | 12 ++- .../ui/libs/user/logic/src/admin/index.ts | 7 +- .../ui/libs/user/logic/src/admin/trades.ts | 86 +++++++++++++++++++ .../libs/user/logic/src/menu/getAdminMenu.ts | 7 ++ packages/ui/libs/user/view/src/AdminApp.tsx | 6 +- .../AdminTradesPage.effects.ts | 18 ++++ .../pages/AdminTradesPage/AdminTradesPage.tsx | 9 ++ .../view/src/pages/AdminTradesPage/index.ts | 1 + packages/ui/libs/user/view/src/pages/index.ts | 1 + 12 files changed, 157 insertions(+), 6 deletions(-) create mode 100644 packages/ui/libs/exchange/data/src/fetching/adminTrades.ts create mode 100644 packages/ui/libs/user/logic/src/admin/trades.ts create mode 100644 packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.effects.ts create mode 100644 packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.tsx create mode 100644 packages/ui/libs/user/view/src/pages/AdminTradesPage/index.ts diff --git a/packages/ui/apps/origin-ui/src/components/AppContainer/AppContainer.effects.tsx b/packages/ui/apps/origin-ui/src/components/AppContainer/AppContainer.effects.tsx index 47336887c9..211ec19ad2 100644 --- a/packages/ui/apps/origin-ui/src/components/AppContainer/AppContainer.effects.tsx +++ b/packages/ui/apps/origin-ui/src/components/AppContainer/AppContainer.effects.tsx @@ -215,6 +215,7 @@ export const useAppContainerEffects = () => { const adminRoutesConfig: RoutesConfig['adminRoutes'] = { showClaims: userIsAdminOrSupport, showUsers: userIsAdminOrSupport, + showTrades: userIsAdminOrSupport, }; const adminMenu = getAdminMenu({ t, diff --git a/packages/ui/libs/exchange/data/src/fetching/adminTrades.ts b/packages/ui/libs/exchange/data/src/fetching/adminTrades.ts new file mode 100644 index 0000000000..83b668d486 --- /dev/null +++ b/packages/ui/libs/exchange/data/src/fetching/adminTrades.ts @@ -0,0 +1,14 @@ +import { + TradeDTO, + useAdminTradeControllerGetAll, +} from '@energyweb/exchange-irec-react-query-client'; + +export const useApiAdminTrades = () => { + const refetchInterval = 10000; + const { data, isLoading } = useAdminTradeControllerGetAll({ + query: { refetchInterval }, + }); + const adminTrades = data ?? ([] as TradeDTO[]); + + return { adminTrades, isLoading }; +}; diff --git a/packages/ui/libs/exchange/data/src/fetching/index.ts b/packages/ui/libs/exchange/data/src/fetching/index.ts index 4d2bc3c107..3360491aee 100644 --- a/packages/ui/libs/exchange/data/src/fetching/index.ts +++ b/packages/ui/libs/exchange/data/src/fetching/index.ts @@ -16,3 +16,4 @@ export * from './userAndAccount'; export * from './user'; export * from './assetById'; export * from './iRecDeviceById'; +export * from './adminTrades'; diff --git a/packages/ui/libs/ui/localization/src/languages/en.json b/packages/ui/libs/ui/localization/src/languages/en.json index 9bfc31757d..0b77924458 100644 --- a/packages/ui/libs/ui/localization/src/languages/en.json +++ b/packages/ui/libs/ui/localization/src/languages/en.json @@ -56,7 +56,8 @@ "admin": { "sectionTitle": "Admin", "users": "Users", - "claims": "Claims" + "claims": "Claims", + "trades": "Trades" }, "layout": { "userPendingTooltip": "Your user account status is pending", @@ -976,6 +977,15 @@ "userUpdateSuccess": "User successfully updated", "userUpdateError": "Error while updating user" } + }, + "trades": { + "date": "Date", + "buyer": "Buyer", + "seller": "Seller", + "device": "Device", + "quantity": "Quantity", + "price": "Price", + "total": "Total" } }, "general": { diff --git a/packages/ui/libs/user/logic/src/admin/index.ts b/packages/ui/libs/user/logic/src/admin/index.ts index e1e7ac24ad..6bced64624 100644 --- a/packages/ui/libs/user/logic/src/admin/index.ts +++ b/packages/ui/libs/user/logic/src/admin/index.ts @@ -1,3 +1,4 @@ -export * from './useAdminUsersTableLogic'; -export * from './useAdminUpdateUserFormLogic'; -export * from './claims'; +export * from './useAdminUsersTableLogic'; +export * from './useAdminUpdateUserFormLogic'; +export * from './claims'; +export * from './trades'; diff --git a/packages/ui/libs/user/logic/src/admin/trades.ts b/packages/ui/libs/user/logic/src/admin/trades.ts new file mode 100644 index 0000000000..11b8027867 --- /dev/null +++ b/packages/ui/libs/user/logic/src/admin/trades.ts @@ -0,0 +1,86 @@ +import { TradeDTO } from '@energyweb/exchange-irec-react-query-client'; +import { TableComponentProps, TableRowData } from '@energyweb/origin-ui-core'; +import { useTranslation } from 'react-i18next'; +import { formatDate, PowerFormatter } from '@energyweb/origin-ui-utils'; +import { ComposedPublicDevice } from '@energyweb/origin-ui-user-data'; + +type TUseAdminTradesTableLogicArgs = { + trades: TradeDTO[]; + allDevices: ComposedPublicDevice[]; + isLoading: boolean; +}; +type TUseAdminTradesTableLogic = ( + args: TUseAdminTradesTableLogicArgs +) => TableComponentProps; +type TFormatTrades = ( + args: Omit +) => TableRowData[]; + +type FormattedTrade = { + id: string; + date: string; + buyer: string; + seller: string; + deviceName: string; + volume: number; + price: number; + total: number; +}; + +const formatTrades: TFormatTrades = ({ trades, allDevices }) => { + const formattedTrades: FormattedTrade[] = []; + + trades?.forEach((trade) => { + formattedTrades.push({ + id: `${trade.id}`, + date: formatDate(trade.created), + buyer: '', + seller: '', + deviceName: '', + volume: 0, + price: 0, + total: 0, + }); + }); + + // trades?.forEach((trade) => + // trade.claims?.forEach((claim) => { + // formattedClaims.push({ + // id: `${trade.id};${claim.claimData.periodStartDate}`, + // certificateId: trade.id, + // deviceName: allDevices.find( + // (device) => device.externalRegistryId === trade.deviceId + // )?.name, + // energy: PowerFormatter.format(parseInt(claim.value), true), + // beneficiary: claim.claimData.beneficiary, + // fromDate: formatDate(claim.claimData.periodStartDate), + // toDate: formatDate(claim.claimData.periodEndDate), + // }); + // }) + // ); + + return formattedTrades; +}; + +export const useAdminTradesTableLogic: TUseAdminTradesTableLogic = ({ + isLoading, + trades, + allDevices, +}) => { + const { t } = useTranslation(); + return { + header: { + date: t('admin.trades.date'), + buyer: t('admin.trades.buyer'), + seller: t('admin.trades.seller'), + energy: 'Energy', + deviceName: t('admin.trades.device'), + volume: t('admin.trades.quantity'), + price: t('admin.trades.price'), + total: t('admin.trades.total'), + }, + pageSize: 10, + loading: isLoading, + data: formatTrades({ trades, allDevices }), + }; +}; diff --git a/packages/ui/libs/user/logic/src/menu/getAdminMenu.ts b/packages/ui/libs/user/logic/src/menu/getAdminMenu.ts index c50f3b9b73..57368116c5 100644 --- a/packages/ui/libs/user/logic/src/menu/getAdminMenu.ts +++ b/packages/ui/libs/user/logic/src/menu/getAdminMenu.ts @@ -7,6 +7,7 @@ export type TGetAdminMenuArgs = { showSection: boolean; showUsers: boolean; showClaims: boolean; + showTrades: boolean; menuButtonClass?: string; selectedMenuItemClass?: string; }; @@ -19,6 +20,7 @@ export const getAdminMenu: TUseAdminMenuFn = ({ showSection, showUsers, showClaims, + showTrades, menuButtonClass, selectedMenuItemClass, }) => { @@ -38,6 +40,11 @@ export const getAdminMenu: TUseAdminMenuFn = ({ label: t('navigation.admin.claims'), show: showClaims, }, + { + url: 'trades', + label: t('navigation.admin.trades'), + show: showTrades, + }, ], menuButtonClass, selectedMenuItemClass, diff --git a/packages/ui/libs/user/view/src/AdminApp.tsx b/packages/ui/libs/user/view/src/AdminApp.tsx index 6a32af5dd0..c12ea6e29f 100644 --- a/packages/ui/libs/user/view/src/AdminApp.tsx +++ b/packages/ui/libs/user/view/src/AdminApp.tsx @@ -2,17 +2,18 @@ import { PageNotFound } from '@energyweb/origin-ui-core'; import React, { FC } from 'react'; import { Route, Routes } from 'react-router'; -import { AdminUsersPage, AdminUpdateUserPage, AdminClaimsPage } from './pages'; +import { AdminUsersPage, AdminUpdateUserPage, AdminClaimsPage, AdminTradesPage } from './pages'; interface AdminAppProps { routesConfig: { showClaims: boolean; showUsers: boolean; + showTrades: boolean; }; } export const AdminApp: FC = ({ routesConfig }) => { - const { showClaims, showUsers } = routesConfig; + const { showClaims, showUsers, showTrades } = routesConfig; return ( {showUsers && } />} @@ -20,6 +21,7 @@ export const AdminApp: FC = ({ routesConfig }) => { } /> )} {showClaims && } />} + {showTrades && } />} } /> ); diff --git a/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.effects.ts b/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.effects.ts new file mode 100644 index 0000000000..040c975548 --- /dev/null +++ b/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.effects.ts @@ -0,0 +1,18 @@ +import { useFetchAllDevices } from '@energyweb/origin-ui-user-data'; +import { useApiAdminTrades } from '@energyweb/origin-ui-exchange-data'; +import { useAdminTradesTableLogic } from '@energyweb/origin-ui-user-logic'; + +export const useAdminTradesPageEffects = () => { + const { adminTrades, isLoading: areTradesLoading } = useApiAdminTrades(); + const { allDevices, isLoading: areDeviceLoading } = useFetchAllDevices(); + + const isLoading = areDeviceLoading || areTradesLoading; + + const tableProps = useAdminTradesTableLogic({ + trades: adminTrades, + allDevices, + isLoading, + }); + + return tableProps; +}; diff --git a/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.tsx b/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.tsx new file mode 100644 index 0000000000..24b2b64233 --- /dev/null +++ b/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.tsx @@ -0,0 +1,9 @@ +import { TableComponent } from '@energyweb/origin-ui-core'; +import React from 'react'; +import { useAdminTradesPageEffects } from './AdminTradesPage.effects'; + +export const AdminTradesPage = () => { + const tableProps = useAdminTradesPageEffects(); + + return ; +}; diff --git a/packages/ui/libs/user/view/src/pages/AdminTradesPage/index.ts b/packages/ui/libs/user/view/src/pages/AdminTradesPage/index.ts new file mode 100644 index 0000000000..01ab83a1a7 --- /dev/null +++ b/packages/ui/libs/user/view/src/pages/AdminTradesPage/index.ts @@ -0,0 +1 @@ +export * from './AdminTradesPage'; diff --git a/packages/ui/libs/user/view/src/pages/index.ts b/packages/ui/libs/user/view/src/pages/index.ts index f44df600f0..a781fd27d6 100644 --- a/packages/ui/libs/user/view/src/pages/index.ts +++ b/packages/ui/libs/user/view/src/pages/index.ts @@ -1,6 +1,7 @@ export * from './AdminUsersPage'; export * from './AdminUpdateUserPage'; export * from './AdminClaimsPage'; +export * from './AdminTradesPage'; export * from './LoginPage'; export * from './RegisterPage'; From b61fef2ffaeb2570d67a6144ed1eb24fbfc46b9d Mon Sep 17 00:00:00 2001 From: Doga Oztuzun Date: Fri, 29 Oct 2021 11:44:51 +0300 Subject: [PATCH 4/5] unused imported dependencies have been removed --- .../trade/exchange-irec/src/admin/admin-trade.controller.ts | 2 +- packages/ui/libs/user/logic/src/admin/trades.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts b/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts index 7370cfda34..dad0d12dac 100644 --- a/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts +++ b/packages/trade/exchange-irec/src/admin/admin-trade.controller.ts @@ -6,7 +6,7 @@ import { UsePipes, ValidationPipe } from '@nestjs/common'; -import { ApiBearerAuth, ApiResponse, ApiTags } from '@nestjs/swagger'; +import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; import { ProductDTO, ProductFilterDTO } from '../product'; diff --git a/packages/ui/libs/user/logic/src/admin/trades.ts b/packages/ui/libs/user/logic/src/admin/trades.ts index 11b8027867..e6b9e866e9 100644 --- a/packages/ui/libs/user/logic/src/admin/trades.ts +++ b/packages/ui/libs/user/logic/src/admin/trades.ts @@ -1,7 +1,7 @@ import { TradeDTO } from '@energyweb/exchange-irec-react-query-client'; import { TableComponentProps, TableRowData } from '@energyweb/origin-ui-core'; import { useTranslation } from 'react-i18next'; -import { formatDate, PowerFormatter } from '@energyweb/origin-ui-utils'; +import { formatDate } from '@energyweb/origin-ui-utils'; import { ComposedPublicDevice } from '@energyweb/origin-ui-user-data'; type TUseAdminTradesTableLogicArgs = { From a77239c4a3f264bc5338d842eb24897b14261857 Mon Sep 17 00:00:00 2001 From: Doga Oztuzun Date: Fri, 29 Oct 2021 17:07:28 +0300 Subject: [PATCH 5/5] exchange dependency has been fixed in user lib --- packages/ui/libs/exchange/data/src/fetching/index.ts | 1 - .../libs/{exchange => user}/data/src/fetching/adminTrades.ts | 0 packages/ui/libs/user/data/src/fetching/index.ts | 1 + .../view/src/pages/AdminTradesPage/AdminTradesPage.effects.ts | 3 +-- 4 files changed, 2 insertions(+), 3 deletions(-) rename packages/ui/libs/{exchange => user}/data/src/fetching/adminTrades.ts (100%) diff --git a/packages/ui/libs/exchange/data/src/fetching/index.ts b/packages/ui/libs/exchange/data/src/fetching/index.ts index 3360491aee..4d2bc3c107 100644 --- a/packages/ui/libs/exchange/data/src/fetching/index.ts +++ b/packages/ui/libs/exchange/data/src/fetching/index.ts @@ -16,4 +16,3 @@ export * from './userAndAccount'; export * from './user'; export * from './assetById'; export * from './iRecDeviceById'; -export * from './adminTrades'; diff --git a/packages/ui/libs/exchange/data/src/fetching/adminTrades.ts b/packages/ui/libs/user/data/src/fetching/adminTrades.ts similarity index 100% rename from packages/ui/libs/exchange/data/src/fetching/adminTrades.ts rename to packages/ui/libs/user/data/src/fetching/adminTrades.ts diff --git a/packages/ui/libs/user/data/src/fetching/index.ts b/packages/ui/libs/user/data/src/fetching/index.ts index ee496a55ca..623399f663 100644 --- a/packages/ui/libs/user/data/src/fetching/index.ts +++ b/packages/ui/libs/user/data/src/fetching/index.ts @@ -5,3 +5,4 @@ export * from './blockchainCertificates'; export * from './exchangeAddress'; export * from './pollExchangeAddress'; export * from './user'; +export * from './adminTrades'; diff --git a/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.effects.ts b/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.effects.ts index 040c975548..7d8d5d0d5b 100644 --- a/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.effects.ts +++ b/packages/ui/libs/user/view/src/pages/AdminTradesPage/AdminTradesPage.effects.ts @@ -1,5 +1,4 @@ -import { useFetchAllDevices } from '@energyweb/origin-ui-user-data'; -import { useApiAdminTrades } from '@energyweb/origin-ui-exchange-data'; +import { useFetchAllDevices, useApiAdminTrades } from '@energyweb/origin-ui-user-data'; import { useAdminTradesTableLogic } from '@energyweb/origin-ui-user-logic'; export const useAdminTradesPageEffects = () => {