@@ -24,9 +24,11 @@ import { UserEntity } from '../../entities/user/user.entity.js';
2424import { InTransactionEnum } from '../../enums/in-transaction.enum.js' ;
2525import { Messages } from '../../exceptions/text/messages.js' ;
2626import { SentryInterceptor } from '../../interceptors/sentry.interceptor.js' ;
27+ import { ConnectionEntity } from '../../entities/connection/connection.entity.js' ;
2728import { CreatedConnectionResponse , SuccessResponse } from './data-structures/common-responce.ds.js' ;
2829import { CreateConnectionForHostedDbDto } from './data-structures/create-connecttion-for-selfhosted-db.dto.js' ;
2930import { DeleteConnectionForHostedDbDto } from './data-structures/delete-connection-for-hosted-db.dto.js' ;
31+ import { GetConnectionsInfoByIdsDS } from './data-structures/get-connections-info-by-ids.ds.js' ;
3032import { RegisterCompanyWebhookDS } from './data-structures/register-company.ds.js' ;
3133import { RegisteredCompanyDS } from './data-structures/registered-company.ds.js' ;
3234import { SaasRegisterUserWithGithub } from './data-structures/saas-register-user-with-github.js' ;
@@ -38,6 +40,7 @@ import {
3840 ICreateConnectionForHostedDb ,
3941 IDeleteConnectionForHostedDb ,
4042 IFreezeConnectionsInCompany ,
43+ IGetConnectionsInfoByIds ,
4144 IGetUserInfo ,
4245 ILoginUserWithGitHub ,
4346 ILoginUserWithGoogle ,
@@ -95,6 +98,8 @@ export class SaasController {
9598 private readonly deleteConnectionForHostedDbUseCase : IDeleteConnectionForHostedDb ,
9699 @Inject ( UseCaseType . SAAS_UPDATE_HOSTED_CONNECTION_PASSWORD )
97100 private readonly updateHostedConnectionPasswordUseCase : IUpdateHostedConnectionPassword ,
101+ @Inject ( UseCaseType . SAAS_GET_CONNECTIONS_INFO_BY_IDS )
102+ private readonly getConnectionsInfoByIdsUseCase : IGetConnectionsInfoByIds ,
98103 ) { }
99104
100105 @ApiOperation ( { summary : 'Company registered webhook' } )
@@ -326,4 +331,17 @@ export class SaasController {
326331 ) : Promise < SuccessResponse > {
327332 return await this . updateHostedConnectionPasswordUseCase . execute ( updatePasswordData ) ;
328333 }
334+
335+ @ApiOperation ( { summary : 'Get connections info by ids' } )
336+ @ApiBody ( { type : GetConnectionsInfoByIdsDS } )
337+ @ApiResponse ( {
338+ status : 200 ,
339+ type : [ ConnectionEntity ] ,
340+ } )
341+ @Post ( '/connections/info' )
342+ async getConnectionsInfoByIds (
343+ @Body ( ) connectionsData : GetConnectionsInfoByIdsDS ,
344+ ) : Promise < Array < ConnectionEntity > > {
345+ return await this . getConnectionsInfoByIdsUseCase . execute ( connectionsData ) ;
346+ }
329347}
0 commit comments