hunk.code_window: import { GetIntegrationsCommand } from './get-integrations.command';
   @Injectable()
   export class GetIntegrations {
  
hunk.labels: add keep keep keep
hunk.after_edit: import { GetDecryptedIntegrationsCommand } from '../get-decrypted-integrations/get-decrypted-integrations.command';
   import { GetDecryptedIntegrations } from '../get-decrypted-integrations/get-decrypted-integrations.usecase';
  
hunk.file_path: apps/api/src/app/integrations/usecases/get-integrations/get-integrations.usecase.ts
hunk.type: add
file: /* eslint-disable @typescript-eslint/no-explicit-any */
  import { plainToClass } from 'class-transformer';
  import { validateSync } from 'class-validator';
  import * as Sentry from '@sentry/node';
  import { BadRequestException, flatten } from '@nestjs/common';
  
  export abstract class BaseCommand {
    static create<T extends BaseCommand>(this: new (...args: any[]) => T, data: T): T {
      const convertedObject = plainToClass<T, any>(this, {
        ...data,
      });
  
      const errors = validateSync(convertedObject as unknown as object);
      if (errors?.length) {
        const mappedErrors = flatten(errors.map((item) => Object.values(item.constraints)));
  
        Sentry.addBreadcrumb({
          category: 'BaseCommand',
          data: mappedErrors,
        });
  
        throw new BadRequestException(mappedErrors);
      }
  
      return convertedObject;
    }
  }
  