diff --git a/docsfera.json b/docsfera.json index 8765bd2..bfbd7fa 100644 --- a/docsfera.json +++ b/docsfera.json @@ -5599,6 +5599,28 @@ ] } }, + "/customers/logs-dashboard": { + "get": { + "operationId": "CustomersController_getCustomerMixPanelLogsDashboard", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "Customers" + ], + "security": [ + { + "access-token": [] + }, + { + "access-token": [] + } + ] + } + }, "/open-data/sharing-ocean-data": { "post": { "operationId": "OpenDataController_createUser", diff --git a/src/modules/customers/customers.controller.ts b/src/modules/customers/customers.controller.ts index 1bd9835..7700eb3 100644 --- a/src/modules/customers/customers.controller.ts +++ b/src/modules/customers/customers.controller.ts @@ -91,4 +91,21 @@ export class CustomersController { const metadata = PackTheMetadata(user); return this.customersService.getMonitoringDashboardUrl(metadata); } + + @Get('logs-dashboard') + @Authenticated() + @RequireAllPermissions( + PERMISSIONS_GROUPS.USERS.permissions.ADMIN, + ) + async getCustomerMixPanelLogsDashboard( + @User() user: RequestUser, + ): Promise<{ url: string }> { + this.logger.info('getLogsDashboardUrl'); + const metadata = PackTheMetadata(user); + + const result = await this.customersService.getLogsDashboardUrl(metadata); + return result; + } + + } diff --git a/src/modules/customers/customers.service.ts b/src/modules/customers/customers.service.ts index 7c85561..36df7c3 100644 --- a/src/modules/customers/customers.service.ts +++ b/src/modules/customers/customers.service.ts @@ -154,6 +154,23 @@ export class CustomersService implements OnModuleInit { ); logger.info('Done'); + return res; + } + async getLogsDashboardUrl(metadata: Metadata) { + logger.info('CustomersService - getMixPanelLogsDashboardUrl'); + + const res = await lastValueFrom( + this.pipelineReadService.PipelineV2GetDashboardUrl( + { + dashboard_id: '103', + exp: '15m', + metabase_customer_name: 'dadosferatech', + }, + metadata, + ), + ); + logger.info('Done'); + return res; } }