hunk.code_window:   START_SENDING = 'Start sending message',
     START_DIGESTING = 'Start digesting',
     FILTER_STEPS = 'Step was filtered based on steps filters',
     DIGESTED_EVENTS_PROVIDED = 'Steps to get digest events found',
     DIGEST_TRIGGERED_EVENTS = 'Digest triggered events',
     STEPS_FILTERED_BY_PREFERENCES = 'Steps filtered by subscriber preferences',
     DIGEST_MERGED = 'Digest was merged with other digest',
     DELAY_FINISHED = 'Delay is finished',
   }
  
hunk.labels: keep keep keep keep keep replace keep keep keep
hunk.after_edit:   STEP_FILTERED_BY_PREFERENCES = 'Step filtered by subscriber preferences',
  
hunk.file_path: apps/api/src/app/execution-details/usecases/create-execution-details/create-execution-details.command.ts
hunk.type: replace
file: /* eslint-disable @typescript-eslint/no-explicit-any */
  import { plainToInstance } 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 = plainToInstance<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;
    }
  }
  